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

**URL:** https://qa.fmod.com/t/in-game-audio-playback-shows-quality-loss-compared-to-the-source-file/20954
**Category:** FMOD Engine
**Tags:** cpp
**Created:** [December 5, 2023, 8:58am UTC](https://qa.fmod.com/t/in-game-audio-playback-shows-quality-loss-compared-to-the-source-file/20954 "2023-12-05T08:58:35Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![taotluo](https://avatars.discourse-cdn.com/v4/letter/t/5f9b8f/32.png) [@taotluo](https://qa.fmod.com/u/taotluo)
#### Post date: [December 5, 2023, 8:58am UTC](https://qa.fmod.com/t/in-game-audio-playback-shows-quality-loss-compared-to-the-source-file/20954/1 "2023-12-05T08:58:35Z")

</div>

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.

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/3/3390af3ca1779c5e6f57c8b322c00041f11961e9.jpeg)

```auto
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);
    }

```

---

<div class="post-metadata">

### Author: ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)
#### Post date: [December 8, 2023, 3:29am UTC](https://qa.fmod.com/t/in-game-audio-playback-shows-quality-loss-compared-to-the-source-file/20954/2 "2023-12-08T03:29:44Z")

</div>

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](https://fmod.com/docs/2.02/api/core-api-system.html#system_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?

---

<div class="post-metadata">

### Author: ![taotluo](https://avatars.discourse-cdn.com/v4/letter/t/5f9b8f/32.png) [@taotluo](https://qa.fmod.com/u/taotluo)
#### Post date: [December 8, 2023, 5:53am UTC](https://qa.fmod.com/t/in-game-audio-playback-shows-quality-loss-compared-to-the-source-file/20954/3 "2023-12-08T05:53:27Z")

</div>

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](https://fmod.com/docs/2.02/api/core-api-system.html#system_getsoftwareformat) Return 44100, consistent with the sampling rate of the MP3 file

---

<div class="post-metadata">

### Author: ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)
#### Post date: [December 12, 2023, 1:42am UTC](https://qa.fmod.com/t/in-game-audio-playback-shows-quality-loss-compared-to-the-source-file/20954/4 "2023-12-12T01:42:00Z")

</div>

Hi,

Thank you for the information. Could you try a different output type using [System::setOutput()](https://fmod.com/docs/2.02/api/core-api-system.html#system_setoutput) for example [FMOD\_OUTPUTTYPE\_OPENSL](https://fmod.com/docs/2.02/api/core-api-system.html#fmod_outputtype:~:text=FMOD_OUTPUTTYPE_OPENSL) or [FMOD\_OUTPUTTYPE\_AUDIOTRACK](https://fmod.com/docs/2.02/api/core-api-system.html#fmod_outputtype:~:text=FMOD_OUTPUTTYPE_AUDIOTRACK) and let me know if they sound better.
