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 ¶
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 ¶
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.