[SDL] Audio callback function is not called in time sometimes
Mine
mine260309 at gmail.com
Tue Dec 4 06:00:12 PST 2007
Anyone know about that?
Here's some data about the delay of audio_callback function:
1) when it's playing normally, the interval between two audio_callback
function is about 25~31 ticks in SDL (get from SDL_GetTicks );
2) when the sound is fitful, the interval between two audio_callback is
totally variable from 40 to 80, or larger sometimes.
My question is, how does this problem come? And how to resolve it if
possible?
On Nov 30, 2007 9:33 PM, Mine <mine260309 at gmail.com> wrote:
> Hi All,
> I'm developing a media player using SDL, and now I met the problem
> that the audio callback function is sometimes not called in time, and cause
> the audio a little fitful.
> I did some investigation about this problem. I use such piece of code
> to open the audio device:
> wanted_spec.xxx = xxx;
> wanted_spec.callback = audio_callback; //audio_callback is my
> audio callback function
> SDL_OpenAudio(&wanted_spec, &spec);
> I put some log in audio_callback function, and find that when the
> phenomenon occurs the audio_callback function is not called in time, which
> cause a split of the audio. And continuously not in time called
> audio_callback causes the fitful sound.
>
> My OS is Windows XP, and generally this phenomenon occurs when
> there're task switches, like focus on other windows, minimum/maximum a
> window or something like that. And if there's no such task switch, the sound
> is smooth.
> Do you know anything about that?
> --
> Mine
--
俺たちが乗った列車は途中下車はできないんだ!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20071204/f313d349/attachment.htm
More information about the SDL
mailing list