audio

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: May 28, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FramesToWAV added in v0.0.9

func FramesToWAV(frames []*model.AudioFrame) bytes.Buffer

FramesToWAV combines all AudioFrames into a single WAV buffer (16-bit PCM) with a valid RIFF header. The resulting buffer is ready to be sent to STT services (e.g., Azure, Google) as the request body with Content-Type: audio/wav.

Audio metadata (sample rate, channels) is taken from the first frame. If unavailable, it falls back to 16 kHz mono.

func Resample

func Resample(input []byte, fromRate, toRate int) []byte

Simple linear resampler for 16-bit PCM mono audio

Types

This section is empty.

Jump to

Keyboard shortcuts

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