Documentation
¶
Overview ¶
Package audio transcodes the raw PCM emitted by Gemini TTS into the OGG/Opus container chat apps such as Telegram render as a voice message.
It shells out to ffmpeg: there is no production-quality pure-Go Opus encoder, and CGO would break static builds.
Index ¶
Constants ¶
const MinClipMillis = 1500
MinClipMillis is the minimum clip duration: some chat platforms reject sub-~1s clips as audio messages, so short clips are padded with trailing silence up to this length.
Variables ¶
var ErrFFmpegMissing error = ffmpegMissingError{}
ErrFFmpegMissing is returned when the ffmpeg binary is not available on PATH.
Functions ¶
func Available ¶
func Available() bool
Available reports whether the ffmpeg binary can be found on PATH.
func EncodePCMToOggOpus ¶
EncodePCMToOggOpus converts 16-bit little-endian signed mono PCM at the given sample rate into an OGG/Opus file suitable for voice-message playback.
func PCMDurationMs ¶
PCMDurationMs returns the duration of 16-bit mono PCM at the given rate.
func TripleOggWithGap ¶
TripleOggWithGap returns an OGG/Opus that plays the input clip three times separated by gapMillis of silence, padded to MinClipMillis. Lengthens stored short clips (a single word/sound) so strict platforms accept them, without re-TTS.
Types ¶
This section is empty.