do FEC properly in opus codec

This commit is contained in:
Hailey Somerville 2023-12-27 16:30:46 +11:00
parent 4ccd209df7
commit 90fb076fff
2 changed files with 2 additions and 1 deletions

View file

@ -36,7 +36,7 @@ impl Decode for OpusDecoder {
log::debug!("opus decode: bytes={} -> frames={}", bytes.len(), length);
}
None => {
length = self.opus.decode_float(&[], out, false)?;
length = self.opus.decode_float(&[], out, true)?;
log::debug!("opus decode: correcting packet loss! frames={}", length);
}
};

View file

@ -17,6 +17,7 @@ impl OpusEncoder {
)?;
opus.set_inband_fec(true)?;
opus.set_packet_loss_perc(50)?;
Ok(OpusEncoder { opus })
}