Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package technodork.ponygladiators.audio;
- import java.io.FileInputStream;
- import java.io.IOException;
- import sun.audio.AudioPlayer;
- import sun.audio.AudioStream;
- import com.turt2live.ponies.engine.File;
- /**
- * Sound manager<br>
- * <i>Cleaned up by turt2live</i>
- *
- * @author technodork
- */
- public class SoundManager {
- private AudioStream as;
- /**
- * Creates a new sound manager
- *
- * @param f the audio file
- */
- public SoundManager(File f){
- try{
- as = new AudioStream(new FileInputStream(f));
- }catch(IOException e){
- e.printStackTrace();
- }
- }
- /**
- * Start the audio
- */
- public void play(){
- AudioPlayer.player.start(as);
- }
- /**
- *
- * Stops the audio
- */
- public void stop(){
- AudioPlayer.player.stop(as);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment