RealtimeAudioConfigInput class
Input audio configuration for a Realtime session.
Tri-state serialization for noise_reduction, transcription,
turn_detection — these fields have three distinct meanings on
session.update:
- Field omitted from the request → server keeps the current value
(don't change). This is the default when the typed field is
null. - Field present with value → server sets/replaces the configuration.
- Field present with explicit JSON
null→ server disables the feature (clears any prior configuration).
To send the third form (explicit JSON null), pass the matching
clearNoiseReduction / clearTranscription / clearTurnDetection
flag as true. The flags are ignored when the corresponding typed
field is also non-null (the value wins). Roundtrip preserves the
distinction: a wire payload with "noise_reduction": null parses
back as clearNoiseReduction: true.
- Annotations
-
- @immutable
Constructors
- RealtimeAudioConfigInput({RealtimeAudioFormats? format, AudioInputNoiseReduction? noiseReduction, InputAudioTranscription? transcription, RealtimeAudioInputTurnDetection? turnDetection, bool clearNoiseReduction = false, bool clearTranscription = false, bool clearTurnDetection = false})
-
Creates a RealtimeAudioConfigInput.
const
-
RealtimeAudioConfigInput.fromJson(Map<
String, dynamic> json) -
Creates from JSON.
factory
Properties
- clearNoiseReduction → bool
-
When
true, emit"noise_reduction": nullon the wire to ask the server to disable noise reduction (only relevant onsession.update). Has no effect when noiseReduction is non-null.final - clearTranscription → bool
-
When
true, emit"transcription": nullon the wire to ask the server to disable transcription. Has no effect when transcription is non-null.final - clearTurnDetection → bool
-
When
true, emit"turn_detection": nullon the wire to ask the server to disable turn detection. Has no effect when turnDetection is non-null.final - format → RealtimeAudioFormats?
-
Input audio format.
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- noiseReduction → AudioInputNoiseReduction?
-
Noise-reduction configuration.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- transcription → InputAudioTranscription?
-
Transcription configuration.
final
- turnDetection → RealtimeAudioInputTurnDetection?
-
Turn-detection configuration.
final
Methods
-
copyWith(
{Object? format = unsetCopyWithValue, Object? noiseReduction = unsetCopyWithValue, Object? transcription = unsetCopyWithValue, Object? turnDetection = unsetCopyWithValue, bool? clearNoiseReduction, bool? clearTranscription, bool? clearTurnDetection}) → RealtimeAudioConfigInput -
Returns a copy of this RealtimeAudioConfigInput with the given fields
replaced. Pass
nullfor any nullable field to clear the in-memory value (use theclear*flags to send explicit JSON null over the wire). -
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.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override