Add some Trait doc comments
Build Mumble Web 2 / windows_build (push) Successful in 2m25s
Build Mumble Web 2 / linux_build (push) Successful in 1m18s
Build Mumble Web 2 / android_build (push) Successful in 5m47s

Added comments to Audio(System|Player)Interface traits.
This commit is contained in:
2026-01-25 11:08:21 -07:00
parent 8170383278
commit 5f3466546e
3 changed files with 13 additions and 7 deletions
-4
View File
@@ -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;
+1 -1
View File
@@ -45,7 +45,7 @@ impl super::PlatformInterface for MobilePlatform {
}
async fn get_status(client: &reqwest::Client) -> color_eyre::Result<ServerStatus> {
get_status(client).await
super::connect::get_status(client).await
}
fn init_logging() {
+12 -2
View File
@@ -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<Self, Error>;
/// 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<Self::AudioPlayer, Error>;
}
/// 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]);
}