Package toxi.audio

Class SoundListener

java.lang.Object
toxi.geom.Vec3D
toxi.audio.SoundListener
All Implemented Interfaces:
Comparable<ReadonlyVec3D>, ReadonlyVec3D

public class SoundListener extends Vec3D
The concept of a SoundListener refers directly to the user's instance in the virtual (audio) world. By setting the 3D position, velocity and orientation of the listener, the underlying audio hardware can produce a realistic 3D spatial sound simulation (incl. doppler effect, volume falloff etc.).

Like AudioSource, this class extends Vec3D and so if the position of the listener is changed via the public x,y,z vector components, the updatePosition() method needs to be called afterwards in order to reflect these changes in the OpenAL context.

  • Method Details

    • getOrientation

      public final float[] getOrientation()
    • getPosition

      public final float[] getPosition()
    • getVelocity

      public final float[] getVelocity()
    • setGain

      public SoundListener setGain(float gain)
    • setOrientation

      public SoundListener setOrientation(float upX, float upY, float upZ, float forwardX, float forwardY, float forwardZ)
    • setOrientation

      public SoundListener setOrientation(float[] o)
    • setPosition

      public SoundListener setPosition(float xx, float yy, float zz)
    • setPosition

      public SoundListener setPosition(float[] p)
    • setVelocity

      public SoundListener setVelocity(float xx, float yy, float zz)
    • setVelocity

      public SoundListener setVelocity(float[] v)
    • updatePosition

      public SoundListener updatePosition()