title: [A]How to make a MP3 repeat in javafx?
body: <p>i want my mp3 file repeat again after it finished . but i'm unable to create a loop to play my file repeatedly
  (i used this code but only it plays first second of my file after it finished)</p>
  
  <pre><code>AudioClip myMusic ....   
  myMusic.setCycleCount(AudioClip.INDEFINITE);
  myMusic.play();
  </code></pre>
  
  <p>Edited :
  i used MediaPlayer but it's cycle counter didn't work correctly for example first time i played my mp3 file it played 2 times and in 3rd time of playing suddenly it stops
  second time i ran again my app and it played 1 time and in half of second time of playing it stops
  here is my code :</p>
  
  <pre><code>URL resource = getClass().getResource("abcd.mp3");
       MediaPlayer a =new MediaPlayer(new Media(resource.toString()));
       a.setCycleCount(MediaPlayer.INDEFINITE);
  
   a.play();
  </code></pre>
  
  <p>any ideas?thanks in advance .</p>