enableCustomAudioLocalPlayback abstract method

Future<void> enableCustomAudioLocalPlayback({
  1. required int trackId,
  2. required bool enabled,
})

Sets whether to enable the local playback of external audio source.

Ensure you have called the createCustomAudioTrack method to create a custom audio track before calling this method. After calling this method to enable the local playback of external audio source, if you need to stop local playback, you can call this method again and set enabled to false. You can call adjustCustomAudioPlayoutVolume to adjust the local playback volume of the custom audio track.

  • trackId The audio track ID. Set this parameter to the custom audio track ID returned in createCustomAudioTrack.
  • enabled Whether to play the external audio source: true : Play the external audio source. false : (Default) Do not play the external source.

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> enableCustomAudioLocalPlayback(
    {required int trackId, required bool enabled});