AudioContextIOS constructor
AudioContextIOS({
- AVAudioSessionCategory category = AVAudioSessionCategory.playback,
- Set<
AVAudioSessionOptions> options = const {},
Implementation
AudioContextIOS({
this.category = AVAudioSessionCategory.playback,
this.options = const {},
}) : assert(
category == AVAudioSessionCategory.playback ||
category == AVAudioSessionCategory.playAndRecord ||
category == AVAudioSessionCategory.multiRoute ||
!options.contains(AVAudioSessionOptions.mixWithOthers),
'You can set the option `mixWithOthers` explicitly only if the '
'audio session category is `playAndRecord`, `playback`, or '
'`multiRoute`.'),
assert(
category == AVAudioSessionCategory.playback ||
category == AVAudioSessionCategory.playAndRecord ||
category == AVAudioSessionCategory.multiRoute ||
!options.contains(AVAudioSessionOptions.duckOthers),
'You can set the option `duckOthers` explicitly only if the audio '
'session category is `playAndRecord`, `playback`, or `multiRoute`.',
),
assert(
category == AVAudioSessionCategory.playback ||
category == AVAudioSessionCategory.playAndRecord ||
category == AVAudioSessionCategory.multiRoute ||
!options.contains(
AVAudioSessionOptions.interruptSpokenAudioAndMixWithOthers,
),
'You can set the option `interruptSpokenAudioAndMixWithOthers` '
'explicitly only if the audio session category is `playAndRecord`, '
'`playback`, or `multiRoute`.'),
assert(
category == AVAudioSessionCategory.playAndRecord ||
category == AVAudioSessionCategory.record ||
!options.contains(AVAudioSessionOptions.allowBluetooth),
'You can set the option `allowBluetooth` explicitly only if the '
'audio session category is `playAndRecord` or `record`.'),
assert(
category == AVAudioSessionCategory.playAndRecord ||
category == AVAudioSessionCategory.record ||
category == AVAudioSessionCategory.multiRoute ||
!options.contains(AVAudioSessionOptions.allowBluetoothA2DP),
'You can set the option `allowBluetoothA2DP` explicitly only if '
'the audio session category is `playAndRecord`, `record`, or '
'`multiRoute`.'),
assert(
category == AVAudioSessionCategory.playAndRecord ||
!options.contains(AVAudioSessionOptions.allowAirPlay),
'You can set the option `allowAirPlay` explicitly only if the '
'audio session category is `playAndRecord`.'),
assert(
category == AVAudioSessionCategory.playAndRecord ||
!options.contains(AVAudioSessionOptions.defaultToSpeaker),
'You can set the option `defaultToSpeaker` explicitly only if the '
'audio session category is `playAndRecord`.'),
assert(
category == AVAudioSessionCategory.playAndRecord ||
category == AVAudioSessionCategory.record ||
category == AVAudioSessionCategory.multiRoute ||
!options.contains(
AVAudioSessionOptions.overrideMutedMicrophoneInterruption,
),
'You can set the option `overrideMutedMicrophoneInterruption` '
'explicitly only if the audio session category is `playAndRecord`, '
'`record`, or `multiRoute`.');