Comments (26)
There are plans yes, I just need to find the time to do it.
Your player looks good!
On Fri, Jan 17, 2014 at 3:44 AM, Benjamin Kaiser [email protected]
wrote:
It is not necessarily included in the ID3 tags, but having the duration of a song would be really useful. Are there any plans to add duration detection? (my music player is coming along nicely and I would like to display a duration attribute on the list)
Reply to this email directly or view it on GitHub:
#40
from musicmetadata.
Okay awesome, thanks for letting me know.
BTW here is a link to the repo to my music player in case you want to check it out or list it as something using musicmetadata. https://github.com/benkaiser/node-music-player
from musicmetadata.
Version 0.3.0 now reads duration for mp3, ogg and mp4 files. Other containers coming soon.
from musicmetadata.
Thanks a bunch @leetreveil ! You're a legened!
I updated my npm repos and made some changes as well as filtering for displaying and I am noticing that a large, maybe 50% number of songs have 0 as their duration (despite being mp3, my entire library is mp3, also my library is not all legit and so quality isn't assured I guess). I can give you any samples if you want. Are you just fetching the TLE/TLEN
tag for the duration? If so, maybe I should just fix up the data in my library by scanning them all for actual length and applying it to their TLE/TLEN
tags.
BTW here is a screenshot of my library with duration's in action (right-most column):
from musicmetadata.
I have found another node.js library called taglib that does similar things to musicmetadata (but does not do cover art) but does do durations on tracks (not just pulled from id3, I was able to pull the length of a song I wasn't able to pull with your implementation). Let me know how you go with this bug, or if I should just try some alternative way.
Thanks once again for your awesome help @leetreveil !
from musicmetadata.
Would be great if you could send me a couple of those tracks.
from musicmetadata.
Here is a link to a couple of tracks that returned 0: https://copy.com/uSPc1z2XUCJH
from musicmetadata.
Also seeing a few mp3's with a duration of zero. Also, calculating the duration seems to be very time prohibitive.
from musicmetadata.
I am wondering is there a reason taglib can do it so fast? Is it because it is simply bindings for a C library? Maybe if it is too time-intensive it could be an optional parameter.
from musicmetadata.
It's sorta a pain that it is that slow, I was able to scan my library (1045 songs) in less then a minute, now I have to wait about an hour D:
from musicmetadata.
@Eaterofcode @leetreveil hmm if it is very time prohibitive then maybe you could just add taglib as a dependency and using that if the duration option is flagged. Because from my benchmarks it was incredibly fast, here is the testing repo if you want to run them yourself. Let me know what your thoughts are on this @leetreveil
from musicmetadata.
the point is I don't want taglib, I want mm. Im gonna try to optimize this
from musicmetadata.
@Eaterofcode okay give it a shot, @leetreveil might accept a pull-request speeding it up. But I think taglib seemed to do it the best. Taglib just didn't offer cover art so it was a no-go for me :) However it did have writing metadata... @leetreveil nudge nudge, editing...
from musicmetadata.
Wow the duration calculation slows it down. Thanks for implementing it @leetreveil but it is pretty unusable with the speed costs.
Might try use taglib for durations so that it keeps it's high speed. Any update on working something out @Eaterofcode ?
from musicmetadata.
Im sorry I dont have any update. :( Im not too familiar with the code and things used. Im just living without duration now.
from musicmetadata.
Okay fair enough. In the mean time I will pass off duration fetching to taglib (it is so fast there isn't much overhead at all using it and musicmetadata simultaneously). Will update here if I run into any issues.
from musicmetadata.
I have implemented taglib for duration fetching after musicmetadata gathers all the other attributes and damn is it fast. Here is my commit updating my code to use taglib for durations.
from musicmetadata.
Okay, I dont know the code for this (if I knew I would do it) my idea is the following:
Check for TLE/TLEN
tags if so return duration from that, end stream.
if thats not present check if it is VBR or CBR if CBR use the formula to calculate it, if it's VBR use the slow streaming method.
this should be a solid fix for now since most people have CBR mp3 files
from musicmetadata.
Parsing CBR files should be much faster now. ⚡
from musicmetadata.
Just did a quick look and it appears most (~95%) of my songs are VBR. Will switch back to testing durations with musicmetadata and report my findings.
Thanks for the research @Eaterofcode and thanks for the fast implementation @leetreveil!
from musicmetadata.
I just did a test. Although it is much faster, scanning of CBR files in musicmetadata than it was before, it is still maybe 10-30x slower than it is with taglib. As such because I am opting for user experience I will still use taglib for duration reading. Thanks anyway for implementing it @leetreveil
from musicmetadata.
I don't think this fixes it? just a quick fix for most files. the real problem is still there
from musicmetadata.
@Eaterofcode yes of course. But even for the 'most files' it is slower than using taglib.
from musicmetadata.
Yeah but I meant that this issue shouldn't be closed because its still slow for VBR. and the TLE/TLEN
check isnt their either
from musicmetadata.
and btw it will probably be slower then taglib because taglib is C++ afaik
from musicmetadata.
@Eaterofcode imho it should be marked as closed. @leetreveil has done a lot of work to fix this. and with CBR working moderately fast it should be okay.
You are right that taglib is C++, but that is the reason why this project won't match taglibs speed. So as far as I am concerned @leetreveil has done an excellent job and the issue should be marked as closed.
from musicmetadata.
Related Issues (20)
- 'Could not find metadata header' with some mp3s HOT 5
- No metadata in file that has metadata HOT 2
- Webpack, fs and HTML 5 File object HOT 1
- Misleading examples: the Readable Stream should be closed HOT 3
- error when extract image HOT 3
- Error: expected frame header but was not found. FLAC files parsed with id3v2 parser? HOT 2
- Dump complete metadata? HOT 1
- Rating tag support HOT 3
- Chapter Addendum? HOT 1
- Warning: Possible EventEmitter memory leak detected. HOT 1
- [Question] Is there a way to not parse / load the picture buffer HOT 3
- Chrome freezes/locks up while loading FLAC metadata from arraybuffer HOT 2
- Completion callback invoked twice HOT 1
- Callback is never called HOT 4
- Webpack with electron-renderer target imports non-browser-wrapped version
- using file upload control HOT 1
- Doesn't support OGG. HOT 2
- Do not provide duration of audio HOT 4
- File's picture
- Metadata output doesn't include composer tag
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from musicmetadata.