Coder Social home page Coder Social logo

Comments (2)

benrr101 avatar benrr101 commented on September 26, 2024

Hi, let me do my best to help on this one. Sorry the advanced tagging docs on the wiki aren't done yet. I started working on them a while ago and keep getting sidetracked by other things.

If you want to use the myFile.getTag() method to create new tags, you'll want to look at the settings in Id3v2Settings Use Id3v2Settings.defaultVersion = 4 to make new ID3v2 tags v2.4. However, this won't affect existing tags. There's a couple ways to change version of existing tags (this is subject to change as per #47) but the most obvious is to update the version of the existing tag by setting id3v2Tag.version = 4.

As for creating the frame, see my notes on your other question about creating a frame identifier (ie, don't create a new one, use the existing ones). Ideally, if you're creating a text information frame, you can just use TextInformationFrame.FromIdentifier.

Putting it all together, here's an example for how you would add the title to your file:

const id3v2Tag = myFile.getTag(TagTypes.Id3v2, true);
id3v2Tag.version = 4;

const newFrame = Id3v2TextInformationFrame.fromIdentifier(Id3v2FrameIdentifiers.TIT2);
newFrame.text = ['mytitle'];

id3v2Tag.addFrame(newFrame);

I'm kinda winging it with the example since it's been a while since I've touched the ID3v2 code. Let me know if you run into any issues.

from node-taglib-sharp.

stuartambient avatar stuartambient commented on September 26, 2024

Your example worked for me. Appreciate the answer !

from node-taglib-sharp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.