#[cfg(not(target_os = "macos"))]
use anyhow::anyhow;
use anyhow::Result;
use crate::audio::capture::CaptureHandle;
#[cfg(target_os = "macos")]
pub mod loopback_macos;
#[cfg(target_os = "windows")]
pub mod loopback_windows;
pub fn capture_loopback(name: Option<&str>) -> Result<CaptureHandle> {
#[cfg(target_os = "macos")]
{
loopback_macos::capture(name)
}
#[cfg(not(target_os = "macos"))]
{
let _ = name;
Err(anyhow!("loopback capture not yet wired on this platform"))
}
}
pub fn capture_app(identifier: &str) -> Result<CaptureHandle> {
#[cfg(target_os = "macos")]
{
loopback_macos::capture_app(identifier)
}
#[cfg(target_os = "windows")]
{
loopback_windows::capture_app(identifier)
}
#[cfg(not(any(target_os = "macos", target_os = "windows")))]
{
let _ = identifier;
Err(anyhow!("per-app capture not yet wired on this platform"))
}
}