feat(voice): add iOS VAD runtime support
This commit is contained in:
@@ -5,33 +5,23 @@
|
||||
//! [`chanora_storage::IdentityFileStore`] under the `transmit_mode`
|
||||
//! metadata key (default [`TransmitMode::Ptt`]).
|
||||
//!
|
||||
//! `VoiceActivity` is reserved per DEC-030 — for v1 the
|
||||
//! [`crate::transmit_selector::TransmitModeSelector`] treats it
|
||||
//! exactly like [`TransmitMode::Continuous`] until a real VAD
|
||||
//! implementation lands.
|
||||
//! `VoiceActivity` is driven by Rust-owned VAD state in P1.
|
||||
|
||||
/// User-visible voice transmit mode.
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
||||
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Hash)]
|
||||
#[repr(u8)]
|
||||
pub enum TransmitMode {
|
||||
/// Push-to-talk: transmit only while the bound key is held
|
||||
/// (with release-tail per SDD-096).
|
||||
#[default]
|
||||
Ptt = 0,
|
||||
/// Continuous: transmit whenever the user is in a voice
|
||||
/// channel and not hard-muted.
|
||||
Continuous = 1,
|
||||
/// Voice activity detection. Reserved per DEC-030; v1 behaves
|
||||
/// as [`TransmitMode::Continuous`] until a VAD implementation
|
||||
/// is allocated.
|
||||
/// Voice activity detection.
|
||||
VoiceActivity = 2,
|
||||
}
|
||||
|
||||
impl Default for TransmitMode {
|
||||
fn default() -> Self {
|
||||
Self::Ptt
|
||||
}
|
||||
}
|
||||
|
||||
impl TransmitMode {
|
||||
/// Encode as the persisted single-byte value.
|
||||
pub fn as_u8(self) -> u8 {
|
||||
|
||||
Reference in New Issue
Block a user