using the same open source project (nagare). Tried creating a second mediaplayer to start before I stopped the original mediaplayer and still a gap. Albeit a wee bit smaller but still noticable gap
Finally got Nagare working better. I set up the buffer() to use 2 mediaplayers and I used the ShoutcastFile to check how much of the mp3 was left
Using java Syntax Highlighting
NagareService.m_media_player.getDuration() - NagareService.m_media_player.getCurrentPosition() <= 1000
Parsed in 0.127 seconds, using GeSHi
if that rang true it called NagareService.m_run_buffer.run();
then in buffer I used 2 mediaplayers to hand off to each other and the one ending would wait 525ms java.lang.Object.class.wait(525);
before stopping the mediaplayer.
Very crude way of knocking it out but i couldnt figure out a different way
and this way streaming mp3's are now gapless for my purpose.
The gap between players increases the longer the media plays using this method because it takes longer and longer for the mediaplayers to seekTo the current location. One way around this would be to create two files for buffering and hand off back and forth, keeping both files under 250kb should keep the gap pretty small and predictable. Or everytime it conducts a handoff it could start the new mediaplayer with the new file and start from the beginning. Some data may be lost using this method.
I'm just brainstorming.