Menu

Buffer Size

Help
burakk
2014-02-15
2014-02-16
  • burakk

    burakk - 2014-02-15

    Hi,

    I tried your media player on my Note 3 (Android version 4.3) and still getting the same behavior, playing the music for about one second, then waiting up to 7*8 seconds and resuming... This is the same behavior as the normal MediaPlayer implementation. How can I fix it, by modifying the buffer size?

    In your DownloadPlayer.java file, you are setting

    byte[] buffer = new byte[1024 * 16];

    in DownloadTask. Isn't 16 KB's a bit low? Might the problem related to that?

    Thanks

     
  • William Seemann

    William Seemann - 2014-02-16

    Hello, the download player is being phased out. The code (and buffer) buffer size you should be interested in src/net/sourceforge/servestream/media/FFmpegMediaPlayer.java:

    int minBufferSize = AudioTrack.getMinBufferSize(sampleRateInHz, channelConfig, AudioFormat.ENCODING_PCM_16BIT) * 4;
    
     

    Last edit: William Seemann 2014-02-16

Log in to post a comment.