BananaHemic/Mumble-Unity

Crackle when sound starts, using amplitude voice sending

Closed this issue · 6 comments

In the MumbleMicrophone component I am using VoiceSendingType = Amplitude, with a value of 0.03 to send voice. I noticed, when receiving a new voice, there is a crackle in the beginning. This is only happening in Unity, I didn't get a crackle when listening directly in a mumble client with another user.

I could reproduce it in your example scene while sending the synthetic audio source, with the amplitude setting. It is just the first bit of sound that crackles, if you keep talking after that it sounds fine.

Any idea what could be causing this? Thanks!

Thanks again for making an issue!
I think this is fixed in the commit that I just pushed to per-speaker-codec. Let me know how it works!

Updated the changes, I seem to still be getting the same crackling artifacts at the beginning of talking. I tried the sample audio file in the example scene set to amplitude again, and it is still occurring. Every time a new voice line starts in the audio clip, you can hear the crackle sound. It sounds like something is corrupted in the first packet that is sent in a new voice clip.
If I am listening in a standalone mumble client, I don't hear the crackle at the start.

Ok, I think part of the problem was from how Unity was handling dropped samples, which should be fixed and pushed to per-speaker-codec. However, I'm not really sure why it's dropping frames so consistently, so I'll have to take a look at that.

Yea, looks like it is still happening after the latest pull. So is the problem that unity is dropping the first couple frames of data that it is getting from mumble?

I just pushed another change adding an internal buffer to the decoding. I think another part of the issue is that previously audio was being played back as soon as it arrived, so in the beginning there was a period where we would only partially fill the Unity audio filter data as we didn't have enough samples to completely fill it. This would cause some audio jitter until enough samples arrive to completely fill the unity audio buffer.

Awesome, looks like that did it! Thanks for all the help. I really appreciate how fast you were in responding with changes!