title: pausing mp3 in java
body: <p>I'm currently working on a project in which i need to play a background mp3 sound. I managed to do that using the Jlayer library and a piece of code found <a href="http://introcs.cs.princeton.edu/faq/mp3/mp3.html" rel="nofollow">here</a></p>
  
  <p>However, I needed to add some more features to this code, such as loop playing and pause.<br>
  The loop function was fairly easy to implement, but i've spent hours looking for a way to pause and resume mp3 files.</p>
  
  <p>My guess would have been to use the play(int frames) method in the Player class, using the getPosition() method and the mp3 total frame number, but i can't manage to get the total frame number.</p>
  
  <p>Any clue ? I just need this pause/resume method, so if you know one way different from this, feel free to post</p>
  
  <p>i've also been trying some stuff with the BasicPlayer library (link <a href="http://www.javazoom.net/jlgui/sources.html" rel="nofollow">here</a>), but i always end up getting javax.sound.sampled.UnsupportedAudioFileException when trying to read any mp3 file</p>