feat(audio): prefer native voice backends

This commit is contained in:
Edison Jwa
2026-05-20 14:52:33 +09:00
parent 7d6d56e330
commit c87b47f064
6 changed files with 127 additions and 119 deletions
+5 -6
View File
@@ -5,12 +5,13 @@
//!
//! ## What's wired in this Beta
//!
//! * Default-input capture via `cpal` (DEC-011.1)
//! * Default-input capture via platform audio backends (Oboe on Android,
//! VoiceProcessingIO on Apple platforms, cpal/SDL elsewhere)
//! * Frame-aligned 20 ms / 48 kHz mono Opus encoding via `audiopus`
//! * Forward encoded frames to the protocol crate as `OutPacket`s
//! * Inbound voice packets fed to `tsclientlib::audio::AudioHandler`
//! which owns Opus decode + per-client jitter buffer + mix
//! * Mixed f32 PCM pulled by the cpal output callback at 48 kHz stereo
//! * Mixed f32 PCM pulled by the platform output callback at 48 kHz stereo
//! * Push-to-talk: capture stream is permanently open; encoding is
//! gated by an atomic `ptt_active` flag
//!
@@ -19,8 +20,6 @@
//! * AEC / AGC / NS / HPF DSP chain (DEC-007/008/009/010 — Beta+
//! work; the toggles in `AudioEffects` are honoured by *naming*
//! but the filters are no-ops)
//! * Mobile audio paths (DEC-011.1 desktop + Android proven; this
//! integration is desktop-only for v0.2.0-beta.1)
//! * Hot-plug device-change handling
//! * Sample-rate adaptation if the device cannot do 48 kHz / mono in
//! the format we request (returns `AudioError::StreamConfig`)
@@ -40,7 +39,7 @@ pub mod transmit_selector;
#[cfg(target_os = "linux")]
mod sdl_output;
#[cfg(target_os = "ios")]
#[cfg(any(target_os = "ios", target_os = "macos"))]
mod ios_voice_unit;
#[cfg(target_os = "android")]
@@ -52,7 +51,7 @@ pub use engine::{AudioEngine, AudioEngineConfig};
// bench harness under `crates/chanora_audio/benches/` can construct a
// CaptureState and drive `ingest` without re-implementing the engine.
// Not part of the supported public API.
#[cfg(not(any(target_os = "ios", target_os = "android")))]
#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "android")))]
#[doc(hidden)]
pub use engine::bench_seam;
pub use ptt::{AudioTransmitGate, MissedKeyUpWatchdog, PttBackendDescriptor, PttCapabilityLevel};