We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 2517

Summary: SDL2_mixer appears to not properly handle wav with frequency not matching MIX_OpenAudio argument
Product: SDL_mixer Reporter: pcpa <paulo.cesar.pereira.de.andrade>
Component: miscAssignee: Ryan C. Gordon <icculus>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: fran, i.gnatenko.brain
Version: 2.0.0   
Hardware: x86_64   
OS: Linux   

Description pcpa 2014-05-01 03:31:12 UTC
$ rpm -q SDL2_mixer
SDL2_mixer-2.0.0-3.fc21.x86_64

I am making bindings to SDL2 and OpenGL to a language, and
to "validate" it, translating NeHe tutorials.
The sound in lesson 32 shows the problem.
http://nehe.gamedev.net/tutorial/picking_alpha_blending_alpha_testing_sorting/16005/

The problem does not happen with SDL_mixer 1.2, example:

$ file nehe/lesson32/Shot.wav
nehe/lesson32/Shot.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 8 bit, mono 22000 Hz

<<< works correctly >>>
$ playwave nehe/lesson32/Shot.wav 
Opened audio at 22050 Hz 16 bit stereo

<< plays only noise >>>
$ playwave2 nehe/lesson32/Shot.wav 
Opened audio at 22050 Hz 16 bit stereo

But I managed to get it to play correctly with SDL2 by passing
22000 instead of (MIX_DEFAULT_FREQUENCY) 22050 as first argument
to MIX_OpenAudio.
Comment 1 Francisco de la Peña 2014-09-23 16:45:55 UTC
I guess this is a duplicate of bug #2389
Try with latest SDL Hg or wait until the SDL 2.0.4 release.
Comment 2 Sam Lantinga 2017-10-21 19:35:44 UTC
Yes, this is fixed for the next release, thanks!