|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.newdawn.slick.Sound
public class Sound
A single sound effect loaded from either OGG or XM/MOD file. Sounds are allocated to channels dynamically - if not channel is available the sound will not play.
| Constructor Summary | |
|---|---|
Sound(java.io.InputStream in,
java.lang.String ref)
Create a new Sound |
|
Sound(java.lang.String ref)
Create a new Sound |
|
Sound(java.net.URL url)
Create a new Sound |
|
| Method Summary | |
|---|---|
void |
loop()
Loop this sound effect at default volume and pitch |
void |
loop(float pitch,
float volume)
Loop this sound effect at a given volume and pitch |
void |
play()
Play this sound effect at default volume and pitch |
void |
play(float pitch,
float volume)
Play this sound effect at a given volume and pitch |
void |
playAt(float x,
float y,
float z)
Play a sound effect from a particular location |
void |
playAt(float pitch,
float volume,
float x,
float y,
float z)
Play a sound effect from a particular location |
boolean |
playing()
Check if the sound is currently playing |
void |
stop()
Stop the sound being played |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Sound(java.io.InputStream in,
java.lang.String ref)
throws SlickException
in - The location of the OGG or MOD/XM to loadref - The name to associate this stream
SlickException - Indicates a failure to load the sound effect
public Sound(java.net.URL url)
throws SlickException
url - The location of the OGG or MOD/XM to load
SlickException - Indicates a failure to load the sound effect
public Sound(java.lang.String ref)
throws SlickException
ref - The location of the OGG or MOD/XM to load
SlickException - Indicates a failure to load the sound effect| Method Detail |
|---|
public void play()
public void play(float pitch,
float volume)
pitch - The pitch to play the sound effect atvolume - The volumen to play the sound effect at
public void playAt(float x,
float y,
float z)
x - The x position of the source of the effecty - The y position of the source of the effectz - The z position of the source of the effect
public void playAt(float pitch,
float volume,
float x,
float y,
float z)
pitch - The pitch to play the sound effect atvolume - The volumen to play the sound effect atx - The x position of the source of the effecty - The y position of the source of the effectz - The z position of the source of the effectpublic void loop()
public void loop(float pitch,
float volume)
pitch - The pitch to play the sound effect atvolume - The volumen to play the sound effect atpublic boolean playing()
public void stop()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||