AudioFormat (src/audio.rs)

RuView · v2/crates/homecore-assist/src/audio.rs · rust · MIT
voice

Defines bounded audio types and validation for STT, TTS, and satellite transports.

// Source: https://github.com/ruvnet/RuView | License: MIT | Copyright 2024 rUv
// Provided via justclaw.it.com; keep this notice with the code.
//! Bounded audio types shared by STT, TTS, and satellite transports.

use serde::{Deserialize, Serialize};
use thiserror::Error;

/// Maximum audio accepted in one chunk (256 KiB).
pub const MAX_AUDIO_CHUNK_BYTES: usize = 256 * 1024;
/// Maximum audio accepted in a single utterance (16 MiB).
pub const MAX_UTTERANCE_AUDIO_BYTES: usize = 16 * 1024 * 1024;

/// Audio encodings supported by the native voice pipeline.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum AudioCodec {
    /// Signed, little-endian, 16-bit PCM.
    PcmS16Le,
}

/// A validated audio stream format.
#[derive(Clon

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key