Skip to content

Commit

Permalink
do FEC properly in opus codec
Browse files Browse the repository at this point in the history
  • Loading branch information
haileys committed Dec 27, 2023
1 parent 4ccd209 commit 90fb076
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bark-core/src/decode/opus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
};
Expand Down
1 change: 1 addition & 0 deletions bark-core/src/encode/opus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ impl OpusEncoder {
)?;

opus.set_inband_fec(true)?;
opus.set_packet_loss_perc(50)?;

Ok(OpusEncoder { opus })
}
Expand Down

0 comments on commit 90fb076

Please sign in to comment.