SDL_mixer, Mix_PlayChannel(-1,phaser,1), delay in playing

Hi all,

(sorry for my bad english, I am from India)

I found that there is considerable delay in playing a wave file using
Mix_PlayChannel(-1,phaser,1).

I thought that buffer size might be the reason and it appears to be right.

The delay increases with buffer size. When I used buffer size 1024*16, the
dealay was quite lengthy.
(System confiG : VC++ 6.0, Windows 2000, Debug mode, 1Ghz processor, sound
card config ??
unknown)

only 512 appears to be the perfect solution to start the sound, but the
sound at buffer size is quite distorted (noisy).

I think someone may be able to look in to the problem,

Thanks and regards,
tony

BTW, the Mix_OpenAudio doesnot initialise when I wanted to use 64*1024
It returns error: Mix_OpenAudio: Sound buffer size must be between 2 and
134217727

I think SDL mail list must be easy to access and search, categories, say
like a forum._________________________________________________________________
Feeling like a vacation? Then you are in the right place.
http://www.msn.co.in/Travel/ Get the best travel deals here!

The delay increases with buffer size. When I used buffer size 1024*16, the
dealay was quite lengthy.

You want the buffer size to be as small as possible. The larger the
buffer, the more latency you’ll experience. If it’s too small, you’ll
get skips in the audio. It’s a balancing act. :slight_smile:

–ryan.

i wonder if theres a way to detect latency (SDL_GetTicks maybe?) and also
detect skipping (no idea).

if so maybe someone could make code that if it detected latency would
decrease buffer size and if it detected skipping, would increase buffer size
until it reached some kind of happy medium with a minimal amount of both?

i dont know where to begin on something like this but it would be a neat
feature for a wrapper lib or some example code to post somewhere. Ive seen
lots of posts about what a pain it is to balance it on different systems and
ive never actualy heard a good solution to the problem.> ----- Original Message -----

From: icculus@icculus.org (Ryan C. Gordon)
To:
Sent: Sunday, January 11, 2004 11:55 AM
Subject: Re: [SDL] SDL_mixer, Mix_PlayChannel(-1,phaser,1), delay in playing

The delay increases with buffer size. When I used buffer size 1024*16,
the

dealay was quite lengthy.

You want the buffer size to be as small as possible. The larger the
buffer, the more latency you’ll experience. If it’s too small, you’ll
get skips in the audio. It’s a balancing act. :slight_smile:

–ryan.


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Well, there’s this:

http://www.libsdl.org/pipermail/sdl/

I admit, pipermail archives aren’t the easiest to browse, but you can
also search via Google with: “site:www.libsdl.org”

-bill!
bill at newbreedsoftware.com Got kids? Get Tux Paint!
http://newbreedsoftware.com/bill/ http://newbreedsoftware.com/tuxpaint/On Mon, Jan 12, 2004 at 12:44:31AM +0530, tony AI wrote:

I think SDL mail list must be easy to access and search, categories, say
like a forum.