title: Specifying start/stop time in millisecs when playing MP3 using JLayer
body: <p>I need to play a part of an MP3 file in my java code. I wish to do this via a function which accepts the start and stop time in millisecs.</p>
  
  <p>JLayer contains a class called AdvancedPlayer which has a method that accepts the start and stop position in frames:</p>
  
  <pre><code>/**
   * Plays a range of MPEG audio frames
   * @param start The first frame to play
   * @param end       The last frame to play 
   * @return true if the last frame was played, or false if there are more frames.
   */
  public boolean play(final int start, final int end) throws JavaLayerException
  {
      boolean ret = true;
      int offset = start;
      while (offset-- &gt; 0 &amp;&amp; ret) ret = skipFrame();
      return play(end - start);
  }
  </code></pre>
  
  <p>According to <a href="http://www.mp3-converter.com/mp3codec/frames.htm" rel="nofollow noreferrer">this</a>, a frame lasts 26millisecs. However I need a finer degree of control than this, i.e. I may wish to play from 40millisecs to 50millisecs.</p>
  
  <p>How can I do this? Do I need to convert the MP3 to .wav first?</p>