Audio Buffer
class AudioBuffer(val data: ByteArray, val timestamp: Long, val durationMs: Long = 0, val sampleRate: Int = 16000)
Audio buffer containing PCM data from recording.
Properties
Link copied to clipboard
Duration of this buffer in milliseconds
Link copied to clipboard
Number of samples in this buffer. For mono: frameCount = sampleCount For stereo: frameCount = sampleCount / 2
Link copied to clipboard
Sample rate of this audio buffer in Hz
Link copied to clipboard
Lazily computed float samples, normalized to -1.0, 1.0. This avoids allocation if float data is not needed.
Functions
Link copied to clipboard
Fill a pre-allocated FloatArray with normalized samples. This is the zero-allocation path for real-time DSP.
Link copied to clipboard
Convenience method to get samples as FloatArray. Equivalent to accessing the lazy samples property.