setExternalAudioSource abstract method

Future<void> setExternalAudioSource({
  1. required bool enabled,
  2. required int sampleRate,
  3. required int channels,
  4. bool localPlayback = false,
  5. bool publish = true,
})

Sets the external audio source parameters.

Deprecated Deprecated: This method is deprecated. Use createCustomAudioTrack instead.

  • enabled Whether to enable the external audio source: true : Enable the external audio source. false : (Default) Disable the external audio source.
  • sampleRate The sample rate (Hz) of the external audio source. You can set it to 8000, 16000, 32000, 44100, or 48000.
  • channels The number of channels of the external audio source. You can set it to 1 (mono) or 2 (stereo).
  • localPlayback Whether to play the external audio source locally: true : Play locally. false : (Default) Do not play locally.
  • publish Whether to publish the audio to the remote: true : (Default) Publish to the remote. false : Do not publish to the remote.

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. < 0: Failure. See Error Codes for details and resolution suggestions.

Implementation

Future<void> setExternalAudioSource(
    {required bool enabled,
    required int sampleRate,
    required int channels,
    bool localPlayback = false,
    bool publish = true});