I am looking for a solution to stop the player in his code.
It seems that there
please help me how to stop mp3 in jlayer
(no use of stop ()) .. < / P>
My code is as follows:
// main class mp3_main
Private Advanced Player Player; Public static zero main (string [] args) {string file = "c: \\ cd.mp3"; Mp3PlayerSample mp3 = new mp3PlayerSample (file); Mp3.play (); Mp3.stop (); } // class mp3player sample private string file name; Private BufferedInputStream buffer; Private Advanced Player Player; // Constructor public mp3 player player (string filename) {this.filename = filename; } // Start method public zero play () {FileInputStream fis; Try {Fis = new FileInputStream (this.filename); Buffer = new buffer input speed (FIS); {This.player = try new advanced player (buffer); Player.play (); } Hold (Jawalaar exception e) {e.printStackTrace (); }} Hold (FileNotFoundException e) {e.printStackTrace (); }} // stop method public zero-stop () (if (player! = Tap) {player.close ();}}
You need to run the player in your thread, just block the method after placing a play () until your main playback is complete.
Note , Class Player / Advance Player Jallier is included in the example code to show how decoding and decoding output wired audio Those who do not not fully develop players (e.g., are not even volume controls).
No comments:
Post a Comment