[SDL] callback issue
Scott Harper
lareon at comcast.net
Sat Apr 28 10:25:11 PDT 2007
As far as I'm aware, the audio hardware on different systems will ask
for different amounts of audio data each callback, so your
responsibility is to provide it with however much data it asks for.
Often (for me, at least) this has meant playing through the end of
one sample/source and starting the next one just a little bit before
the next callback. It's not clean, but the result sounds nice anyway.
-- Scott
On Apr 28, 2007, at 10:25 AM, Chris Dobbs wrote:
> Futher update on this:
> I tried it on another linux box and guess what ? yep, I get 512
> passed in as the length as expected.
> Guess this means there is something not right with the other box,
> anyone got and ideas what it could be. I am running with SDL1.2 in
> tandem with the SDL_AudioIn project to provide microphone input.
> Strange thing is I have looke thru some old logs and it definitley
> used to behave correctly so unless I have installed something
> that's upset the sound layer or worse the dsp is shot.
>
> -Chris
> ----- Original Message -----
> From: Chris Dobbs
> To: sdl at lists.libsdl.org
> Sent: Saturday, April 28, 2007 4:28 PM
> Subject: [SDL] callback issue
>
> All,
> Can someone verify if the following behaviour is correct (and if so
> why) regarding audio output.
>
> I have opened the audio device with following params:
> frequency=8000
> samples=256
> channels=1
> format=AUDIO_S16SYS
>
> The audio callback routine I have assigned fires ok but the length
> parameter passed to it is not 512 as I would expect, instead it is
> 340...!?
>
> The way I understand this is that I have asked SDL to allow me to
> feed in 256 16 bit samples (512 bytes) every time the callback fires.
>
> Is this correct or am I missing something - It is possible that my
> DSP has developed a problem as I have noticed odd crackles
> occasionally in the speaker.
> The OS is 2.6.18 custom on a DELL inspiron 6000
>
> Any help is appreciated as usual.
> -Chris
>
>
>
> _______________________________________________
> SDL mailing list
> SDL at lists.libsdl.org
> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
> _______________________________________________
> SDL mailing list
> SDL at lists.libsdl.org
> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
More information about the SDL
mailing list