Class SpatialAudioZone

java.lang.Object
io.agora.spatialaudio.SpatialAudioZone

public class SpatialAudioZone extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    float
    The sound attenuation coefficient when users within the sound insulation area communicate with external users.
    float[]
    Starting at `position`, the forward unit vector.
    float
    The entire sound insulation area is regarded as a cube; this represents the length of the forward side in the unit length of the game engine.
    float[]
    The spatial center point of the sound insulation area.
    float[]
    Starting at `position`, the right unit vector.
    float
    The entire sound insulation area is regarded as a cube; this represents the length of the right side in the unit length of the game engine.
    float[]
    Starting at `position`, the up unit vector.
    float
    The entire sound insulation area is regarded as a cube; this represents the length of the up side in the unit length of the game engine.
    int
    The ID of the sound insulation area.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    float
     
    float[]
     
    float
     
    float[]
     
    float[]
     
    float
     
    float[]
     
    float
     
    int
     

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • zoneSetId

      public int zoneSetId
      The ID of the sound insulation area.
    • position

      public float[] position
      The spatial center point of the sound insulation area. This parameter is an array of length 3, and the three values represent the front, right, and top coordinates in turn.
    • forward

      public float[] forward
      Starting at `position`, the forward unit vector. This parameter is an array of length 3, and the three values represent the front, right, and top coordinates in turn.
    • up

      public float[] up
      Starting at `position`, the up unit vector. This parameter is an array of length 3, and the three values represent the front, right, and top coordinates in turn.
    • forwardLength

      public float forwardLength
      The entire sound insulation area is regarded as a cube; this represents the length of the forward side in the unit length of the game engine.
    • rightLength

      public float rightLength
      The entire sound insulation area is regarded as a cube; this represents the length of the right side in the unit length of the game engine.
    • upLength

      public float upLength
      The entire sound insulation area is regarded as a cube; this represents the length of the up side in the unit length of the game engine.
    • audioAttenuation

      public float audioAttenuation
      The sound attenuation coefficient when users within the sound insulation area communicate with external users. 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 `audioAttenuation` parameter. - (0.5,1]: Strong attenuation mode (default value is 1), that is, the volume and timbre attenuate rapidly during propagation.
  • Constructor Details

    • SpatialAudioZone

      public SpatialAudioZone()
  • Method Details

    • getPosition

      public float[] getPosition()
    • getForward

      public float[] getForward()
    • getRight

      public float[] getRight()
    • getUp

      public float[] getUp()
    • getZoneSetId

      public int getZoneSetId()
    • getForwardLength

      public float getForwardLength()
    • getRightLength

      public float getRightLength()
    • getUpLength

      public float getUpLength()
    • getAudioAttenuation

      public float getAudioAttenuation()