VoiceResponse (src/voice.rs)

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

A generic, asynchronous voice processing pipeline that orchestrates speech-to-text, intent recognition, and text-to-speech services.

// Source: https://github.com/ruvnet/RuView | License: MIT | Copyright 2024 rUv
// Provided via justclaw.it.com; keep this notice with the code.
//! End-to-end STT → intent → TTS pipeline.

use std::time::Duration;

use homecore::HomeCore;
use thiserror::Error;
use tokio::time::timeout;

use crate::audio::{AudioFormat, MAX_UTTERANCE_AUDIO_BYTES};
use crate::pipeline::AssistPipeline;
use crate::recognizer::IntentRecognizer;
use crate::speech::{
    validate_provider_audio, SpeechError, SpeechToText, SynthesizedSpeech, TextToSpeech, Transcript,
};
use crate::{AssistError, IntentResponse};

pub const DEFAULT_VOICE_TIMEOUT: Duration = Duration::from_secs(30);

#[derive(Clone, Debug)]
pub struct VoiceResponse {
    pub transcript: Transcript,
    pub intent: IntentResponse,
    pub speech: Synt

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

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

Get a free API key