Package de.coreengine.sound
Class AudioSource
- java.lang.Object
-
- de.coreengine.sound.AudioSource
-
public class AudioSource extends Object
Class that represents a audio source to play audio from- Author:
- Darius Dinger
-
-
Constructor Summary
Constructors Constructor Description AudioSource()
Create new audio source
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
pause()
Pause source from playing audiovoid
play()
Continue playing after pausevoid
play(String sound)
Setting sound for this source and playvoid
setLoop(boolean loop)
void
setPosition(float x, float y, float z)
Setting position of the source in the 3d worldvoid
setRelative(boolean rel)
void
setRolloff(float rolloff)
Setting rolloff factor for this source in the distance.void
setSound(String sound)
void
setVelocity(float x, float y, float z)
Setting direction and range of the source in the 3d world as 3d vectorvoid
setVolume(int vol)
void
stop()
Stop source from playing audio
-
-
-
Method Detail
-
play
public void play(String sound)
Setting sound for this source and play- Parameters:
sound
- Sound to play from source
-
setSound
public void setSound(String sound)
- Parameters:
sound
- Setting sound to play from this source
-
setVolume
public void setVolume(int vol)
- Parameters:
vol
- New volume of the source
-
stop
public void stop()
Stop source from playing audio
-
pause
public void pause()
Pause source from playing audio
-
play
public void play()
Continue playing after pause
-
setLoop
public void setLoop(boolean loop)
- Parameters:
loop
- Should source playing in loop?
-
setPosition
public void setPosition(float x, float y, float z)
Setting position of the source in the 3d world- Parameters:
x
- X Position of the sourcey
- Y Position of the sourcez
- Z Position of the source
-
setVelocity
public void setVelocity(float x, float y, float z)
Setting direction and range of the source in the 3d world as 3d vector- Parameters:
x
- X Direction of the sourcey
- Y Direction of the sourcez
- Z Direction of the source
-
setRolloff
public void setRolloff(float rolloff)
Setting rolloff factor for this source in the distance. Zero will b no rolloff.- Parameters:
rolloff
- New rolloff factor
-
setRelative
public void setRelative(boolean rel)
- Parameters:
rel
- Is the source relative?
-
-