|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.hermit.android.sound.Player
public class Player
Main sound effects player class.
Constructor Summary | |
---|---|
Player(Context context)
Create a sound effect player that can handle 3 streams at once. |
|
Player(Context context,
int streams)
Create a sound effect player. |
Method Summary | |
---|---|
Effect |
addEffect(int sound)
Add a sound effect to this player. |
Effect |
addEffect(int sound,
float vol)
Add a sound effect to this player. |
int |
play(Effect effect)
Play the given sound effect. |
int |
play(Effect effect,
float rvol,
boolean loop)
Play the given sound effect. |
void |
setGain(float gain)
Set the overall gain for sounds. |
void |
stop(int id)
Stop the given stream. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Player(Context context)
context
- Application context we're running in.public Player(Context context, int streams)
context
- Application context we're running in.streams
- Maximum number of sound streams to play
simultaneously.Method Detail |
---|
public Effect addEffect(int sound)
sound
- Resource ID of the sound sample for this effect.
public Effect addEffect(int sound, float vol)
sound
- Resource ID of the sound sample for this effect.vol
- Base volume for this effect.
public void setGain(float gain)
gain
- Desired gain. 1 = normal; 0 means don't play
sounds.public int play(Effect effect)
effect
- Sound effect to play.
public int play(Effect effect, float rvol, boolean loop)
effect
- Sound effect to play.rvol
- Relative volume for this sound, 0 - 1.loop
- If true, loop the sound forever.
public void stop(int id)
id
- Stream ID to stop.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |