Search code examples
javajmf

Java JMF mp3 streaming buffer size


I have this problem I've been trying to solve the whole day. I'm streaming a mp3 filestream over internet with JMF player. Everything works (finally) except that I believe there's some kind of buffer size set to 1min by default. It takes exactly 1minute each time for the stream to start playing. I can't find any way to reduce the buffer size. Is there? A minute is a pretty long time to wait each time I change the channel..

player = Manager.createPlayer(new MediaLocator(RadioChannelURL));
player.start();

Solution

  • There is a way to completely disable buffering (or caching) :

    Manager.setHint(Manager.CACHING, new Boolean(false));    // Disable caching
    player = Manager.createPlayer(new MediaLocator(RadioChannelURL));
    player.start();