diff --git a/core/chanora_core/src/lib.rs b/core/chanora_core/src/lib.rs index ee742aa..670517d 100644 --- a/core/chanora_core/src/lib.rs +++ b/core/chanora_core/src/lib.rs @@ -891,15 +891,18 @@ impl ChanoraSession { if let Some(projection) = projection { self.emit_voice_state(projection).await; } - if let Err(audio_err) = self.ensure_audio_running().await { - warn!( - target: "chanora_core", - error = %audio_err, - "auto-join default channel: server placed us in a channel but audio engine \ - failed to start; continuing with no-audio in-channel state" - ); - let _ = self.events_tx.send(SessionEvent::AudioStopped); - } + let session = self.clone(); + tokio::spawn(async move { + if let Err(audio_err) = session.ensure_audio_running().await { + warn!( + target: "chanora_core", + error = %audio_err, + "auto-join default channel: server placed us in a channel but audio engine \ + failed to start; continuing with no-audio in-channel state" + ); + let _ = session.events_tx.send(SessionEvent::AudioStopped); + } + }); } Ok(snap) @@ -1388,11 +1391,12 @@ impl ChanoraSession { Some(audio.audio_processing_stats()) } - /// Configure the preferred Silero ONNX VAD model path. + /// Configure the preferred Silero ONNX VAD model path on platforms + /// that ship the ONNX detector. /// - /// This does not require an active connection. Running iOS audio - /// backends observe the model-path epoch and reload on the next - /// capture frame when Silero is selected. + /// This does not require an active connection. Running non-iOS + /// audio backends can observe the model-path epoch and reload on + /// the next capture frame when Silero is selected. pub async fn set_vad_model_path(&self, path: String) -> Result<(), CoreError> { chanora_audio::vad::set_silero_model_path(&path)?; Ok(()) @@ -1404,8 +1408,10 @@ impl ChanoraSession { let guard = self.inner.lock().await; if let Some(state) = guard.as_ref() { if let Some(audio) = state.audio.as_ref() { - let mut config = audio.audio_processing_config_snapshot(); - config.route = route; + let config = chanora_audio::route_policy::apply_route_change( + &audio.audio_processing_config_snapshot(), + route, + ); audio.set_audio_processing_config(config)?; #[cfg(any(target_os = "ios", target_os = "macos"))] {