ya I just figured out a bit how it works:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
| import javazoom.jl.player.Player; import java.io.*;
public class jo { public static void main(String blah[]) { InputStream s1 = null; Player myplayer = null; boolean succ = false; try { s1 = new FileInputStream( "fight.mp3" ); myplayer = new Player(s1); } catch(Exception l){System.out.println("f**kError : "+l.getMessage());} if (myplayer != null && s1 != null) { System.out.println("Playing fight.mp3 \nCrtl + C to abort"); try{ myplayer.play(); succ = true; } catch(Exception j){System.out.println("Couldn't play because: "+j.getMessage());} } while(succ) { } } } |
But whats with :
1
| player = new Player((sfxIsRsrc)?getClass().getResourceAsStream(filename):new BufferedInputStream(new FileInputStream(filename))); |
I did it easier, whats the point ?

And well I tried out AudioClip a while ago, when I started Java... don't like them

And I can also write a loop function somehow...