Rockbox mail archiveSubject: Re: Getting a plugin to play sound
Re: Getting a plugin to play sound
From: Joseph Garvin <k04jg02_at_gmail.com>
Date: Sat, 26 Jul 2008 09:20:50 -0400
On Mon, Jul 21, 2008 at 7:45 PM, Michael Sevakis <jethead71_at_sbcglobal.net>wrote:
> 2) pcm_play_data may be used without the callback parameter by specifiying
> an address and size in order to play a single clip. If you wish to play
> sound continuously, then use the callback instead and return the buffer
> address and size to be played from that callback.
What do you mean by continuously? Will the sound get randomly interrupted
otherwise? Or do you mean that without the callback playback will block
> Every time that a buffer
> is played out, the callback is asked for the next buffer to play but
> stopping and starting playback. The playback engine, mplegplayer and doom
> for example use the callback whereas metronome uses the individual clip
> method. The callback is called asynchronously in interrupt context so what
> you may do in there is limited.
So would I use the callback for example for mixing sound, if my game (say
doom) had background music but occasionally made sounds in response to
player actions? (like gun fire) I'm just trying to get a handle on why
things work this way instead of just having a play_sound(some_wav_file).
Received on 2008-07-26