selectMultiAudioTrack

Selects the audio tracks that you want to play on your local device and publish to the channel respectively.

virtual int selectMultiAudioTrack(int playoutTrackIndex, int publishTrackIndex) = 0;

Details

You can call this method to determine the audio track to be played on your local device and published to the channel.

Before calling this method, you need to open the media file with the openWithMediaSource method and set enableMultiAudioTrack in MediaSource as true.

Applicable scenarios

For example, in KTV scenarios, the host can choose to play the original sound locally and publish the accompaniment track to the channel.

Parameters

playoutTrackIndex
The index of audio tracks for local playback. You can obtain the index through getStreamInfo.
publishTrackIndex
The index of audio tracks to be published in the channel. You can obtain the index through getStreamInfo.

Returns

  • < 0: Failure.