feat(voice): add iOS VAD runtime support
This commit is contained in:
@@ -15,15 +15,24 @@
|
||||
// builds and other benches are unaffected per Cargo's per-bench
|
||||
// compilation model.
|
||||
|
||||
#[cfg(any(target_os = "ios", target_os = "macos", target_os = "android"))]
|
||||
fn main() {}
|
||||
|
||||
#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "android")))]
|
||||
#[global_allocator]
|
||||
static ALLOC: dhat::Alloc = dhat::Alloc;
|
||||
|
||||
#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "android")))]
|
||||
use chanora_audio::bench_seam::CaptureBenchHandle;
|
||||
#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "android")))]
|
||||
use criterion::{black_box, criterion_group, criterion_main, Criterion};
|
||||
|
||||
#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "android")))]
|
||||
mod common;
|
||||
#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "android")))]
|
||||
use common::{synthetic_capture_buffer, FRAME_SAMPLES};
|
||||
|
||||
#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "android")))]
|
||||
fn bench_capture_alloc_count(c: &mut Criterion) {
|
||||
// Build the dhat profiler in test mode so it is process-local
|
||||
// and does not write a JSON heap-dump file. Held for the
|
||||
@@ -90,6 +99,7 @@ fn bench_capture_alloc_count(c: &mut Criterion) {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "android")))]
|
||||
fn bench_capture_callback_wall_clock(c: &mut Criterion) {
|
||||
let mut handle = CaptureBenchHandle::new(48_000, 1);
|
||||
let buf = synthetic_capture_buffer(FRAME_SAMPLES, 1);
|
||||
@@ -108,9 +118,11 @@ fn bench_capture_callback_wall_clock(c: &mut Criterion) {
|
||||
});
|
||||
}
|
||||
|
||||
#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "android")))]
|
||||
criterion_group!(
|
||||
realtime_capture,
|
||||
bench_capture_alloc_count,
|
||||
bench_capture_callback_wall_clock
|
||||
);
|
||||
#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "android")))]
|
||||
criterion_main!(realtime_capture);
|
||||
|
||||
Reference in New Issue
Block a user