setExternalAudioSource abstract method
Sets the external audio source parameters.
Deprecated Deprecated: This method is deprecated. Use createCustomAudioTrack instead.
enabledWhether to enable the external audio source: true : Enable the external audio source. false : (Default) Disable the external audio source.sampleRateThe sample rate (Hz) of the external audio source. You can set it to 8000, 16000, 32000, 44100, or 48000.channelsThe number of channels of the external audio source. You can set it to 1 (mono) or 2 (stereo).localPlaybackWhether to play the external audio source locally: true : Play locally. false : (Default) Do not play locally.publishWhether 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});