Giter VIP home page Giter VIP logo

write-aac-metadata's Introduction

Write AAC Metadata

NodeJS module that will allow you to write aac (m4a, m4b) metadata using ffmpeg

Installation

npm install write-aac-metadata --save
yarn add write-aac-metadata

Usage

import metadataWriter from "write-aac-metadata"

const writeMetadata = async () => {
   await metadataWriter("someFile.m4a", {title: "Some Title", description: "Description"}, "someFile-copy.m4a")
}

writeMetadata()

If you want to modify a file in place don't pass anything to the 3rd parameter. Ffmpeg doesn't allow this directly so to simulate it a new file is created with the input file's name and a guid on the end. After the metadata has been added and the new file is finished the original file is deleted and the new file is renamed to be the same name as the original file. This package also copies the creation date of the original file to the new file

Metadata

Set whatever metadata you want updated. Any fields that are left as undefined will not be changed and the current value of the metadata will be copied to the output file

{
   title?: string,
   artist?: string,
   albumArtist?: string,
   album?: string,
   grouping?: string,
   composer?: string,
   year?: number,
   trackNumber?: number,
   comment?: string,
   genre?: string,
   copyright?: string,
   description?: string,
   synopsis?: string,
   /**
    * The path for the cover photo that should be added to the file, don't set this field if you want to keep the existing art
    */
   coverPicturePath?: string,
}

Options

These are the options you can pass as the 4th parameter

{
   /**
    * Write debugging output to the console?
    * @default false
    */
   debug?: boolean,
   /**
    * If stdio should be piped to the current console, useful for figuring out issues with ffmpeg
    * @default false
    */
   pipeStdio?: boolean,
}

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.