/**
 * Anima: A singular journey
 * CS470 Capstone Project
 * Shawn Aldridge
 */


package anima;


import java.io.*;
import sun.audio.*;
/**
 * Class originally retrieved from SourceForge by Kyle Aleshire, with much thanks from me.
 * @author kja
 */
public class Sound {

    AudioStream as;
    /**
     * @param args the command line arguments
     */

    public Sound()
    {
       
    }

    public void play(String filePath)
    {
        try{
            InputStream in = new FileInputStream(filePath);
            as = new AudioStream(in);
            //AudioPlayer.player.start(as);
        }
        catch(Exception e){
            e.printStackTrace();
        }
        AudioPlayer.player.start(as);

    }

    public void stop()
    {
        AudioPlayer.player.stop(as);
    }

}