Class ILocalSpatialAudioEngine

java.lang.Object
io.agora.spatialaudio.IBaseSpatialAudioEngine
io.agora.spatialaudio.ILocalSpatialAudioEngine

public abstract class ILocalSpatialAudioEngine extends IBaseSpatialAudioEngine
  • Constructor Details

    • ILocalSpatialAudioEngine

      public ILocalSpatialAudioEngine()
  • Method Details

    • create

      public static ILocalSpatialAudioEngine create()
      Returns:
      `ILocalSpatialAudioEngine`
    • destroy

      public static void destroy()
    • initialize

      public abstract int initialize(LocalSpatialAudioConfig config)
      Parameters:
      config - The configuration of `ILocalSpatialAudioEngine`. See `LocalSpatialAudioConfig`.
      Returns:
      - 0: Success. - < 0: Failure.
    • updateRemotePosition

      public abstract int updateRemotePosition(int uid, RemoteVoicePositionInfo posInfo)
      Parameters:
      uid - The user ID. This parameter must be the same as the user ID passed in when the user joined the channel.
      posInfo - The spatial position of the remote user. See `RemoteVoicePositionInfo`.
      Returns:
      - 0: Success. - < 0: Failure.
    • updateRemotePositionEx

      public abstract int updateRemotePositionEx(int uid, RemoteVoicePositionInfo posInfo, RtcConnection connection)
    • removeRemotePosition

      public abstract int removeRemotePosition(int uid)
      Parameters:
      uid - The user ID. This parameter must be the same as the user ID passed in when the user joined the channel.
      Returns:
      - 0: Success. - < 0: Failure.
    • removeRemotePositionEx

      public abstract int removeRemotePositionEx(int uid, RtcConnection connection)
    • clearRemotePositionsEx

      public abstract int clearRemotePositionsEx(RtcConnection connection)
    • setRemoteAudioAttenuation

      public abstract int setRemoteAudioAttenuation(int uid, double attenuation, boolean forceSet)
      Parameters:
      uid - The user ID. This parameter must be the same as the user ID passed in when the user joined the channel.
      attenuation - For the user's sound attenuation coefficient, the value range is [0,1]. The values are as follows: - 0: Broadcast mode, where the volume and timbre are not attenuated with distance, and the volume and timbre heard by local users do not change regardless of distance. - (0,0.5): Weak attenuation mode, that is, the volume and timbre are only weakly attenuated during the propagation process, and the sound can travel farther than the real environment. - 0.5: (Default) simulates the attenuation of the volume in the real environment; the effect is equivalent to not setting the `speaker_attenuation` parameter. - (0.5,1]: Strong attenuation mode, that is, the volume and timbre attenuate rapidly during the propagation process.
      forceSet - Whether to force the user's sound attenuation effect: - `true`: Force `attenuation` to set the sound attenuation of the user. At this time, the `attenuation` coefficient of the sound insulation area set in the `audioAttenuation` of the `SpatialAudioZone` does not take effect for the user. - `false`: Do not force `attenuation` to set the user's sound attenuation effect, as shown in the following two cases. - If the sound source and listener are inside and outside the sound isolation area, the sound attenuation effect is determined by the `audioAttenuation` in `SpatialAudioZone`. - If the sound source and the listener are in the same sound insulation area or outside the same sound insulation area, the sound attenuation effect is determined by `attenuation` in this method.
      Returns:
      - 0: Success. - < 0: Failure.