use std::sync::mpsc;
pub use crate::{AudioData, AudioDevice, RecordingMode};
pub trait AudioBackend: Send + Sync {
fn sample_rate(&self) -> u32;
fn list_input_devices(&self) -> Vec<AudioDevice>;
fn list_system_devices(&self) -> Vec<AudioDevice>;
fn get_default_system_device(&self) -> Option<AudioDevice> {
self.list_system_devices().into_iter().next()
}
fn start_capture_sources(
&self,
source1_id: Option<String>,
source2_id: Option<String>,
) -> Result<(), String>;
fn stop_capture(&self) -> Result<(), String>;
fn try_recv(&self) -> Option<AudioData>;
fn set_aec_enabled(&self, enabled: bool);
fn set_recording_mode(&self, mode: RecordingMode);
fn set_gain(&self, _db: f32) {}
fn supports_render_output(&self) -> bool {
false
}
fn start_render(&self) -> Result<mpsc::SyncSender<Vec<f32>>, String> {
Err("Audio render output is not supported on this platform".to_string())
}
fn stop_render(&self) -> Result<(), String> {
Ok(())
}
}