How does one calculate the amount of bytes to skip with the InputStream.skip() method if you want to start the InputStream of a .mp3 file at a certain position in time?
I have access to the following data: The point that you want to start at in seconds
- The mp3's sample rate
- The mp3's sample size
- The mp3's framerate
- The mp3's framesize
I have tried searching for a formula/algorithm that describes how to calculate it but I could not find it. Do any of you know how to do this?
-Edit
I tried doing framesize * framerate * position(seconds) but that was off by a factor 10. Dividing it by 10 still had it off by 3 seconds when skipped to 50 seconds in the song, even more when skipping larger chunks.