New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mp3 tags and info #114
Comments
PAEz is godsend on this project. Somebody give this (wo?)man a cookie! |
hahaha...me like cookies! Just be glad its a great project with an awesome lead or I would have left ages ago. :P |
I think he's an awesome lead too. Three cheers for great leadership. Humble, focused and driven. Cookies for everyone! |
@PAEz You are not spoiling anything. I'm actually learning more, because your research and experience are bringing things to my attention that I hadn't know about before. Thank you. @Akamaozu Get to work on that first PR ;) (and thanks for the 🍪) @PAEz I didn't get a chance to dig into your header reading code. I noticed that it was giving different numbers than OS X in a few cases, and was waiting until I could get a third opinion (hopefully Winamp) to be the tie breaker. Let me know when you have an update and I'll look again. Picking an id3 readerThis is defiantly a task for a library, the question is which one. Browsers can play audio from many different types of media. I think of Winamp as an mp3 player, but it really plays all kinds of media. Ideally we would use a library that supports reading metadata from different types of media files and gives us a common interface. So far https://github.com/leetreveil/musicmetadata looks like the library we want. It's under active development and seems to offer the functionality we need. Any objections? ...as I write this, maybe I have one :) How did Winamp handle meta data from other types of media? I know if had mp3 meta data editing built in, but what did it do with other kinds of media? Was that left up to a media specific plugin? Maybe somebody wants to look into that before we choose. Keep in mind, we will probably need meta data to always be an optional feature since we won't be able to support reading meta data for all possible types of media. |
That thing looks really good, but its huge! It 500k++ un minified. I just tried ogg and flac as 2 mates care about those, I only care about mp3. And my header info reader would fail by getting a non frame on some files but other wise the numbers should be right unless a vbr in which case the bitrate will prolly be wrong as its the bitrate for that frame only. But Ill be getting that all right later, going to be busy this week being near chrissy but Ill still be playing when I can. |
Thanks for checking, that's pretty huge. I realized yesterday our entire payload including demo mp3 and skin is just 190KB after gzip and minification. That makes this library look pretty big :) I'd rather not build this ourselves since it seems like a complicated problems with lots of edge cases. I think it would be best to start with the library which just does id3 and then try to get ogg support merged into that project. I think if we can support mp3 that will cover 90% of use cases, and give us pretty good parity with Winamp. Ogg would be nice to get full parity, but it's not worth including that huge library. This conversation lead me to research and file #117. |
I played with that musicmetadata today (first day Ive had a chance in a while) and was able to reduce it a bit.... Id like to support all those exotic charsets tho, maybe load them in after everything else has loaded and replace the initial decoder, thatd be doable. |
Currently we can only display characters that are in the That being said, I think the text rendering in the playlist (which I'm currently looking into), may be different. |
Yeah, the playlist uses windows fonts if I remember right. EDIT: Oooops. Its getting the duration just fine :\ |
Oh and it does do a little of that odder stuff now. EDIT: |
Back again ;) Found another node based bunch of librarys... This one is alot smaller than the other one and seems to handle mp3's fine (including extended headers which a couple failed on, like the one you originally mentioned). This one is about 95k minnimized for just the id3v2 stuff. I could get that a little smaller by then removing underscore that he used twice for two things that done need underscore, which would get about 20k off....but its always going to be to big for my liking as its all buffer, stream, node stuff that the browser dont need. |
Welcome back. 8K is pretty convincing, and at first glance the code looks like it makes sense. Whether we use your code or an existing library, I think we should keep it as a separate project. Parsing id3 tags in the browser is a useful problem to solve. If we believe that the current solutions are not good enough (aka, too bloated), then we should make our (your) alternative available as an alternative for other projects. @PAEz, would you be interested in developing this fully and maintaining it as a repository under your GitHub account? If not, how would you feel about me putting your code in a repository under my account? I really like the idea of a much leaner library, but I have a few concerns:
So, keeping it lean and without dependencies fits nicely with the aesthetic of this project, but it comes with at a cost. Do you think it's worth it? |
Id be cool with sticking up a repo for it, Im not totally cool on maintaining it though as Im to fickle for that. But then it wouldnt be tHaT much hassle to maintain as its just a matter of keeping this up to date with musicmetadata. Point 1 |
PAEz you really are godsend! I've been looking for a way to read and edit id3 tags for a music project I'm working on. Searching on npm keeps yielding projects that rely on editing the id3 of a file already on disk using wrappers to c++ packages like ffmpeg or libav. I already have the mp3's binary passing through my server and I would rather not have to save it to update it. You're working at a low-enough level that reading (and hopefully editing) them at that level shouldn't be a challenge, it seems. I can't wait to check out what you've done here and see if it's possible to make a package on npm to do the same thing and save others from having to work with old, clunky tools. Case in point: http://blog.kaiserapps.com/2014/01/nodejs-id3-tag-libraries-which-is-best.html (note the date) |
Alright! Sounds like we have a plan. Let's use your code. Thanks @Akamaozu. Looks like we already have another customer for this stand-alone id3 library. :) I think the only question left unresolved is where is this library is going to live.
Let me know which way you want to go. |
It's also worth mentioning that musicmetadata is MIT licensed, so we can freely look at/steal any of their code which we find useful. |
Whatever happened to this? |
Not sure. Any interest in looking into this? We would need to re-evaluate our options, since I'm sure things have evolved since 2015. @parrotgeek1 proposed looking into https://github.com/audiocogs/mp3.js/ obviously that's a bit heavy for us (we just need bitrate and id3, not actual decoding) but it might be a starting place. Maybe some of that stuff is/could be modularize. |
First up that code I put up for reading header info failed on a couple of files, but pretty sure I know why and it will be fixed in the next couple of days. Plus Ill be extending it and making it do more like error checking (sooooooo boring). I wrote that just by looking at the specs and not other peoples code (except the lookup tables, im lazy) so as to avoid having to use their licences....plus it was a real fun challenge. But now Ill go and look around and see what else needs adding to make it more complete.
At some point your going to need this stuff and was wondering if you still think....
https://github.com/aadsm/JavaScript-ID3-Reader
...is what you want to use?
Ive been looking at it and its real good, but I cant test on other devices as I dont own any and so cant comment on that.
The only real problem I saw for your needs was that it was using a string to hold its binary data and that meant youd have to first convert your mp3 to a string which is dumb considering your already have it as arraybuffer. So Ive patched it to be able to use an arraybuffer (Ill send them a pull request later), so now it doesnt have to reproduce the file once again, plus itll be quicker. On speed, Ive noticed a couple of things in that code that could be speed up and Ill prolly do them at some time. And if its going to use an arraybuffer I could add even more optimisations if they want.
If this is the one you want to use then Ill get my info stuff more robust and then Ill see if/how they want to add it in.
The text was updated successfully, but these errors were encountered: