Why are you using mp3s?
Personally, rather than compressing my music, I just convert it to mono, 16-bit wav files. These are usually small enough, and getting them to loop properly is easy as pie (when you get to the end of the buffer, start reading from the front ... basically).
I don't know anything about compressed formats, but in a wav file, it's incredibly easy to spot true silence (no sound in the file whatsoever). I think that true silence will be a value of 0x00000000 in uncompressed formats. Either that, or the file will contain a chunk called the Silent Chunk, which may have another value, but it will be garbage:
Silent Chunk - "slnt"A silent chunk is used to specify a segment of silence that will last some duration of samples. It is always contained within a wave list chunk. While this chunk represents silence, it does not necessarily define a zero volume or baseline sample. It actually holds the last sample value present in the preceding data chunk in the wave list chunk. If there is no preceding data chunk in the wave list chunk, a baseline value should be used (127 for 8-bit data, 0 for 16-bit or higher data). This may seem trivial, but if not followed, may cause undesired clicks and pops in the audio signal.
More here:
http://www.sonicspot.com/guide/wavefiles.htmlLike I said though, I only ever work with wav files, so none of this may apply to mp3s. If you guys want some wav-playing source in .Net, java or C, send me a PM, and I will shoot you what I have.