selectAudioTrack method
Specifies the playback track index
of the current music file.
Since v4.2.0
After getting the audio track index of the current music file, call this method to specify any audio track to play. For example, if different tracks of a multitrack file store songs in different languages, you can call this method to set the language of the music file to play.
Parameter index
The specified playback track. This parameter must be less than or equal to the return value of getAudioTrackCount.
Note:
- Call this method after calling startAudioMixing and receiving the RtcEngineEventHandler.audioMixingStateChanged event callback with state code AudioMixingStateCode.Playing.
- For the audio file formats supported by this method, see What formats of audio files does the Agora RTC SDK support.
Implementation
@override
Future<void> selectAudioTrack(int index) {
return _invokeMethod('selectAudioTrack', {
'index': index,
});
}