[SDL] Real-time audio generation
Peter Mackay
mackay.pete+sdl at gmail.com
Fri Sep 19 08:58:39 PDT 2008
Really the callback provided to SDL_OpenAudio should be all you need.
I'm not sure what the problem is exactly.
Regardless, here's some pretty much bare bones code, with comments. I
won't promise that it does everything right though:
http://code.google.com/p/quake-gamecube/source/browse/trunk/quake/src/sdl/sound.cpp
Rip out the Quake specific parts and you'll be left with an empty
callback function which you should complete to generate audio data.
Hope this helps,
Peter
2008/9/19 W.Boeke <w.boeke at chello.nl>:
> Will Langford wrote:
>>
>> An audio buffer is an audio buffer. Just fill a given audio buffer with
>> your progmatically generated content and spit that at the audio backend.
>> No
>> different than loading sections of a large audio file bits at a time into
>> the audio backend, except you substitute your generators in place of file
>> reading.
>>
>
> That's exactly what I did, however the result was horrible.
>
>> If you're fishing for documents on how to generate different waveforms and
>> stuff, ya should ask more bluntly so :)
>>
>> -Will
>
> I'm no fisher, and generating waveforms is my speciality ;)
>
> Please, please 1 small, working example ....
>
> Wouter
> _______________________________________________
> SDL mailing list
> SDL at lists.libsdl.org
> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
>
More information about the SDL
mailing list