hyperamp icon indicating copy to clipboard operation
hyperamp copied to clipboard

Slow metadata parsing on some files

Open bcomnes opened this issue 8 years ago • 5 comments

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.

bcomnes avatar Nov 09 '17 06:11 bcomnes

Maybe use https://github.com/mycoboco/mp3-duration/commit/abdb1bca7d9739dbff1b99479b84c811d2bc6f12

see https://github.com/Borewit/music-metadata/issues/35

bcomnes avatar Nov 12 '17 08:11 bcomnes

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.

bcomnes avatar Nov 14 '17 17:11 bcomnes

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

bcomnes avatar Dec 04 '17 01:12 bcomnes

Which files?

kareniel avatar Mar 12 '18 02:03 kareniel

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.

bcomnes avatar Mar 22 '18 21:03 bcomnes