3 ms·
For a library like that, isn't it also a good idea to let me plug in my own backend? That is, let me specify the sample format I want and either provide a funct
by anon4 12y ago
For a library like that, isn't it also a good idea to let me plug in my own backend? That is, let me specify the sample format I want and either provide a function I can call that will fill a buffer with samples, or ask me to give you a callback that you can call once you have samples ready. Preferably, let me choose which model fits my use better.
- CAMLORN 12y agoLibaudioverse separates the audio backend from the audio simulation. It is already possible to do this: you create what I call a read simulation, set up your objects and connect them, and then use getBlock on it. Allowing the computation of an arbitrary number of samples is not permitted because it introduces a number of performance headaches and code complexities; in addition, I've not yet seen anything related to audio output that randomly resizes the blocks on you. If there's enough people that need me to add a queue that automatically breaks the blocks, I will do so. Either way, you can already send it anywhere, and I could have it working on platforms without backends with a minor code change. More interestingly, if you are connected to an audio device, you can use a GraphListener. GraphListeners call a callback on you every time a block gets processed. As a consequence, it's also more than possible to do stuff like live stream over the internet. I am debating the merit of a backend that advances the simulation without playing: I can see potential uses for it, I'm just not sure if they're good ones.