getAudioRoute method

Future<AudioRoute?> getAudioRoute()

@detail api @author dixing @brief 获取当前使用的音频播放路由。 @return 详见 AudioRoute{@link #AudioRoute} @note 要设置音频路由,详见 setAudioRoute{@link #RTCEngine#setAudioRoute}。

Implementation

Future<AudioRoute?> getAudioRoute() async {
  $a() async {
    final funcResult = await ($instance as $p_a.RTCEngine).getAudioRoute();
    if (funcResult == null) {
      throw StateError('Android getAudioRoute() cannot be null');
    }
    return t_AudioRoute.android_to_code(funcResult);
  }

  ;
  $i() async {
    final funcResult =
        await ($instance as $p_i.ByteRTCEngine).getAudioRoute();
    if (funcResult == null) {
      throw StateError('iOS getAudioRoute() cannot be null');
    }
    return t_AudioRoute.ios_to_code(funcResult);
  }

  ;

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