Skip to content

Commit

Permalink
feat: add missing flutter implementation for native sdk 3.5.1 (#477)
Browse files Browse the repository at this point in the history
  • Loading branch information
littleGnAl committed Oct 26, 2021
1 parent bf2a29a commit 17a4493
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions lib/src/rtc_engine.dart
Expand Up @@ -536,6 +536,13 @@ class RtcEngine with RtcEngineInterface {
});
}

@override
Future<int?> getAudioFileInfo(String filePath) {
return _invokeMethod('getAudioFileInfo', {
'filePath': filePath,
});
}

@override
Future<int?> getAudioMixingPlayoutVolume() {
return _invokeMethod('getAudioMixingPlayoutVolume');
Expand Down Expand Up @@ -2128,8 +2135,36 @@ mixin RtcAudioMixingInterface {
/// **Returns**
/// - The total duration (ms) of the specified music file, if this method call succeeds.
/// - Error code, if this method call fails.
@Deprecated(
'This method is deprecated as of v4.1.0. Use getAudioFileInfo instead.')
Future<int?> getAudioMixingDuration([String? filePath]);

/// Gets the information of a specified audio file.
///
/// **Since** v3.5.1
///
/// After calling this method successfully, the SDK triggers the [onRequestAudioFileInfo](https://docs.agora.io/en/Interactive%20Broadcast/API%20Reference/java/classio_1_1agora_1_1rtc_1_1_i_rtc_engine_event_handler.html#a3e1191735cd197815f4001b89825220a)
/// 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](https://docs.agora.io/en/faq/audio_format).
///
/// **Parameters**
/// - 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`.
///
/// **Returns**
/// - 0: Success.
/// - < 0: Failure.
Future<int?> getAudioFileInfo(String filePath);

/// Gets the playback position of the audio file.
///
/// Call this method when you are in a channel.
Expand Down

0 comments on commit 17a4493

Please sign in to comment.