setAudioScenario

Sets audio scenarios.

public abstract int setAudioScenario(int scenario);

Details

Note: You can call this method either before or after joining a channel.

Parameters

scenario
The audio scenarios:
  • AUDIO_SCENARIO_DEFAULT(0): (Default) Automatic scenario, where the SDK chooses the appropriate audio quality according to the user role and audio route.
  • AUDIO_SCENARIO_GAME_STREAMING(3): High-quality audio scenario, where users mainly play music.
  • AUDIO_SCENARIO_CHATROOM(5): Chatroom scenario, where users need to frequently switch the user role or mute and unmute the microphone. In this scenario, audience members receive a pop-up window to request permission of using microphones.
  • AUDIO_SCENARIO_CHORUS(7): Real-time chorus scenario, where users have good network conditions and require extremely low latency.
    Note: Before using this enumeration, you need to call getAudioDeviceInfo to see whether the audio device supports ultra-low-latency capture and playback. To experience ultra-low latency, you need to ensure that your audio device supports ultra-low latency (isLowLatencyAudioSupported = true).
  • AUDIO_SCENARIO_MEETING(8): Meeting scenario that mainly involves the human voice.

Returns

  • 0: Success.
  • < 0: Failure.