pcmresample

package
v0.81.15 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2026 License: Apache-2.0 Imports: 1 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package pcmresample holds the PCM16 rate conversion shared by the realtime Voice Agent providers and the realtime STT adapters, so an STT adapter does not link the Voice Agent package for it.

Index

Constants

View Source
const (
	MicSampleRate      = 16000
	UpsampledInputRate = 24000
)

Microphone capture runs at 16 kHz; the realtime providers that need PCM input want 24 kHz. Both rates are protocol facts, not tuning knobs.

Variables

This section is empty.

Functions

func UpsampleMicPCM16Mono

func UpsampleMicPCM16Mono(src []byte) []byte

UpsampleMicPCM16Mono linearly interpolates a 16-bit signed little-endian PCM mono buffer from SpeechKit's mic rate to OpenAI's input rate. For the 16 kHz to 24 kHz path (ratio 2:3) the cost is negligible compared to the WS round-trip; CPU profiling at scale should still consider replacing this with a polyphase FIR resampler if it shows up as a hot path.

Types

This section is empty.

Jump to

Keyboard shortcuts

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