I have a WAV file encoded with PCM at 44.1 kHz / 16 bit / stereo. I use the following (very basic) code to play it :
FMOD_System_Init(sys, 2, FMOD_INIT_NORMAL, NULL);
FMOD_System_CreateSound(sys, "test.wav", FMOD_DEFAULT, NULL, &sound);
FMOD_System_PlaySound(sys, FMOD_CHANNEL_FREE, sound, 0, NULL);[/code:edk7la9d]
Then I record the played sound with the playback interface of my sound card. At Windows level, input and output interfaces are configured with 44.1 kHz / 16 bit / stereo settings, so there is no resampling and no remixing.
Now when I compare the input signal with the recorded output signal, it’s like it has been filtered (there are more high frequencies). Here are before/after screenshots :
Note that when I play the WAV file with VLC or WMP, there is no difference between original WAV spectrum and output spectrum.
What am i missing ? Is there any DSP applied in the default configuration of FMOD Ex ? Any other suggestions ?
- CharlesB asked 5 years ago
The cutoff frequency is at 16 kHz, which is quite low. All the MP3 decoders I tried seem to have perfect output (they are bitstream compliant). Maybe they have sometimes a rounding tolerance when decoding signal mathematically, but I have never seen such a deterioration of the quality. I guess it’s due to some memory or CPU optimization peculiar to FMOD. Is there any way to disable this optimizations ?
If you want to use 44khz output you have to tell fmod about it. Otherwise it will default to 48khz, then use a linear resampler. Use a higher quality resampler like the cubic or spline resampler, or use setSoftwareFormat to set it to 44khz output. You can query the driver caps in fmod to work out what the windows settings are set to.
Setting the software format to 44,1 kHz solved the issue. However I have another problem (independent from the previous one) related to MP3 output quality.
If I compare the output signal of :
– a MP3 file (44,1 kHz / 320 kbps)
– a WAV file, converted [u:2rsif287]from[/u:2rsif287] the MP3,
Then it seems that high frequencies are cut off in the MP3 output, while the WAV output is perfect. Here is a screenshot :
I want to say that I know that MP3 compression is lossy and cut off high frequencies, but this is not the point. My MP3 has a very high bitrate, and when I play it through another player (like WMP or VLC) the output spectrum is perfectly equal to the WAV one. That’s why I created a WAV file from the MP3 (the WAV file is [u:2rsif287]not[/u:2rsif287] the lossless version of the recording).
Is there something I should know about the MP3 decoder used in FMOD ? I did some tests with OGG Q9 and I hadn’t this kind of problem.
Note that my results are same for Windows and OS X environements.
Please login first to submit.