libsdl-org / SDL_mixer

An audio mixer that supports various file formats for Simple Directmedia Layer.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

volume noticeably lower while playback

chinshou opened this issue · comments

I have an wav file with a slightly low volume. I found that when playing it using SDL2, the volume is correct. However, when playing it using SDL_mixer, the sound is noticeably lower in volume. I then found another wav file with a original high volume, and this time when playing it with the mixer, the volume was the same as with SDL. I suspect that SDL_mixer's resampling might have an issue when dealing with low volume sounds. If needed, I can provide a download URL for the low volume WAV files.

Note: I only use sdl_mixer play one wave without mixing with other wav. So I can exclude the other wav's problem.

Can you include the WAV files you're testing with and a minimal test program or repro steps with playwave?

Can you include the WAV files you're testing with and a minimal test program or repro steps with playwave?

I guess I have know reason of the low volume problem. In the sdl_mixer 1.2 there is no such problem.
Now unless the music effect or the post effect, the mixer does not allow user directly overwrite the original stream. it always mix the original stream with modified stream. In my case , I playback a chunk of raw wave that is inited with 0. when I use Mix_RegisterEffect to register a callback that will write the audio buffer with real data, but because the original stream is always 0, after mix the audio volume will be reduced and when the original stream volume is low, it is noticeable by the end user.

I will hook the music effect to directly overwrite the original stream with real data. Because it is not a bug ,but a difference of between SDL 1.2 and 2.x , so I will close the issue.