diff --git a/gui/src/imp/desktop.rs b/gui/src/imp/desktop.rs index a8553a3..34a59f8 100644 --- a/gui/src/imp/desktop.rs +++ b/gui/src/imp/desktop.rs @@ -6,10 +6,6 @@ use mumble_web2_common::{ClientConfig, ServerStatus}; use std::collections::HashMap; use std::time::Duration; -// ============================================================================ -// Platform Struct -// ============================================================================ - /// Desktop platform implementation using Tokio and native audio. pub struct DesktopPlatform; diff --git a/gui/src/imp/mobile.rs b/gui/src/imp/mobile.rs index cbdf085..cac7b86 100644 --- a/gui/src/imp/mobile.rs +++ b/gui/src/imp/mobile.rs @@ -45,7 +45,7 @@ impl super::PlatformInterface for MobilePlatform { } async fn get_status(client: &reqwest::Client) -> color_eyre::Result { - get_status(client).await + super::connect::get_status(client).await } fn init_logging() { diff --git a/gui/src/imp/mod.rs b/gui/src/imp/mod.rs index 9952d85..a657d31 100644 --- a/gui/src/imp/mod.rs +++ b/gui/src/imp/mod.rs @@ -15,10 +15,15 @@ use std::time::Duration; // Trait Definitions // ============================================================================ +/// Platform-specific audio subsystem for capturing microphone input and creating playback streams. +/// +/// The audio system handles Opus encoding internally - callers receive encoded frames +/// ready for network transmission. pub trait AudioSystemInterface: Sized { + /// The player type returned by [`create_player`](Self::create_player). type AudioPlayer: AudioPlayerInterface; - /// Initialize the audio system, including relevant state + /// Initialize the audio system. async fn new() -> Result; /// Set the processor for the microphone input, mainly noise cancellation settings. @@ -35,8 +40,13 @@ pub trait AudioSystemInterface: Sized { fn create_player(&mut self) -> Result; } +/// A handle to an active audio playback stream for a single remote user. +/// +/// Each connected user gets their own `AudioPlayer` instance, which decodes +/// incoming Opus frames and outputs PCM audio to the platform's audio device. +/// The player manages its own decoder state and output buffer. pub trait AudioPlayerInterface { - /// Playback an opus frame. + /// Decode and play an Opus-encoded audio frame. fn play_opus(&mut self, payload: &[u8]); }