RealtimeAudioFormats class sealed

Audio format for Realtime sessions.

A discriminated union (type) of three concrete formats:

  • AudioPcmaudio/pcm, 24 kHz signed 16-bit PCM (rate: 24000).
  • AudioPcmuaudio/pcmu, G.711 μ-law.
  • AudioPcmaaudio/pcma, G.711 A-law.

An UnknownRealtimeAudioFormats fallback preserves the original payload for any unrecognised discriminator so that future server additions do not break existing clients.

Example

const format = RealtimeAudioFormats.pcm(rate: 24000);
const ulaw = RealtimeAudioFormats.pcmu();
Implementers

Constructors

RealtimeAudioFormats.fromJson(Map<String, dynamic> json)
Creates from JSON.
factory
RealtimeAudioFormats.pcm({int? rate})
Creates a 24 kHz PCM audio format.
const
factory
RealtimeAudioFormats.pcma()
Creates a G.711 A-law audio format.
const
factory
RealtimeAudioFormats.pcmu()
Creates a G.711 μ-law audio format.
const
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
type String
The audio format discriminator.
no setter

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Converts to JSON.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited