setExternalAudioSink abstract method

Future<void> setExternalAudioSink({
  1. required bool enabled,
  2. required int sampleRate,
  3. required int channels,
})

Sets the external audio sink.

This method applies to scenarios where you want to use external audio data for playback. After you set the external audio sink, you can call pullAudioFrame to pull remote audio frames. The app can process the remote audio and play it with the audio effects that you want.

  • enabled Whether to enable or disable the external audio sink: true : Enables the external audio sink. false : (Default) Disables the external audio sink.
  • sampleRate The sample rate (Hz) of the external audio sink, which can be set as 16000, 32000, 44100, or 48000.
  • channels The number of audio channels of the external audio sink: 1: Mono. 2: Stereo.

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.

Implementation

Future<void> setExternalAudioSink(
    {required bool enabled, required int sampleRate, required int channels});