Skip to content

Latest commit

 

History

History
74 lines (65 loc) · 1.58 KB

Readme.md

File metadata and controls

74 lines (65 loc) · 1.58 KB

Mp3 To AAC

A Node.js module that uses ffmpeg to convert one or more mp3 files to aac (m4a or m4b)

Installation

npm install mp3-to-aac --save
yarn add mp3-to-aac

Usage

Javascript

const mp3ToAac = require('mp3-to-aac').mp3ToAac;

mp3ToAac("file.mp3", "output.m4a")

TypeScript

import mp3ToAac from 'mp3-to-aac';

mp3ToAac("file.mp3", "output.m4a")

Options

You can pass options as the 3rd parameter to the function.

{
   /**
    * Current working directory for ffmpeg process
    */
   cwd?: string,
   /**
    * If the ffmpeg process should be detached from the existing process. If false killing the node process will kill ffmpeg
    * @default false
    */
   detached?: boolean,
   /**
    * If stdio should be piped to the current console
    * @default true
    */
   pipeStdio?: boolean,
   /**
    * Write debugging output to the console?
    * @default false
    */
   debug?: boolean,
   /**
    * Metadata overrides. By default ffmpeg will copy any metadata on the mp3 to the output file, these will allow you to specify your own metadata
    */
   metaDataOverrides?: {
      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
       */
      coverPicturePath?: string,
   }
}