hyperamp
hyperamp copied to clipboard
Slow metadata parsing on some files
Some mp3 files parse very slowly with the new metadata parser lib.
- [x] Collect some samples of files that do this.
- [ ] Try to find a cheap work around
- [x] Open issue upstream asking for advice https://github.com/Borewit/music-metadata/issues/45
- [ ] Try to fix or receive a fix.
Maybe use https://github.com/mycoboco/mp3-duration/commit/abdb1bca7d9739dbff1b99479b84c811d2bc6f12
see https://github.com/Borewit/music-metadata/issues/35
What we can do is skip these tracks by setting duration: false and then kick off a background task when its needed. Or we can maybe fill the gap with mycoboco/mp3-duration@abdb1bc depending on how well it works.
Another work around is getting the duration from the electron audio element as well. Will build this feature into https://github.com/hypermodules/hyperamp/issues/244
Which files?
It also occured to me that https://github.com/almost/through2-concurrent + timeouts could easily solve this problem as is. Also https://github.com/brycebaril/through2-reduce pipe https://github.com/maxogden/concat-stream would simlpify my garbage code.
We should still supplement our audio objects with the correct times and not rely on id3 tags, which will require the audio thread to send metadata updates to the main thread as well.