Poor quality mp3 files do not play as expected

I have been using a media player for the last 2 months with normal mp3 files. A few days ago, my client gave me 16 Kbps low quality converted files. When I played these files using the Media Player class. The behavior I observed is listed below:

  • (1) mediaPlayer.getDuration()gives an extra duration.
    For example: if it is 46 seconds, then the duration returns as 86 seconds.
  • (2) mediaPlayer.seekTo(positionToNavigate)does not work properly, and the position of the sound is completely different from the original.

I tried many times to fix many things with different codes, but these two problems still exist. When I play an MP3 file without conversion, for example, the normal quality is 128 kbps, the sound also seekToworks fine.

I want to mention that you need to use low quality MP3s, as it is small in size and can be downloaded quickly from the server.

If the problem is encoding / compression, is there any other way to compress MP3s with 16 Kbps?

+4
source share

Source: https://habr.com/ru/post/1673297/


All Articles