feat(voice): add iOS VAD runtime support

This commit is contained in:
Edison Jwa
2026-05-21 20:51:45 +09:00
parent 171baf6e41
commit 6af4ecab0f
73 changed files with 11529 additions and 1249 deletions
@@ -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);