| Summary: | Resampling music produces garbage | ||
|---|---|---|---|
| Product: | SDL_mixer | Reporter: | Lauri Kenttä <lauri.kentta> |
| Component: | misc | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | major | ||
| Priority: | P2 | CC: | fran, jpakkane, philipp.wiesemann |
| Version: | unspecified | ||
| Hardware: | x86_64 | ||
| OS: | All | ||
| Attachments: |
Test program, plays first Mix_Chunk and then Mix_Music.
RIFF (little-endian) data, WAVE audio, Microsoft PCM, 8 bit, mono 16000 Hz RIFF (little-endian) data, WAVE audio, Microsoft PCM, 8 bit, mono 16000 Hz RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, mono 43000 Hz |
||
|
Description
Lauri Kenttä
2013-09-07 17:15:07 UTC
Created attachment 1849 [details]
RIFF (little-endian) data, WAVE audio, Microsoft PCM, 8 bit, mono 16000 Hz
Tests with attached file:
playmus -r 22050 0000_226.wav # plays garbage
playwave -r 22050 0000_226.wav # plays OK
playmus -r 44100 0000_226.wav # plays garbage
playwave -r 44100 0000_226.wav # plays garbage
Created attachment 1850 [details]
RIFF (little-endian) data, WAVE audio, Microsoft PCM, 8 bit, mono 16000 Hz
Tests with attached file:
playmus -r 22050 0000_227.wav # plays garbage
playwave -r 22050 0000_227.wav # plays garbage
playmus -r 44100 0000_227.wav # plays garbage
playwave -r 44100 0000_227.wav # plays OK
(In reply to Lauri Kenttä from comment #0) > If the audio device is opened at 48000 Hz and a music file is at 44100 Hz, > the resampler produces garbage (unrecognizable noise). This only happens > with Mix_Music. If the same file is opened as Mix_Chunk, it works fine. > Apparently this is not bug #58 anymore but something new instead. According with tests it fails with Mix_PlayWAV too under different wave files. I guess is related with #58 and might be about buffer size issues. Looks like this issue got resolved at #2389. Works for me in SDL Hg. Created attachment 1876 [details] RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, mono 43000 Hz Though the bug #2389 fixes all playwave (Mix_Channel) tests it still plays alternated garbage between buffer chunks with playmus (Mix_PlayMusic), most noticeable when mixer playback frequency is lower: playmus -r 11025 0000_227-43000Hz.wav # plays garbage between buffer chunks playmus -r 22050 0000_227-43000Hz.wav # plays garbage between buffer chunks playmus -r 44100 0000_227-43000Hz.wav # plays garbage between buffer chunks playmus -r 48000 0000_227-43000Hz.wav # plays garbage between buffer chunks playmus -r 96000 0000_227-43000Hz.wav # plays garbage between buffer chunks This seems to be a bit more complicated than the comments here indicate. I'm trying to play a 48 kHz ogg file (Mix_LoadMUS) and a wav effect file (Mix_LoadWAV). This seems to be broken in several different ways. Tested on Ubuntu 64 bit, OSX Yosemite and Windows XP (under VirtualBox). If the selected output rate of Mix_OpenAudio is not exactly 48k (for example 44.1) then the music plays back as noise on every platform. If the wav effect file is 44.1, then both Linux and OSX play it just fine. However on Windows, it produces just static noise. Using a 48k wav file works on all platforms. This is fixed in the latest code in SDL and SDL_mixer Mercurial: http://hg.libsdl.org/ Thanks! |