AudioSessionConfiguration constructor

const AudioSessionConfiguration({
  1. AVAudioSessionCategory? avAudioSessionCategory,
  2. AVAudioSessionCategoryOptions? avAudioSessionCategoryOptions,
  3. AVAudioSessionMode? avAudioSessionMode,
  4. AVAudioSessionRouteSharingPolicy? avAudioSessionRouteSharingPolicy,
  5. AVAudioSessionSetActiveOptions? avAudioSessionSetActiveOptions,
  6. AndroidAudioAttributes? androidAudioAttributes,
  7. AndroidAudioFocusGainType androidAudioFocusGainType = AndroidAudioFocusGainType.gain,
  8. bool? androidWillPauseWhenDucked,
})

Creates an audio session configuration from scratch.

Options prefixed with av correspond to classes in Apple's AVFoundation library and their values will be ignored on all platforms other than iOS. Only certain combinations of these configuration options are permitted, and you should consult Apple's documentation for further information.

Options prefixed with android correspond to options in Android's SDK and their values are ignored on all platforms other than Android. Note that the underlying Android platform allows different audio players to use different audio attributes, and so the values supplied here act as hints on the type of configuration you would like audio plugins in your session to adopt by default.

Implementation

const AudioSessionConfiguration({
  this.avAudioSessionCategory,
  this.avAudioSessionCategoryOptions,
  this.avAudioSessionMode,
  this.avAudioSessionRouteSharingPolicy,
  this.avAudioSessionSetActiveOptions,
  this.androidAudioAttributes,
  this.androidAudioFocusGainType = AndroidAudioFocusGainType.gain,
  this.androidWillPauseWhenDucked,
});