HI
I am trying to play an audio file in my Java application:
here is the code:
public static void music()
{
AudioPlayer MGP = AudioPlayer.player;
AudioStream BGM;
AudioData MD;
ContinuousAudioDataStream loop = null;
try
{
BGM = new AudioStream(new FileInputStream("\\BattleShip\\battle.wav"));
MD = BGM.getData();
loop = new ContinuousAudioDataStream(MD);
}
catch(FileNotFoundException e){
System.out.print(e.toString());
}
catch(IOException error)
{
System.out.print(error.toString());
}
MGP.start(loop);
}
I have no idea what this exception means or if it is even finding the wav file im trying to play
java.io.IOException: could not create AudioData object
thanks