Time lines Distortion Issue in MP3 Playback Using audio_waveforms on Android
When using audio_waveforms as an MP3 player on Android, the time line of audio files become distorted.
While the first use of seekTo works fine, subsequent attempts fail to start or stop playback at the correct position.
This issue doesn't appear to be a simple problem with seekTo but seems to involve the corruption of the media file's time lines.
Not all MP3 files exhibit this issue—some work fine, while others do not. WAV files do not appear to have this problem, and it seems that iOS is unaffected as well (though this is not confirmed).
If you provide an email address, I can send you a sample MP3 file that triggers the issue along with the code.
I kindly request your assistance in resolving this issue.
@Yang321423 Can you please add the file inside google drive and share the link here?
https://drive.google.com/file/d/1jRd9XKKleK9emtVIuLcijhsfSVO9td1C/view?usp=drive_link
I've created a simple test application to reproduce and investigate this issue.
The assert directory contains an MP3 file that exhibits the problem and its corresponding WAV conversion. You can specify a starting time (int startSecond) to play and compare both files for a 5-second duration from that point.
Initially, the playback ranges of both files align. However, over time, the MP3's playback range deviates from the actual position.
I'm confident that the WAV file is playing correctly and the MP3 file is the one with the issue because I'm using this package in conjunction with subtitles. Also, the subtitles were created based on the MP3 file. The WAV file plays back accurately synchronized with the subtitles, whereas the MP3 file does not.
Furthermore, this phenomenon only occurs on Android; MP3 playback is accurate on iOS. It's also worth noting that this issue doesn't affect all MP3 files, only a subset of them.