getAudioTrackCount method

Future<int?> getAudioTrackCount()

@detail api @brief 获取当前音乐文件的音轨数 @return + >= 0:成功,返回当前音乐文件的音轨数 - < 0:方法调用失败 @note - 仅在音频播放进行状态时,调用此方法。 - 此方法仅支持音乐文件,不支持 PCM 数据。

Implementation

Future<int?> getAudioTrackCount() async {
  $a() => ($instance as $p_a.IMediaPlayer).getAudioTrackCount();
  $i() => ($instance as $p_i.ByteRTCMediaPlayer).getAudioTrackCount();

  if (Platform.isAndroid) {
    return $a();
  } else if (Platform.isIOS) {
    return $i();
  } else {
    throw UnsupportedError(
        'Not Support Platform ${Platform.operatingSystem}');
  }
}