[A]How to make a MP3 repeat in javafx? -


I want to repeat my MP3 file again and again. But I'm unable to make a loop to run my file over and over again (I use this code, but only after finishing it, only the first second of my file is played)

  Audio Clip My Mike ... setCycleCount (AudioClip.INDEFINITE); MyMusic.play (); Edit: I used the Media Player but this cycle counter does not work properly, for example, for the first time I played my MP3 file and played it 2 times and stopped for a second time to play for the third time suddenly I My app was played again and it played 1 times and it is my code in the second half of the second time of play:  
  url resource = getClass (). GetResource ("abcd.mp3"); Media Player A = New Media Player (New Media (Resources. Two String ()); A.setCycleCount (MediaPlayer.INDEFINITE); A game ();  

Any ideas? thank you in advanced.

I found the solution I used the setOnEndOfMedia method:

  url Resources = getClass () GetResource ("abcd.mp3"); Media Player A = New Media Player (New Media (Resources. Two String ()); A.setOnEndOfMedia (New Runnabal) (Public run zero () (a.seek (period.);}}); A game ();  

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -