getAudioFileInfo method
Gets the information of a specified audio file.
Since v4.2.0
After calling this method successfully, the SDK triggers the RtcEngineEventHandler.requestAudioFileInfoCallback callback to report the information of an audio file, such as audio duration. You can call this method multiple times to get the information of multiple audio files.
Note
- Call this method after joining a channel.
- For the audio file formats supported by this method, see What formats of audio files does the Agora RTC SDK support.
Parameter filePath
The file path, including the filename extensions. To access an
online file, Agora supports using a URL address; to access a local file,
Agora supports using a URI address, an absolute path, or a path that starts
with /assets/
. You might encounter permission issues if you use an absolute
path to access a local file, so Agora recommends using a URI address instead.
For example: content://com.android.providers.media.documents/document/audio%3A14441
.
Implementation
@override
Future<void> getAudioFileInfo(String filePath) {
return _invokeMethod('getAudioFileInfo', {
'filePath': filePath,
});
}