Game Development Reference
In-Depth Information
return;
if (mPlayer != null) {
mPlaying = true;
mPlayer.setVolume((float) Math.log10(vol)
, (float) Math.log(vol));
mPlayer.start();
}
}
public synchronized void stop() {
try {
mLoop = false;
if (mPlaying) {
mPlaying = false;
mPlayer.pause();
}
} catch (Exception e) {
System.err.println("AduioClip::stop " + name + " "
+ e.toString());
}
}
public synchronized void loop() {
mLoop = true;
mPlaying = true;
mPlayer.start();
}
public void release() {
if (mPlayer != null) {
mPlayer.release();
mPlayer = null;
}
}
public String getName() {
return name;
}
/**
* Set volume
* @param vol integer between 1-100
*/
public void setVolume(int vol) {
if (mPlayer != null) {
mPlayer.setVolume((float) Math.log10(vol)
, (float) Math.log10(vol));
}
}
}
Search WWH ::




Custom Search