JSPM

  • Created
  • Published
  • Downloads 1143
  • Score
    100M100P100Q125080F
  • License MIT

MP3 tagging written in pure JavaScript

Package Exports

  • mp3tag.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (mp3tag.js) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

mp3tag.js Banner

GitHub Workflow Status Build Status David npm

mp3tag.js is an open sourced JavaScript library used to edit the metadata of audio files. It currently can read both ID3v2.3 and ID3v2.4 tags, write tags and remove tags.

Visit https://mp3tag.js.org to learn more about the library and view it in action through an editor.

Features

  • Read ID3v2.3 and ID3v2.4 tags
  • Write ID3v2.3 and ID3v2.4 tags
  • Remove tags
  • Write multiple frames with the same kind
  • Supports reading unsynchronization flag
  • Input validation following the standards

Installation

You can clone this repository by using git

git clone https://github.com/eidoriantan/mp3tag.js

You can also install this package by using npm to your projects by running this command:

npm install --save mp3tag.js

Usage

You should get the ArrayBuffer of the audio file you would like to modify. You can achieve this by using FileReader on your scripts.

For example,

<input type="file" id="input-file" accept="audio/mpeg">
<script>
const inputFile = document.getElementById('input-file')
inputFile.onchange = function () {
  const reader = new FileReader()
  reader.onload = function () {
    const buffer = this.result
    const mp3tag = new MP3Tag(buffer)
    mp3tag.read()
  }

  reader.readAsArrayBuffer(this.files[0])
}
</script>

Please refer to mp3tag.js.org for documentations!

Support

If you had found a bug or any unexpected behavior, you can submit an issue through GitHub issues.