kopia lustrzana https://github.com/OpenRTX/OpenRTX
Update audio_codec.c
Make sure that the `decodeFunc()` only decodes Codec2 data if the encoded frame energy exceeds a certain threshold. This guarantees that no noise is decoded and played back at the speaker. After applying this modification, the decoded speech is much clearer, as there is no noise in between words or at idle (silence). The idle noise effect is especially emphasized when 12-bit ADCs are used at the transmitter side.codec2-noise-fix
rodzic
498aa309cd
commit
4f8ab3e318
|
@ -325,7 +325,14 @@ static void *decodeFunc(void *arg)
|
|||
|
||||
if(newData)
|
||||
{
|
||||
codec2_decode(codec2, audioBuf, ((uint8_t *) &frame));
|
||||
if(codec2_get_energy(codec2, ((uint8_t *) &frame)) > 120)
|
||||
{
|
||||
codec2_decode(codec2, audioBuf, ((uint8_t *) &frame));
|
||||
}
|
||||
else
|
||||
{
|
||||
memset((uint8_t*)audioBuf, 0, codec2_samples_per_frame(codec2)*sizeof(audioBuf[0]));
|
||||
}
|
||||
|
||||
#ifdef PLATFORM_MD3x0
|
||||
// Bump up volume a little bit, as on MD3x0 is quite low
|
||||
|
|
Ładowanie…
Reference in New Issue