Slow seeking with large MP3 files #900
NworbLegin
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi miniaudio users,
I'm currently coding playback of mp3 files for a cross-platform app (windows, iOS, Android) and I was hitting some really large delays seeking to a playback point. Our audiobook mp3 files are >45 mins, and the seek times in debug builds were really slowing down our development. (Seek times in a release build were also a little slow too - expecially on lower-end mobile devices).
It looks like this slowdown is caused by miniaudio attempting to seek through the mp3 file dynamically at run-time in a fairly inefficient fall-back process.
One thing that doesn't seem to be documented that seems to help with this is to specify a value for the
ma_decoder_config
that is passed intoma_decoder_init_file
.As far as I can tell this will create the specified number of seek points when the file is initialised. These seek points are then used as pre-generated indexes to speed up the seeking at run-time.
Maybe this should be documented somewhere. (Or maybe it is and I've missed it!)
I hope this helps someone.
Cheers
Nigella
Beta Was this translation helpful? Give feedback.
All reactions