vircadia / vircadia-native-core

Vircadia open source agent-based metaverse ecosystem.
https://vircadia.com/
Other
531 stars 175 forks source link

Double the number of silent samples may be written per SilentAudioFrame packet received. #1708

Open ctrlaltdavid opened 2 years ago

ctrlaltdavid commented 2 years ago

The value being passed into InboundAudioStream::writeDroppableSilentFrames(int silentFrames) is the number of silent samples (480 for stereo), not the number of silent frames (240 for stereo). The code then doubles this number for stereo to calculate the number of silent samples.

The result is that too much silence is added. However, because silence is only added if the jitter buffer is less than its desirable size, typically the extra silence will be discarded (dropped) and not written.

A benign bug but confusing code.

stale[bot] commented 1 year ago

Hello! Is this still an issue?