AudioContextConfig class

This class contains flags to control several secondary, platform-specific aspects of audio playback, like how this audio interact with other audios, how is it played by the device and what happens when the app is backgrounded. However, note that each platform has its nuances on how to configure audio. This class is a generic abstraction of some parameters that can be useful across the board. Its flags are simple abstractions that are then translated to an AudioContext containing platform specific configurations: AudioContextAndroid and AudioContextIOS. If these simplified flags cannot fully reflect your goals, you must create an AudioContext configuring each platform separately.

Constructors

AudioContextConfig({AudioContextConfigRoute route = AudioContextConfigRoute.system, AudioContextConfigFocus focus = AudioContextConfigFocus.gain, bool respectSilence = false, bool stayAwake = false})

Properties

focus AudioContextConfigFocus
This flag determines how your audio interacts with other audio playing on the device.
final
hashCode int
The hash code for this object.
no setterinherited
respectSilence bool
Whether the "silent" mode of the device should be respected.
final
route AudioContextConfigRoute
Normally, audio played will respect the devices configured preferences. However, if you want to bypass that and flag the system to use the built-in speakers or the earpiece, you can set this flag. See AudioContextConfigRoute for more details on the options.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stayAwake bool
By default, when the screen is locked, all the app's processing stops, including audio playback. You can set this flag to keep your audio playing even when locked.
final

Methods

build() AudioContext
buildAndroid() AudioContextAndroid
buildIOS() AudioContextIOS?
copy({AudioContextConfigRoute? route, AudioContextConfigFocus? focus, bool? respectSilence, bool? stayAwake}) AudioContextConfig
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override
validateIOS() → void

Operators

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