Documentation
¶
Overview ¶
Package whispercpp is a speech-to-text provider for a local whisper.cpp server. whisper.cpp's HTTP server exposes an OpenAI-compatible /v1/audio/transcriptions endpoint, so this provider is a thin wrapper over the OpenAI-compatible transcription service pointed at a local URL.
It is segmented: a turn detector upstream delimits each utterance, which is uploaded and transcribed in one request.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewSTT ¶
func NewSTT(cfg Config) *stt.SegmentService
NewSTT builds a whisper.cpp transcription service.
Types ¶
type Config ¶
type Config struct {
// BaseURL is the OpenAI-compatible API base of the local server, including
// any version segment (e.g. http://localhost:8080/v1). Required.
BaseURL string `validate:"required,url"`
// APIKey is an optional bearer token; most local servers need none.
APIKey string
// Model overrides the model field sent with each request.
Model string
// Language of the audio, sent as an ISO code; the zero value omits it
// (auto-detect).
Language language.Language
// SampleRate is the input audio sample rate; 0 uses the transport's rate.
SampleRate int
// TTFSP99 overrides the measured transcript latency the turn strategies
// size their wait by; 0 uses stt.WhisperTTFSP99.
TTFSP99 time.Duration
}
Config configures the whisper.cpp STT provider.
Click to show internal directories.
Click to hide internal directories.