Package rosequartz.afx
Class AudioSource
java.lang.Object
rosequartz.afx.AudioSource
Represents an audio-source.
This is something in your game that plays sound.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanGets if the AudioSource is playing any audio.Plays an Audio.repeat(boolean repeat)Sets the AudioSource to repeat its audio.setPitch(float pitch)Sets the pitch of the AudioSource.setPosition(float x, float y, float z)Sets the position of the AudioSource.setPosition(Vec3 xyz)Sets the position of the AudioSource.setVelocity(float x, float y, float z)Sets the velocity of the AudioSource.setVelocity(Vec3 xyz)Sets the velocity of the AudioSource.setVolume(float volume)Sets the volume of the AudioSource.stop()Stops playback.toString()
-
Constructor Details
-
AudioSource
public AudioSource()Creates an AudioSource.
-
-
Method Details
-
play
Plays an Audio.- Parameters:
audio- the audio to play- Returns:
- this
-
stop
Stops playback.- Returns:
- this
-
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
Sets the position of the AudioSource.- Parameters:
x- new position on the x-axisy- new position on the y-axisz- new position on the z-axis- Returns:
- this
-
setPosition
Sets the position of the AudioSource.- Parameters:
xyz- new position- Returns:
- this
-
setVelocity
Sets the velocity of the AudioSource. Note that velocity may not be implemented by every build target.- Parameters:
x- new velocity on the x-axisy- new velocity on the y-axisz- new velocity on the z-axis- Returns:
- this
-
setVelocity
Sets the velocity of the AudioSource. Note that velocity may not be implemented by every build target.- Parameters:
xyz- new velocity- Returns:
- this
-
setVolume
Sets the volume of the AudioSource.- Parameters:
volume- new volume- Returns:
- this
-
setPitch
Sets the pitch of the AudioSource.- Parameters:
pitch- new pitch- Returns:
- this
-
toString
-