Documentation
¶
Overview ¶
Package stt provides a provider-agnostic interface for speech-to-text transcription.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Response ¶
type Response struct {
// Text is the full transcript.
Text string
// Language is the detected or requested IETF language tag.
Language string
// Duration is the total audio length in seconds.
Duration float64
// Segments contains sentence-level chunks (when available).
Segments []Segment
// Words contains word-level timing (when available).
Words []Word
// Model identifies which model produced the transcript.
Model string
}
Response is the canonical transcription result.
type Segment ¶
type Segment struct {
ID int `json:"id"`
Start float64 `json:"start"`
End float64 `json:"end"`
Text string `json:"text"`
}
Segment is a sentence-level transcript chunk.
type SpeechToText ¶
type SpeechToText interface {
// Transcribe converts audio bytes to text.
// audioData must be in a format the provider accepts (MP3, WAV, WebM, …).
Transcribe(ctx context.Context, audioData []byte) (*Response, error)
// Provider returns a stable provider name (e.g. "openai", "deepgram").
Provider() string
}
SpeechToText is the core interface for transcription providers. Implementations must be safe for concurrent use.
Click to show internal directories.
Click to hide internal directories.