updateSelfPosition method

Future<int?> updateSelfPosition(
  1. PositionInfo positionInfo
)

@valid since 3.52 @detail api @author wangjunzheng @brief Sets the coordinate and orientation of the local user as a listener in the rectangular coordinate system the local user built to achieve expected spatial audio effects. @param positionInfo Information on the local user's position. Refer to PositionInfo{@link #PositionInfo} for details. @return - 0: Success. - <0: Failure. - -2: Failure. The reason is that any two of the 3D coordinate vectors of your position are not perpendicular to each other. @note - You need to call this API after joining the room. - Before calling this API, you should call enableSpatialAudio{@link #ISpatialAudio#enableSpatialAudio} first to enable the spatial audio function. - The settings made locally will not influence other users' spatial audio experience.

Implementation

Future<int?> updateSelfPosition(PositionInfo positionInfo) async {
  $a() => ($instance as $p_a.ISpatialAudio)
      .updateSelfPosition(unpackObject<$p_a.PositionInfo>(positionInfo));
  $i() => ($instance as $p_i.ByteRTCSpatialAudio).updateSelfPosition(
      unpackObject<$p_i.ByteRTCPositionInfo>(positionInfo));

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