# Voice chat sounds crackling

**URL:** <https://qa.fmod.com/t/voice-chat-sounds-crackling/23265>\
**Category:** FMOD Engine\
**Tags:** cpp\
**Created:** [August 24, 2025, 9:10pm UTC](https://qa.fmod.com/t/voice-chat-sounds-crackling/23265 "2025-08-24T21:10:56Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![fwflunky](https://avatars.discourse-cdn.com/v4/letter/f/35a633/32.png) [@fwflunky](https://qa.fmod.com/u/fwflunky)\
**Post date:** [August 24, 2025, 9:10pm UTC](https://qa.fmod.com/t/voice-chat-sounds-crackling/23265/1 "2025-08-24T21:10:56Z")

</div>

I made a voice chat mod for some game, and recently my users have noticed cracklng in others voice when count of speaking players \> 1, no matter how sound loud or far away, crackling always there if more than one player speaking at the same time in hear zone. I tried to use limiter dsp on voice channel group - no effect, tried to decrease volume of sound / channel group - still no effect. For example, if there are two players speaking and **i set volume of first player voice to 0** (muted him), **the sound i hear becomes normal without crackling until i restore first player’s voice sound volume**

im using opus to encode and decode data from microphone, and `FMOD_OPENUSER | FMOD_CREATESTREAM | FMOD_3D `with `pcmreadcallback`to push audio stream:

`exinfo.pcmreadcallback = (FMOD\_SOUND\* sound, void data, unsigned int datalen){  
void\* userdata = nullptr;  
((FMOD::Sound\*)sound)-\>getUserData(&userdata);  
if(!userdata){  
return FMOD\_OK;  
}

```auto
auto v = (Storage::PlayerVoice*)userdata;

std::lock_guard<std::mutex> lock(v->bufferMutex);

unsigned int totalCopied = 0;
auto dest = (unsigned char*) data;

while (totalCopied < datalen) {
    if (v->buffer.empty()) {
        memset(dest + totalCopied, 0, datalen - totalCopied);
        break;
    }

    auto& front = v->buffer.front();
    size_t toCopy = front.size() - v->readOffset;
    size_t needed = datalen - totalCopied;

    size_t chunk = std::min(toCopy, needed);
    memcpy(dest + totalCopied, front.data() + v->readOffset, chunk);

    totalCopied += chunk;
    v->readOffset += chunk;

    if (v->readOffset >= front.size()) {
        v->buffer.pop_front();
        v->readOffset = 0;
    }
}

return FMOD_OK;

```

};`

settings:  
`FMOD_CREATESOUNDEXINFO exinfo = {};`  
` exinfo.cbsize = sizeof(FMOD_CREATESOUNDEXINFO);`  
` exinfo.numchannels = 1;`  
` exinfo.format = FMOD_SOUND_FORMAT_PCM16;`  
` exinfo.defaultfrequency = 48000;`  
` exinfo.length = 0xFFFFFFFF;|`  
` exinfo.decodebuffersize = 9600;`

buffer has 960 frames and 48000 sample rate before encoding with opus, opus params:  
`opus_encoder_ctl(module->encoder, OPUS_SET_BITRATE(32000)); `  
`opus_encoder_ctl(module->encoder, OPUS_SET_SIGNAL(OPUS_SIGNAL_VOICE)); `  
`opus_encoder_ctl(module->encoder, OPUS_SET_APPLICATION(OPUS_APPLICATION_VOIP));`  
` opus_encoder_ctl(module->encoder, OPUS_SET_INBAND_FEC(1));`  
` opus_encoder_ctl(module->encoder, OPUS_SET_PACKET_LOSS_PERC(10));`  
` opus_encoder_ctl(module->encoder, OPUS_SET_COMPLEXITY(6));`  
` opus_encoder_ctl(module->encoder, OPUS_SET_DTX(1));`

some additional code:

void \_\_forceinline SoundSystem::initializeVoicePlayerBuffer(Storage::PlayerVoice\* player) const {  
if (!player-\>isSoundInitialized) {  
storage-\>system-\>playSound(player-\>sound, storage-\>voiceChannel, true, &player-\>channel);  
player-\>channel-\>set3DAttributes(&player-\>position, nullptr);  
player-\>channel-\>set3DSpread(90.f);  
player-\>channel-\>set3DMinMaxDistance(3.f, 300.f);  
player-\>channel-\>setVolume(player-\>isMuted ? 0.f : calculateVolumeBasedOnDistance(player-\>position, storage-\>currentPos, 3.f, 30.f));  
player-\>isSoundInitialized = true;  
}  
}

first video (just sound): the problem (two players talking) [https://drive.google.com/file/d/1Jx0p-4Vl7x5tf\_Cfe84e\_zDNSjAikI\_I/view?usp=sharing](https://drive.google.com/file/d/1Jx0p-4Vl7x5tf_Cfe84e_zDNSjAikI_I/view?usp=sharing)  
second video (just sound too): when first player is muted and second player still talking [https://drive.google.com/file/d/1EJJuq2rE\_Hf12sTJpCZJ7J5CskiCO7n6/view?usp=sharing](https://drive.google.com/file/d/1EJJuq2rE_Hf12sTJpCZJ7J5CskiCO7n6/view?usp=sharing)

---

<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:** [August 28, 2025, 1:02am UTC](https://qa.fmod.com/t/voice-chat-sounds-crackling/23265/2 "2025-08-28T01:02:11Z")

</div>

Hi,

Thank you for the code.

What version of FMOD are you using?

I will link this forum which has discussed solutions for VOIP issues: [Vivox to Unity OnAudioFilterRead to FMOD programmer sound. Stutters/crackling - #15 by dougmolina](https://qa.fmod.com/t/vivox-to-unity-onaudiofilterread-to-fmod-programmer-sound-stutters-crackling/21235/15)

Sounds like an issue related to the buffer size, an option may be increasing buffer: [FMOD Engine | Core Api System - System::Setdspbuffersize](https://fmod.com/docs/2.03/api/core-api-system.html#system_setdspbuffersize).

Hope this helps!

---

<div class="post-metadata">

**Author:** ![fwflunky](https://avatars.discourse-cdn.com/v4/letter/f/35a633/32.png) [@fwflunky](https://qa.fmod.com/u/fwflunky)\
**Post date:** [August 28, 2025, 1:31pm UTC](https://qa.fmod.com/t/voice-chat-sounds-crackling/23265/3 "2025-08-28T13:31:55Z")

</div>

Hello, I’m using version 2.03.08 build number 153137, I tried to increase buffer count and size using  
`storage->system->setDSPBufferSize(9600, 12);`  
but it had no effect, unfortunately  
I don’t really understand what can cause this problem and what I should do  
I don’t know how FMOD works internally, but I think that if I set the volume to 0, the sound internally continues to be processed as if nothing had happened. Accordingly, I think that the problem is not in logic of my code, because if I mute the second player’s voice, the first player’s voice becomes normal and without crackling. Maybe I need to normalize sounds or something like that? It can’t be that the crackling is caused by performance issues, right? After all, there is no lag in the game at that moment, System::update() is called from the game thread

crackling exists even if I’m using ring buffer instead of current implementation

---

<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:** [September 1, 2025, 12:28am UTC](https://qa.fmod.com/t/voice-chat-sounds-crackling/23265/4 "2025-09-01T00:28:35Z")

</div>

Thanks for confirming that.

With the logging libs are you able to call [FMOD Engine | Core Api Common - Debug::Initialize](https://fmod.com/docs/2.03/api/core-api-common.html#debug_initialize) and share any logs please.

Just to confirm, are you exclusively working in the Core API?

An alternative method for playing mic input is using our [FMOD Engine | Core Api System - System::Recordstart](https://fmod.com/docs/2.03/api/core-api-system.html#system_recordstart) API and passing that directly to a sound. That example is included in our engine install: `"C:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\core\examples\record.cpp"`

Is it possible to share the code so I can test it on my end or possible to recreate the issue in a small project that can be uploaded to your [profile](https://fmod.com/profile#uploads)?

> [@fwflunky](#):
>
> Maybe I need to normalize sounds or something like that? It can’t be that the crackling is caused by performance issues, right?

I am not sure at the moment.

---

<div class="post-metadata">

**Author:** ![fwflunky](https://avatars.discourse-cdn.com/v4/letter/f/35a633/32.png) [@fwflunky](https://qa.fmod.com/u/fwflunky)\
**Post date:** [September 9, 2025, 10:28pm UTC](https://qa.fmod.com/t/voice-chat-sounds-crackling/23265/5 "2025-09-09T22:28:44Z")

</div>

nevermind. the problem was in opus decoder, it was necessary to create an decoder instance for each player instead of just one

---

<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:** [September 9, 2025, 10:46pm UTC](https://qa.fmod.com/t/voice-chat-sounds-crackling/23265/6 "2025-09-09T22:46:31Z")

</div>

Thank you for sharing the solution!
