audio

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 25, 2026 License: AGPL-3.0 Imports: 5 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL