audioio

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package audioio converts a local audio (or video) file into the 16 kHz mono 16-bit PCM WAV that whisper.cpp expects, using ffmpeg. It drops any video stream (-vn) so a video source only ships its audio downstream, and NEVER fetches a remote URL — only local files. Mirrors internal/videoio.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertToWav16k

func ConvertToWav16k(audioPath, ffmpegPath string) (string, func(), error)

ConvertToWav16k transcodes audioPath to a 16 kHz mono PCM WAV in a fresh temp dir and returns the wav path plus a cleanup func that removes the temp dir. ffmpegPath is the ffmpeg executable ("" => "ffmpeg"). The caller MUST defer cleanup() (it is also safe to call twice). A missing input or an ffmpeg failure returns an error and leaves nothing behind.

Types

This section is empty.

Jump to

Keyboard shortcuts

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