Guides
Audio Format & Sending Audio
Input requirements, real-time pacing, and PCM conversion for ProcessSamples
Audio is sent and received through a single synchronous call:
Was this page helpful?
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Input requirements, real-time pacing, and PCM conversion for ProcessSamples
virtual void ProcessSamples(const std::vector<float>& inBuffer,
std::vector<float>& outBuffer) = 0;
| Property | Required value |
|---|---|
| Channels | Mono (1 channel) |
| Sample format | 32-bit float, normalised to −1.0 … +1.0 |
| Sample rate | 8 000, 16 000, or 48 000 Hz — must match AudioParams.sampleRate |
| Frame size | 20 ms recommended: 160 samples @ 8 kHz, 320 @ 16 kHz, 960 @ 48 kHz |
// int16 → float
float sample = pcm16 / 32768.0f;
// float → int16 (for writing WAV output)
int16_t pcm = (int16_t)(std::max(-1.0f, std::min(1.0f, sample)) * 32767.0f);
Was this page helpful?