Comments (5)
Looks good. I will have a look as soon.
from id3-parser.
Here is ID3v1 protocol. As it says, ID3v1 would be like:
Property | Legnth |
---|---|
Song Title | 30 characters |
Artist | 30 characters |
Album | 30 characters |
Year | 4 characters |
Comment | 30 characters |
Genre | 1 byte |
Property like Artist
may does not need 30 bytes, so, it will be padding with binary 0
.
However, for lib's readUTF8String
util, it will break reading when get 0x00
. So I don't think we have to use /(^\s+|\s+$|\0.*$)/g
.
from id3-parser.
And it's great if you can offer a counterexample.
Use
let buf = fs.readFileSync('xxxxx.mp3')
buf = buf.slice(buf.length - 128)
to extract the id3v1 part.
from id3-parser.
It might be so for the v1 part, I had no issue with that one. I had a set of MP3s created by a clearly non standard-compliant software (of which, many exists) which happened to be in ID3v2, encoded with ISO8859 and null-terminated. This module included the null in the resulting string. Though it looked Ok when printed through console.log, when that string was stored in a SQLite database (not an unusual thing, MediaMonkey does that) with its automatic typecasting, it stored the string not as of type TEXT but as BLOB and that simply because of the non-visible null at the end of the string. I fixed it by stripping that null, but I wouldn't recommend my patch for this library module. A more generic fix could be to use the same regular expression you use for v1 tags for both v1 and v2, but that would have required moving whiteRe
out of the function it is declared in and have the ability to strip both blanks and nulls.
from id3-parser.
Get it. I'll assess whether to change whiteRe
.
from id3-parser.
Related Issues (16)
- calcFrameSize returning NaN HOT 3
- Support chapter frames? HOT 1
- Tag doesn't parse. HOT 3
- File with no id3 tags returning input instead of emitting error HOT 4
- id3-parser v2
- A possible bug about APIC frame HOT 1
- Readme provides no example for usage on local files
- {'user-defined-text-information': '哾愀最最椀渀最 琀椀洀攀',} looks incorrectly parsed. HOT 1
- Need Support for AngularJS/Javascript Plain HOT 1
- Thanks for this library HOT 2
- It's entirely written in TypeScript HOT 2
- TXXX type metadata added to ID3.4 by ffmpeg cannot be parsed
- 可以增加对flac的解析吗
- Memory gobbled when using a buffer as input HOT 2
- Type Definition File HOT 1
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 id3-parser.