In-game audio playback shows quality loss compared to the source file

In-game audio playback shows quality loss compared to the source file. It occurs mainly in the 5-15K frequencies. I’ve tried switching resampling as well as using different formats of audio files (MP3 and WAV), but the problem persists.

std::string path = getFullPathFileName(filename.c_str());
    CC_LOG_DEBUG("playMusic: start createStream");
    FMOD_MODE mode = isloop ? FMOD_LOOP_NORMAL : FMOD_DEFAULT;
    FMOD_RESULT result = system->createStream(path.c_str(), mode, 0, &_music);
    if (result != FMOD_OK) {
        _music = nullptr;
        if (_music_channel != nullptr) {
            _music_channel->stop();
            _music_channel = nullptr;
        }
        CC_LOG_DEBUG("playMusic: FMOD error! createStream (%d)", result);
        return;
    }
    CC_LOG_DEBUG("playMusic: end createStream");
    result = system->playSound(_music, _musicGroup, false, &_music_channel);
    if (result != FMOD_OK) {
        if (_music != nullptr) {
            _music->release();
            _music = nullptr;
        }
        _music_channel = nullptr;
        CC_LOG_DEBUG("playMusic: FMOD error! playSound(%d)", result);
        return;
    }
    if (_music_channel != nullptr) {
        _music_channel->setVolume(_music_volume);
        CC_LOG_WARNING("playMusic: setVolume = %f", _music_volume);
        _music_channel->setPriority(0);
        _music_channel->addDSP(0, _music_dsp);
        setMusicEffect(_music_channel);
    }

Hi,

What version of FMOD are you using?

What platforms are you experiencing the quality loss? Could you please check the sample rate of the system you are using Syste::getSoftwareFormat as lower sample rates may result in reduced quality. How are you recording and/or observing the frequencies that you have posted in the images?

The version we are using is 2.02.17
Comparison of using FMod to play MP3 and direct mobile system playback on Android platform
Syste::getSoftwareFormat Return 44100, consistent with the sampling rate of the MP3 file

1 Like

Hi,

Thank you for the information. Could you try a different output type using System::setOutput() for example FMOD_OUTPUTTYPE_OPENSL or FMOD_OUTPUTTYPE_AUDIOTRACK and let me know if they sound better.