Documentation
¶
Overview ¶
Package smallest is a streaming text-to-speech service backed by Smallest AI's Waves WebSocket. For each sentence it opens a connection, sends the transcript, and streams the raw PCM audio chunks downstream.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewSTT ¶
func NewSTT(cfg STTConfig) *stt.StreamService
NewSTT builds a Smallest AI streaming STT service.
Types ¶
type Config ¶
type Config struct {
// APIKey is the Smallest AI API key. Required.
APIKey string `validate:"required"`
// URL overrides the TTS WebSocket endpoint; empty uses the hosted endpoint.
URL string
// Model is the Smallest model id; empty uses a default.
Model string
// Voice is the voice id; empty uses a default voice.
Voice string
// Language is the synthesis language code; empty uses "en".
Language string
// SampleRate is the PCM rate requested and emitted downstream; 0 uses 24 kHz.
SampleRate int
// Speed multiplies the speaking rate; nil uses the service default.
Speed *float64
}
Config configures the Smallest AI TTS service.
type STTConfig ¶
type STTConfig struct {
// APIKey is the Smallest AI API key. Required.
APIKey string `validate:"required"`
// BaseURL overrides the STT WebSocket base; empty uses the hosted endpoint.
BaseURL string
// Language is the audio language code; empty lets the service auto-detect.
Language string
// Encoding is the PCM encoding sent to the API; empty uses "linear16".
Encoding string
// SampleRate is the input audio sample rate; 0 uses the transport's rate.
SampleRate int
}
STTConfig configures the Smallest AI streaming STT (Pulse) service.
Click to show internal directories.
Click to hide internal directories.