feat(voice): harden Android audio and channel joins
This commit is contained in:
@@ -12,8 +12,8 @@
|
||||
use audiopus::coder::{Decoder, Encoder};
|
||||
use audiopus::packet::Packet;
|
||||
use audiopus::{Application, Channels, MutSignals, SampleRate};
|
||||
use std::convert::TryFrom;
|
||||
use criterion::{black_box, criterion_group, criterion_main, Criterion};
|
||||
use std::convert::TryFrom;
|
||||
|
||||
mod common;
|
||||
use common::{synthetic_opus_bytes, synthetic_opus_frame};
|
||||
@@ -43,11 +43,17 @@ fn bench_opus_decode_latency(c: &mut Criterion) {
|
||||
b.iter(|| {
|
||||
let input = Packet::try_from(black_box(&bytes[..])).expect("packet");
|
||||
let output = MutSignals::try_from(&mut pcm_out[..]).expect("signals");
|
||||
let n = dec.decode_float(Some(input), output, false).expect("decode");
|
||||
let n = dec
|
||||
.decode_float(Some(input), output, false)
|
||||
.expect("decode");
|
||||
black_box(n);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
criterion_group!(opus_codec, bench_opus_encode_latency, bench_opus_decode_latency);
|
||||
criterion_group!(
|
||||
opus_codec,
|
||||
bench_opus_encode_latency,
|
||||
bench_opus_decode_latency
|
||||
);
|
||||
criterion_main!(opus_codec);
|
||||
|
||||
Reference in New Issue
Block a user