enableCustomAudioLocalPlayback abstract method

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

Sets whether to play the external audio source locally.

After calling this method to enable local playback of the externally captured audio source, 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. Before calling this method, make sure you have already called createCustomAudioTrack to create a custom audio track.

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

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