getSpatialAudio method

Future<ISpatialAudio?> getSpatialAudio()

@detail api @author wangjunzheng @brief Get location audio interface instances. @return Spatial audio management interface instance. If NULL is returned, spatial audio is not supported. See ISpatialAudio{@link #ISpatialAudio}. @note - The first time this API is called must be between you create a room and you actually enter the room. Refer to Spatial Audio for more information. - The spatial audio effect can only be turned on when using a device that supports true two-channel playback; - In the case of poor network conditions, even if this function is turned on, the spatial audio effect will not be generated; - Insufficient performance of the model may cause the audio card. When using a low-end machine, it is not recommended to turn on the spatial audio effect; - Spatial audio effects do not take effect when server level routing is enabled.

Implementation

Future<ISpatialAudio?> getSpatialAudio() async {
  $a() async => packObject(
      await ($instance as $p_a.RTCRoom).getSpatialAudio(),
      () => ISpatialAudio());
  $i() async => packObject(
      await ($instance as $p_i.ByteRTCRoom).getSpatialAudio(),
      () => ISpatialAudio());

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