gnash-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnash-dev] SDL sound handler


From: strk
Subject: Re: [Gnash-dev] SDL sound handler
Date: Thu, 11 Jun 2009 17:08:04 +0200

On Thu, Jun 11, 2009 at 04:50:11PM +0200, Andrea Palmatè wrote:

> so basically i must spawn a thread with its timer that call fetchSamples 
> every tot ms and play them?

Yes. Not *necessarely* a thread though.
Actually, as long as the GUI owns the sound_handler
or has a way to access it, it could as well fetch
the samples from main thread.

The thing is that Gnash core lib itself will NOT
send anything to a sound card, rather someone must
pull samples out of it.

For SDL it's the sound_handler subclass itself setting
up a thread. You may opt to delegate the pulling
and actual sound subsystem interface to the GUI...

> SDL callback how many times is called in a second?

Adding a log_debug shows it's called between 20 and 22 times,
Each time it requests 8192 bytes (must be it's soundcard buffer).
This is between 40960 and 45056 "stereo samples" per second, aiming
at a rounded and nominal 44100 output sample rate.

Just note that the sound_handler::fetchSound() currently speaks
"mono samples" (for no special reason, just a bad idea still not
fixed) so the target is really fetching 88200 "samples" from
sound_handler::fetchSamples()

--strk;

 Free GIS & Flash consultant/developer      ()  ASCII Ribbon Campaign
 http://foo.keybit.net/~strk/services.html  /\  Keep it simple! 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]