Class AudioSource

java.lang.Object
rosequartz.afx.AudioSource

public final class AudioSource extends Object
Represents an audio-source. This is something in your game that plays sound.
  • Constructor Details

    • AudioSource

      public AudioSource()
      Creates an AudioSource.
  • Method Details

    • play

      public AudioSource play(Audio audio)
      Plays an Audio.
      Parameters:
      audio - the audio to play
      Returns:
      this
    • stop

      public AudioSource stop()
      Stops playback.
      Returns:
      this
    • repeat

      public AudioSource repeat(boolean repeat)
      Sets the AudioSource to repeat its audio.
      Parameters:
      repeat - repeat Audio
      Returns:
      this
    • isPlaying

      public boolean isPlaying()
      Gets if the AudioSource is playing any audio.
      Returns:
      AudioSource playing something
    • setPosition

      public AudioSource setPosition(float x, float y, float z)
      Sets the position of the AudioSource.
      Parameters:
      x - new position on the x-axis
      y - new position on the y-axis
      z - new position on the z-axis
      Returns:
      this
    • setPosition

      public AudioSource setPosition(Vec3 xyz)
      Sets the position of the AudioSource.
      Parameters:
      xyz - new position
      Returns:
      this
    • setVelocity

      public AudioSource setVelocity(float x, float y, float z)
      Sets the velocity of the AudioSource. Note that velocity may not be implemented by every build target.
      Parameters:
      x - new velocity on the x-axis
      y - new velocity on the y-axis
      z - new velocity on the z-axis
      Returns:
      this
    • setVelocity

      public AudioSource setVelocity(Vec3 xyz)
      Sets the velocity of the AudioSource. Note that velocity may not be implemented by every build target.
      Parameters:
      xyz - new velocity
      Returns:
      this
    • setVolume

      public AudioSource setVolume(float volume)
      Sets the volume of the AudioSource.
      Parameters:
      volume - new volume
      Returns:
      this
    • setPitch

      public AudioSource setPitch(float pitch)
      Sets the pitch of the AudioSource.
      Parameters:
      pitch - new pitch
      Returns:
      this
    • toString

      public String toString()
      Overrides:
      toString in class Object