Dataclasses for speech-to-text metadata and results.
# Source: https://github.com/home-assistant/core | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
# Provided via justclaw.it.com; keep this notice with the code.
"""Speech-to-text data models."""
from dataclasses import dataclass
from .const import (
AudioBitRates,
AudioChannels,
AudioCodecs,
AudioFormats,
AudioSampleRates,
SpeechResultState,
)
@dataclass
class SpeechMetadata:
"""Metadata of audio stream."""
language: str
format: AudioFormats
codec: AudioCodecs
bit_rate: AudioBitRates
sample_rate: AudioSampleRates
channel: AudioChannels
@dataclass
class SpeechResult:
"""Result of audio Speech."""
text: str | None
result: SpeechResultState
@dataclass
class PartialSpeechResu
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key