Other than the usual
AudioInputStream stream = AudioSystem.getAudioInputStream(ClassLoader.getSystemClassLoader().getResource("____.wav")); DataLine.Info info = new DataLine.Info(Clip.class, stream.getFormat()); Clip clip = (Clip) AudioSystem.getLine(info); clip.open(stream); clip.start();
Since the buffer limit is 2mb for an UNCOMPRESSED wav file so... it's pretty obvious how crappy that is... and that's about all I found on the net since the rest that are floating around don't work anymore(such as using sun's audioplayer, which is now restricted). Any ideas or nudges in the right direction? I'm not making a media player, just playing the clip in the background so I would most likely run this on a separate thread. Any ideas what method would be best for that? especially if I might put a wait()/notify() for it to end the clip prematurely if needed. Thanks in advance!