pocketstation 1.0.0

Source-aware desktop audio Session SDK
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/// 48 000 Hz, mono, VOIP application profile (AUDIO-012 default).
pub const OPUS_SAMPLE_RATE_HZ: u32 = 48_000;

/// 20 ms frame = 960 samples at 48 kHz (AUDIO-012).
pub const OPUS_FRAME_SAMPLES: usize = 960;

/// 10 ms frame = 480 samples at 48 kHz (voice-agent low-latency mode, RFC 6716 §3.1).
/// Ten milliseconds of mono PCM at 48 kHz.
pub const VOICE_AGENT_FRAME_SAMPLES: usize = 480;

/// Maximum number of bytes the Opus encoder can emit per 20 ms frame.
/// libopus guarantees this upper bound.
pub const OPUS_MAX_PACKET_BYTES: usize = 4_000;

/// Scale factor for f32 ↔ i16 conversion.
pub(crate) const I16_SCALE: f32 = i16::MAX as f32;