Reputation: 557
I have webisite with a lot of mp3 link , i wants show each mp3 link duration and bitrate. after some research i found this libraries : Taglib , MusicMetadata , id3js
but its seems to be these libraries only work with local files. i just want know there is any way to do this without downloading files?
Upvotes: 3
Views: 2615
Reputation: 6384
Unfortunately, Node can't do that itself (with fs
or similar). At some point, it will require some OS-dependant binary tools to get information like duration or bitrate.
I would go with mp3info npm package which embed the mp3info tool for linux.
Also, one should avoid to calculate the duration with the size and the bitrate as the bitrate can be constant or variable ie non predictable.
Upvotes: 1