I use Delphi 10.4 CE for creating the simplest audiobook reader. I have a mp3 audiobook file. In my application I want FMX.Media.TMediaPlayer to play a separate sentence, for example from 6.7 sec to 8.6 sec of the track. I set MediaPlayer.CurrentTime (recalced to 100-nanoseconds), run MediaPlayer.Play and stop it via Timer then MediaPlayer.CurrentTime reaches the end time required.
The problem is, to hear the same sentence from the same file, for unknown reason I have to set different times for start and end playing on Windows and on Android. For example, the same sentence plays from 6.7 sec to 8.6 sec on Windows, but from 5.5 sec to 7.3 sec on Android.
The difference of these times between the platforms is not constant. Also it is not linear. On the contrary, it seems to periodically lag and then overtake during some periods. For example, on Android several sentences lag from Windows during the first 15 seconds. Then the sentence from 15 to 21 sec sounds exactly equally - has the same time and end times in both platforms. Then several next sentences lag again during next 60 seconds, and the sentence from 55 to 61 sec has the same time and end times in both platforms again, and so on.
I think the reason is different MP3 codecs on the different platforms? If so, how can I deploy and use some codec with my application, to use the same time marking for the file on Windows and Android?
UPD. The problem appears very strikingly on the one file. It appears less strikingly on some other file. Also I have some files where the problem is absent at all. All the files have a Constant Bit rate 128 kb/s. I can't understand any key difference as a reason for the problem.
UPD2. This is a really MP3 file, this is output from MediaInfo. Draw attention, the Bit rate mode is Constant.
Audio
Format : MPEG Audio
Format version : Version 1
Format profile : Layer 3
Format settings : Joint stereo / MS Stereo
Duration : 12 min 57 s
Bit rate mode : Constant
Bit rate : 128 kb/s
Channel(s) : 2 channels
Sampling rate : 44.1 kHz
Frame rate : 38.281 FPS (1152 SPF)
Compression mode : Lossy
Stream size : 11.9 MiB (100%)
Writing library : LAME3.99.5ªªªªªª