Comments (16)
The value is not the same because timeStamp
must be an integer value. If you replace your values with an integer value, the timeStamp
will be correct, this will also fix the issue with the missing line.
from node-id3.
@Sandakan You can update to version 0.2.6 and your problem should be fixed
@Zazama Thanks for the update and the quick fix.
from node-id3.
@Sandakan thanks for reporting the bug! Thanks @Zazama for the quick fix!
from node-id3.
Is 12.5
the second? Because you have to pass the millisecond (e.g. 12500 in this case).
This is also partially a bug: https://github.com/Zazama/node-id3/blob/0.2/src/ID3FrameBuilder.js#L17
The call to Number.isInteger(value)
is false but no buffer is appended, which makes the frame be out-of-spec. The Ls in line 2-4 (and line 5 alltogether) are missing because they are consumed by the timeStamp (4294855680 => 0xFFFE4C00 => L).
from node-id3.
I created #147 to improve the documentation and prevent silent failure in appendNumber
.
from node-id3.
Is
12.5
the second? Because you have to pass the millisecond (e.g. 12500 in this case).This is also partially a bug: https://github.com/Zazama/node-id3/blob/0.2/src/ID3FrameBuilder.js#L17 The call to
Number.isInteger(value)
is false but no buffer is appended, which makes the frame be out-of-spec. The Ls in line 2-4 (and line 5 alltogether) are missing because they are consumed by the timeStamp (4294855680 => 0xFFFE4C00 => L).
Yes, this is exactly what I found out.
from node-id3.
The value is not the same because
timeStamp
must be an integer value. If you replace your values with an integer value, thetimeStamp
will be correct, this will also fix the issue with the missing line.
It worked this time.
from node-id3.
There's another problem.
Whenever I update the lyrics, it will add a new lyrics object to syncronizedLyrics array instead of updating the previous one.
Is there a way to clear the array before writing it again with the new lyrics or should I use this approach and just read the last item in the array?
from node-id3.
Is
12.5
the second? Because you have to pass the millisecond (e.g. 12500 in this case).
Thanks @Zazama for pointing this out, @Sandakan did you see this point?
from node-id3.
There's another problem.
Whenever I update the lyrics, it will add a new lyrics object to syncronizedLyrics array instead of updating the previous one.
Is there a way to clear the array before writing it again with the new lyrics or should I use this approach and just read the last item in the array?
This is working as designed.
You should notice in the README documentation that the synchronisedLyrics
takes an array of definition. From the id3 specs, there can be more than one. Internally, this frame is defined as multiple here.
When doing an update, the API should not modify the other frames. Therefore adds a new one. We understand that a user may want to completely replace all the lyrics. This is a known issue with the current design of the API and is the same for all the frames which can accepts multiple values.
The workaround for now is to not use the update
function and instead read
all the tags, replace the synchronisedLyrics
one and rewrite them. Notice that this may remove some tags from your file that are not supported by this library. But I think we should support almost all the known official tags.
This will be improved in future versions.
from node-id3.
What if I keep adding new lyrics objects to the array whenever I update the song and read only the last element of the array? This should work, right?
I hope that there are no limitations to the number of lyrics objects that can be put into this array.
from node-id3.
As I said I recommended not to use the update
function when manipulating lyrics, otherwise you will keep adding lyrics frames to the file, this is most likely not what you want to do. Do a read
, update the result and write
everything back.
Just to be clear there are two arrays and there is no limitation in neither of them:
{
synchronisedLyrics: [{ // The top level one, for example one for each language
language: "ENG",
timeStampFormat: 2,
contentType: 1,
shortText: "this is short text",
synchronisedText: [ // The synchronised text one
{
text: "Lyrics line 1",
timeStamp: 0,
},
],
}
}
from node-id3.
I tested it with some other lyrics.
{
contentType: TagConstants.SynchronisedLyrics.ContentType.LYRICS,
language: 'ENG',
timeStampFormat: TagConstants.TimeStampFormat.MILLISECONDS,
shortText: 'this is short text',
synchronisedText: [
{ text: 'Never thought I would love again', timeStamp: 3610 },
{ text: 'Here I am, lost in Love Me Land', timeStamp: 12380 },
{ text: '♪', timeStamp: 20340 },
{ text: 'How dare you have lips like that?', timeStamp: 29400 },
{ text: "How dare you gon' kiss like that?", timeStamp: 34150 },
],
};
And this is the output I got.
{
language: 'ENG',
timeStampFormat: 2,
contentType: 1,
shortText: 'this is short text',
synchronisedText: [
{ text: 'Never thought I would love again', timeStamp: 3610 },
{ text: 'Here I am, lost in Love Me Land', timeStamp: 12380 },
{ text: '♪', timeStamp: 5207295 },
{ text: '﹈ow dare you have lips like that?', timeStamp: 29400 },
{ text: "How dare you gon' kiss like that?", timeStamp: 34150 },
],
},
In the third sychronisedText line, the timestamp is incorrect and the line after that has an unknown letter instead of the letter "H".
from node-id3.
#148 @pbricout I tried to fix it, any thoughts before merging?
When merged I can backport to branch 0.2 to release a fix
from node-id3.
@Zazama having a look at #148 .
from node-id3.
@Sandakan
You can update to version 0.2.6 and your problem should be fixed
https://www.npmjs.com/package/node-id3/v/0.2.6
from node-id3.
Related Issues (20)
- [feature] Add support for React Native HOT 5
- length/TLEN HOT 2
- Not working with typescript HOT 2
- (Existing) tag for 'year' not returned HOT 5
- ImageBuffer returns undefined after editing other tags HOT 2
- Explain in docs that `write` doesn't create new file =) HOT 4
- "releaseTime" tag not read from AIFF file HOT 6
- Duration not supported HOT 1
- Add constants for obscure tag values HOT 7
- update function does not take v4 tags into account
- Changes and fixes for new API release
- Updating tags in AIFF files makes tags/audio unreadable by other applications HOT 5
- Setting synchronisedLyrics to undefined throws an error HOT 4
- [BuG] MP3 File is corrupted HOT 8
- Not reading id3v1 HOT 1
- Support for audio formats other than mp3 HOT 4
- Support large files HOT 2
- Issues with metadata being read by certain players HOT 2
- Basic adding tags not working HOT 5
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 node-id3.