WAVE playback bad
Max Horn
max at quendi.de
Thu Oct 4 03:46:07 EDT 2001
At 21:09 Uhr -0400 03.10.2001, Ryan C. Gordon wrote:
> > I have a wave file that is not playing properly for me using
>> SDL_sounds's playsound. It sounds as if it was played at double speed
>> or so (i.e. shorter than with other players, and higher pitch).
>
>Hhm. The problem is twofold.
>
>First, playsound forces a sample rate of 44100. Second, this particular
>WAVE file plays at a sample rate of 22255, which isn't a multiple of
>44100, so SDL refuses to do the conversion.
>
>Which is annoying.
>
>The solution in this case is for playsound to not force the sample rate to
>an arbitrary number, but instead create the Sound_Sample object first, and
>then call SDL_OpenAudio() with those numbers. SDL_OpenAudio is recalled
>for each file listed on the command line. (This is in CVS.)
>
>Note this only helps if the sound device can actually DO a frequency of
>22255, otherwise, SDL will try to convert with...uh, the same problems.
>
>We REALLY need to fix the damned audio converter.
In the case we rolled our own (crude) converter. If we do this, and
do it right, we could then distribute it back to Sam for inclusion in
future SDL version (though probably not 1.2.3, I can imagine it would
break backward compatibility with some apps...)
Max
--
-----------------------------------------------
Max Horn
Software Developer
email: <mailto:max at quendi.de>
phone: (+49) 6151-494890
More information about the sdlsound
mailing list