AudioConstraints class
Represents audio processing constraints for WebRTC media streams. These constraints control audio processing features that improve call quality by reducing echo, background noise, and normalizing audio levels.
Aligns with the W3C MediaTrackConstraints specification for audio.
See: https://w3c.github.io/mediacapture-main/getusermedia.html#def-constraint-echoCancellation See: https://w3c.github.io/mediacapture-main/getusermedia.html#dfn-noisesuppression See: https://w3c.github.io/mediacapture-main/getusermedia.html#dfn-autogaincontrol
Constructors
- AudioConstraints({bool echoCancellation = true, bool noiseSuppression = true, bool autoGainControl = true})
-
Creates a new AudioConstraints instance with the specified values.
All parameters default to true to enable all audio processing features.
const
- AudioConstraints.disabled()
-
Creates an AudioConstraints instance with all features disabled.
factory
- AudioConstraints.enabled()
-
Creates an AudioConstraints instance with all features enabled.
factory
-
AudioConstraints.fromMap(Map<
String, dynamic> map) -
Creates an AudioConstraints instance from a Map.
factory
Properties
- autoGainControl → bool
-
Enable/disable automatic gain control. When enabled, automatically
adjusts microphone gain to normalize audio levels. Default: true
final
- echoCancellation → bool
-
Enable/disable echo cancellation. When enabled, removes acoustic
echo caused by audio feedback between microphone and speaker. Default: true
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- noiseSuppression → bool
-
Enable/disable noise suppression. When enabled, reduces background
noise to improve voice clarity. Default: true
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
copyWith(
{bool? echoCancellation, bool? noiseSuppression, bool? autoGainControl}) → AudioConstraints - Creates a copy of this AudioConstraints with the specified values replaced.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toMap(
{bool isAndroid = false}) → Map< String, dynamic> - Converts the AudioConstraints to a Map suitable for WebRTC configuration.
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override