audio - Can't get music to play in java -


i'm trying background music play in text adventure making. however, cant sound class work.

import sun.audio.*;  import java.io.*;  public class sound {      public static void music()      {                audioplayer mgp = audioplayer.player;         audiostream bgm;         audiodata md;          continuousaudiodatastream loop = null;          try         {             inputstream test = new fileinputstream(new file "trainerredmusic.wav");             bgm = new audiostream(test);             audioplayer.player.start(bgm);          }         catch(filenotfoundexception e){             system.out.print(e.tostring());         }         catch(ioexception error)         {             system.out.print(error.tostring());         }         mgp.start(loop);     } } 

i have scoured internet looking simple guide, nothing works doing. trying run .wav file in background of text adventure. help?


Comments

Popular posts from this blog

My HTML document is not linking to my CSS stylesheet properly -

php array slice every 2th rule -

node.js - Sending sockets to client side, Error: Converting circular structure to JSON -