Documentation
¶
Overview ¶
Package audio centralises audio-format conversion so every transcription entry point (bridge voice notes, agent-invoked /api/agent/llm/transcribe) normalises to a format every STT model accepts.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NormalizeForSTT ¶
func NormalizeForSTT(ctx context.Context, audio []byte, filename, mime string) (outAudio []byte, outFilename, outMime string, err error)
NormalizeForSTT converts audio bytes to a format every OpenAI STT model accepts (MP3). Formats already on the STT whitelist pass through unchanged. Ogg/opus (Telegram voice notes), FLAC, video containers (mov, avi, mkv, non-ISO-BMFF wrappers) are transcoded. On transcoder failure — notably when ffmpeg is missing — the original bytes are returned so whisper-1 (which accepts ogg natively) still works in degraded setups.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.