Game Development Reference
In-Depth Information
}
catch
(Exception e){}
}
//Resumes the stream specified by the streamID
//Parameters:
// sound - the streamID to be resumed
public void
resumeSound(
int
sound){
soundPool.resume(soundMap.get(sound));
}
//Stops the stream specified by the streamID
//Parameters:
// sound - the streamID to be stopped
public void
stopSound(
int
sound){
soundPool.stop(soundMap.get(sound));
}
//Stops all streams and release the soundPool
public void
stopAllSound(){
try
{
stopMedia();
if
(soundPool !=
null
) {
soundPool.release();
soundPool =
null
;
}
}
catch
(Exception e){}
}
When the player exits the game, make sure the game logic will call
release()
method to re-
lease all the native resources in use and then set the SoundPool reference to null.
Search WWH ::
Custom Search