RealtimeAudioFormats class sealed
Audio format for Realtime sessions.
A discriminated union (type) of three concrete formats:
- AudioPcm —
audio/pcm, 24 kHz signed 16-bit PCM (rate: 24000). - AudioPcmu —
audio/pcmu, G.711 μ-law. - AudioPcma —
audio/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.
constfactory
- RealtimeAudioFormats.pcma()
-
Creates a G.711 A-law audio format.
constfactory
- RealtimeAudioFormats.pcmu()
-
Creates a G.711 μ-law audio format.
constfactory
Properties
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