views:

468

answers:

3

Hello,

I am curious. How would one implement the most simple audio engine ever? I have something like a stream for audio data in mind using your default audio device. Playing a lot with RtAudio, I think if one could drop some of the features, this would be possible. Someone any idea where to start?

Thank you so much for reading my question.

regards

+1  A: 

I would do it (did do it) like this: http://ccan.ozlabs.org/info/wwviaudio.html

smcameron
A: 

Well there is no reason why you can't create an audio engine that has a trivially simple interface:

 audioEngine.PlayStream(myStream)

The audio engine would then periodically read data from that stream and send it to the soundcard. The reason audio engines tend to be more complicated than this, is that there are all kinds of parameters you might want to control, including latency of playback, sample rate, bit depth, as well as often the need to convert audio between formats. Add in the problems of repositioning streams, and synchronizing multiple streams, supporting multiple audio driver APIs etc, and soon you have an audio engine as complicated as any other.

Mark Heath
A: 

Thank you for your answers.

to .Mark Heath:

yes of course I know that there might be a lot of parameters to tweak be it the filter cutoff, resonance, delay timing etc etc ..

I was just curious how to build an audio engine as simple as possible and modular as possible. The major intention I had in mind was to rebuild the gameboy soundchip ( again here, there a lot of implementations ie. JavaBoy).

to.smcameron

It seems that ccan/wwviaaudio has a dependency to libvorbis / portaudio (version >=19), that would yield the same effect as using rtaudio ( which is, compared to other realtime audio interface having build in asio support, rather small). However, I will give it a try.

regards,

audax

Instead of creating another answer, you should use add comment in each answer to comment on other's solutions.
FurtiveFelon
It sounds to me like you'd be better off ignoring the whole "create an audio engine" problem and concentrate on actually simulating the chip. A VST or AU implementation would be much more generally useful.
Julian Birch