[SDL] SDL useful for sound synthesis?
george.waltzer at gmail.com
Thu Sep 21 10:12:08 PDT 2006
I think that's the clasic problem trying to stream anything, regardless if
audio or video.
Have you tried to make yourself a "circular" buffer for audio?
Play in one half your precalculated 1second audio sequence for example.
Durring this, calculate/prepare your second sequence in the 2nd half buffer.
How to do this without clicks and ugly stuff? Use the treading posibility of
create a thread(there are tutorials about this). You should play from within
By using a locking mechanism for the buffer (a mutex), you may see from your
program when a half-buffer becomes empty. Pass to the tread the other
start again your calculation in the "empty" buffer.
Try to use small bufers, (2- or 8 seconds long play duration?) and use
your sequences of calculations.
I don't know, I just hope you could catch the ideea (I don't think it is
mine at all :) ),
I didn't tried yet but I'll have to do too something similar in future for
On 9/21/06, Louis Desjardins <lost_bits1110 at hotmail.com> wrote:
> Hi there,
> I've been browsing through the SDL site and the examples to try to figure
> whether SDL is appropriate for my application.
> I'm basically synthesizing my own sound using an "additive synthesis"
> technique, i.e. adding individual continuous sinusoids that each have
> own phase, frequency, and amplitude.
> I am able to compute 10 seconds of sound and then output this to the audio
> device simply via OSS. However, I need to be able to do this in an
> "on-the-fly" manner, i.e. I cant be precalculating 10 seconds of sound,
> rather, I will be calculating a few milliseconds of sound samples at a
> and playing these as soon as they get processed.
> I just have to make sure that everything is real-time and sounds
> and that there are no clicks or anything between samples.
> I am totally new to audio programming so if someone could help direct me
> to whether SDL or SDL_mixer (or maybe another library) would be best
> for my needs (and why?) that woudl be great!
> Thanks again,
> Find a local pizza place, music store, museum and more…then map the best
> route! http://local.live.com
> SDL mailing list
> SDL at libsdl.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the SDL