io.agora.rtc

## Class AudioSessionConfig

- java.lang.Object
- - io.agora.rtc.AudioSessionConfig

-     public class AudioSessionConfig
      extends java.lang.Object

  Configuration for audio session settings.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private int` | `allowBluetooth` Allow Bluetooth
    `private int` | `allowBluetoothA2dp` Allow Bluetooth A2DP
    `private int` | `allowMixWithOthers` Allow mix with others
    `private int` | `chatMode` Chat mode
    `private int` | `defaultToSpeaker` Default to speaker
    `private int` | `inputNumberOfChannels` Input number of channels
    `private double` | `ioBufferDuration` IO buffer duration
    `private int` | `outputNumberOfChannels` Output number of channels
    `private int` | `overrideSpeaker` Override speaker
    `private int` | `playbackAndRecord` Playback and record mode
    `private double` | `sampleRate` Sample rate

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AudioSessionConfig()` Default constructor for AudioSessionConfig.
    `AudioSessionConfig(int playbackAndRecord, int chatMode, int defaultToSpeaker, int overrideSpeaker, int allowMixWithOthers, int allowBluetooth, int allowBluetoothA2dp, double sampleRate, double ioBufferDuration, int inputNumberOfChannels, int outputNumberOfChannels)` Constructs AudioSessionConfig with all parameters.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getAllowBluetooth()` Gets whether to allow Bluetooth.
    `int` | `getAllowBluetoothA2dp()` Gets whether to allow Bluetooth A2DP.
    `int` | `getAllowMixWithOthers()` Gets whether to allow mix with others.
    `int` | `getChatMode()` Gets the chat mode.
    `int` | `getDefaultToSpeaker()` Gets the default to speaker setting.
    `int` | `getInputNumberOfChannels()` Gets the input number of channels.
    `double` | `getIoBufferDuration()` Gets the IO buffer duration.
    `int` | `getOutputNumberOfChannels()` Gets the output number of channels.
    `int` | `getOverrideSpeaker()` Gets the override speaker setting.
    `int` | `getPlaybackAndRecord()` Gets the playback and record mode.
    `double` | `getSampleRate()` Gets the sample rate.
    `void` | `setAllowBluetooth(int allowBluetooth)` Sets whether to allow Bluetooth.
    `void` | `setAllowBluetoothA2dp(int allowBluetoothA2dp)` Sets whether to allow Bluetooth A2DP.
    `void` | `setAllowMixWithOthers(int allowMixWithOthers)` Sets whether to allow mix with others.
    `void` | `setChatMode(int chatMode)` Sets the chat mode.
    `void` | `setDefaultToSpeaker(int defaultToSpeaker)` Sets the default to speaker setting.
    `void` | `setInputNumberOfChannels(int inputNumberOfChannels)` Sets the input number of channels.
    `void` | `setIoBufferDuration(double ioBufferDuration)` Sets the IO buffer duration.
    `void` | `setOutputNumberOfChannels(int outputNumberOfChannels)` Sets the output number of channels.
    `void` | `setOverrideSpeaker(int overrideSpeaker)` Sets the override speaker setting.
    `void` | `setPlaybackAndRecord(int playbackAndRecord)` Sets the playback and record mode.
    `void` | `setSampleRate(double sampleRate)` Sets the sample rate.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### playbackAndRecord

          private int playbackAndRecord

      Playback and record mode

    - #### chatMode

          private int chatMode

      Chat mode

    - #### defaultToSpeaker

          private int defaultToSpeaker

      Default to speaker

    - #### overrideSpeaker

          private int overrideSpeaker

      Override speaker

    - #### allowMixWithOthers

          private int allowMixWithOthers

      Allow mix with others

    - #### allowBluetooth

          private int allowBluetooth

      Allow Bluetooth

    - #### allowBluetoothA2dp

          private int allowBluetoothA2dp

      Allow Bluetooth A2DP

    - #### sampleRate

          private double sampleRate

      Sample rate

    - #### ioBufferDuration

          private double ioBufferDuration

      IO buffer duration

    - #### inputNumberOfChannels

          private int inputNumberOfChannels

      Input number of channels

    - #### outputNumberOfChannels

          private int outputNumberOfChannels

      Output number of channels

  - ### Constructor Detail

    - #### AudioSessionConfig

          public AudioSessionConfig()

      Default constructor for AudioSessionConfig.

    - #### AudioSessionConfig

          public AudioSessionConfig(int playbackAndRecord,
                                    int chatMode,
                                    int defaultToSpeaker,
                                    int overrideSpeaker,
                                    int allowMixWithOthers,
                                    int allowBluetooth,
                                    int allowBluetoothA2dp,
                                    double sampleRate,
                                    double ioBufferDuration,
                                    int inputNumberOfChannels,
                                    int outputNumberOfChannels)

      Constructs AudioSessionConfig with all parameters.
      Parameters:
        `playbackAndRecord` - Playback and record mode
        `chatMode` - Chat mode
        `defaultToSpeaker` - Default to speaker
        `overrideSpeaker` - Override speaker
        `allowMixWithOthers` - Allow mix with others
        `allowBluetooth` - Allow Bluetooth
        `allowBluetoothA2dp` - Allow Bluetooth A2DP
        `sampleRate` - Sample rate
        `ioBufferDuration` - IO buffer duration
        `inputNumberOfChannels` - Input number of channels
        `outputNumberOfChannels` - Output number of channels

  - ### Method Detail

    - #### getPlaybackAndRecord

          public int getPlaybackAndRecord()

      Gets the playback and record mode.
      Returns:
        Playback and record mode

    - #### setPlaybackAndRecord

          public void setPlaybackAndRecord(int playbackAndRecord)

      Sets the playback and record mode.
      Parameters:
        `playbackAndRecord` - Playback and record mode

    - #### getChatMode

          public int getChatMode()

      Gets the chat mode.
      Returns:
        Chat mode

    - #### setChatMode

          public void setChatMode(int chatMode)

      Sets the chat mode.
      Parameters:
        `chatMode` - Chat mode

    - #### getDefaultToSpeaker

          public int getDefaultToSpeaker()

      Gets the default to speaker setting.
      Returns:
        Default to speaker setting

    - #### setDefaultToSpeaker

          public void setDefaultToSpeaker(int defaultToSpeaker)

      Sets the default to speaker setting.
      Parameters:
        `defaultToSpeaker` - Default to speaker setting

    - #### getOverrideSpeaker

          public int getOverrideSpeaker()

      Gets the override speaker setting.
      Returns:
        Override speaker setting

    - #### setOverrideSpeaker

          public void setOverrideSpeaker(int overrideSpeaker)

      Sets the override speaker setting.
      Parameters:
        `overrideSpeaker` - Override speaker setting

    - #### getAllowMixWithOthers

          public int getAllowMixWithOthers()

      Gets whether to allow mix with others.
      Returns:
        Allow mix with others setting

    - #### setAllowMixWithOthers

          public void setAllowMixWithOthers(int allowMixWithOthers)

      Sets whether to allow mix with others.
      Parameters:
        `allowMixWithOthers` - Allow mix with others setting

    - #### getAllowBluetooth

          public int getAllowBluetooth()

      Gets whether to allow Bluetooth.
      Returns:
        Allow Bluetooth setting

    - #### setAllowBluetooth

          public void setAllowBluetooth(int allowBluetooth)

      Sets whether to allow Bluetooth.
      Parameters:
        `allowBluetooth` - Allow Bluetooth setting

    - #### getAllowBluetoothA2dp

          public int getAllowBluetoothA2dp()

      Gets whether to allow Bluetooth A2DP.
      Returns:
        Allow Bluetooth A2DP setting

    - #### setAllowBluetoothA2dp

          public void setAllowBluetoothA2dp(int allowBluetoothA2dp)

      Sets whether to allow Bluetooth A2DP.
      Parameters:
        `allowBluetoothA2dp` - Allow Bluetooth A2DP setting

    - #### getSampleRate

          public double getSampleRate()

      Gets the sample rate.
      Returns:
        Sample rate

    - #### setSampleRate

          public void setSampleRate(double sampleRate)

      Sets the sample rate.
      Parameters:
        `sampleRate` - Sample rate

    - #### getIoBufferDuration

          public double getIoBufferDuration()

      Gets the IO buffer duration.
      Returns:
        IO buffer duration

    - #### setIoBufferDuration

          public void setIoBufferDuration(double ioBufferDuration)

      Sets the IO buffer duration.
      Parameters:
        `ioBufferDuration` - IO buffer duration

    - #### getInputNumberOfChannels

          public int getInputNumberOfChannels()

      Gets the input number of channels.
      Returns:
        Input number of channels

    - #### setInputNumberOfChannels

          public void setInputNumberOfChannels(int inputNumberOfChannels)

      Sets the input number of channels.
      Parameters:
        `inputNumberOfChannels` - Input number of channels

    - #### getOutputNumberOfChannels

          public int getOutputNumberOfChannels()

      Gets the output number of channels.
      Returns:
        Output number of channels

    - #### setOutputNumberOfChannels

          public void setOutputNumberOfChannels(int outputNumberOfChannels)

      Sets the output number of channels.
      Parameters:
        `outputNumberOfChannels` - Output number of channels