audio

package
v0.67.21 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package audio provides the shared PCM audio primitives for the SpeechKit capture format: 16kHz S16 mono constants, WAV framing, duration math, and RMS level estimation.

Index

Constants

View Source
const (
	SampleRate     = 16000
	Channels       = 1
	BitsPerSample  = 16
	BytesPerSample = BitsPerSample / 8
)

Variables

This section is empty.

Functions

func PCMDurationSecs

func PCMDurationSecs(pcm []byte) float64

PCMDurationSecs returns the duration of PCM audio in seconds.

func PCMLevel

func PCMLevel(pcm []byte) float64

PCMLevel estimates a normalized RMS level from 16-bit PCM samples.

func PCMToWAV

func PCMToWAV(pcm []byte) []byte

PCMToWAV wraps raw 16kHz S16 Mono PCM data in a WAV header.

Types

This section is empty.

Directories

Path Synopsis
Package capture is the public microphone / system-audio capture layer of the SpeechKit framework: backend registry (RegisterBackend, Open), capture Session contract, device enumeration (ListCaptureDevices, ListOutputDevices), and the pooled PCM frame buffers (FramePool).
Package capture is the public microphone / system-audio capture layer of the SpeechKit framework: backend registry (RegisterBackend, Open), capture Session contract, device enumeration (ListCaptureDevices, ListOutputDevices), and the pooled PCM frame buffers (FramePool).

Jump to

Keyboard shortcuts

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