The Agora RTC SDK provides a series of methods to manage audio files. The support of each method for single-track or multi-track audio files is as follows:
startAudioMixing
: Supports single-track and multi-track audio files.getAudioTrackCount
: Supports single-track and multi-track audio files.selectAudioTrack
: Supports single-track and multi-track audio files.playEffect
: Only supports single-track audio files.preloadEffect
: Only supports single-track audio files.getEffectDuration
: Only supports single-track audio files.startRhythmPlayer
: Only supports single-track audio files.getAudioFileInfo
: Supports single-track and multi-track audio files.By default, the SDK supports the audio file formats listed in Basic audio file formats. The container format of a audio file (including the filename extensions) must be consistent with the audio codec format.
As of v3.6.2, the SDK provides a full-format audio decoding extension library, which can support more audio file formats. See Extended audio file formats. This extension library is currently only available when you call startAudioMixing
to play audio files.
The Agora RTC SDK supports single-track audio files in the following formats:
The Agora RTC SDK supports multi-track audio files in the following formats:
If you use the SDK v3.6.2 or later and have integrated the full-format audio decoding extension library, the startAudioMixing
method supports playing the following types of audio files:
Platform | File source | Audio track | File container | Audio codec |
---|---|---|---|---|
Android, iOS, macOS, and Windows | Local and online | Single-track and multi-track | 3GP, AAC, AMR, ASF, AVI, FLAC, M4A, M4V, MOV, MP3, MP4, TS, Ogg, WAV, WMA | AAC, ARM, FALC, MP2, MP3, PCM, Vorbis, WMAV2, OPUS |
playEffect
or preloadEffect
to read files in the 3GP format on some Android devices (such as Xiaomi).