AudioFrame

data class AudioFrame(val samples: ShortArray, val sampleRateHz: Int = DEFAULT_SAMPLE_RATE_HZ)

One frame of 16-bit signed PCM audio.

Realtime providers ship audio as base64-encoded little-endian PCM16 mono; the gateway is responsible for that wire-level (un)framing so consumers only ever deal with raw 16-bit samples here.

Constructors

Link copied to clipboard
constructor(samples: ShortArray, sampleRateHz: Int = DEFAULT_SAMPLE_RATE_HZ)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Sample rate in Hertz. Defaults to 24 000 — OpenAI Realtime's default for pcm16 audio.

Link copied to clipboard

Interleaved little-endian PCM16 samples (mono, single channel). For OpenAI Realtime the default sample rate is 24 kHz.

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int