setAudioProfile abstract method
Future<void>
setAudioProfile({
- required AudioProfileType profile,
- AudioScenarioType scenario = AudioScenarioType.audioScenarioDefault,
Sets the audio encoding profile and audio scenario.
Due to iOS system limitations, some audio routes cannot be recognized in communication volume mode. Therefore, if you need to use an external sound card, it is recommended to set the audio scenario to the high-quality scenario audioScenarioGameStreaming (3). In this scenario, the SDK switches to media volume to avoid the issue.
profileAudio encoding profile, including sample rate, bitrate, encoding mode, and number of channels. See AudioProfileType.scenarioAudio scenario. The device volume type varies under different audio scenarios. See AudioScenarioType.
Returns When the method call succeeds, there is no return value; when fails, the AgoraRtcException exception is thrown. You need to catch the exception and handle it accordingly. See Error Codes for details and resolution suggestions.
Implementation
Future<void> setAudioProfile(
{required AudioProfileType profile,
AudioScenarioType scenario = AudioScenarioType.audioScenarioDefault});