MP3 · ID3
ID3v1 and v1.1, ID3v2.2, 2.3 and 2.4, and Lyrics3 v1 and v2.00. 104 frame types, including the CHAP/CTOC chapters, and 148 genres. Unknown frames keep their bytes.
Spec-exact tags for every audio container. Read and write them in the browser and in Node, and every byte you did not touch stays as it was.
import { readFromBlob, writeToBlob } from 'audio-tag/browser'
const { format, metadata } = await readFromBlob(file)
// 'mpeg' | 'mp4' | 'flac' | 'ogg' | 'aiff' | 'riff'
const out = await writeToBlob(file, {
metadata: { title: 'New title', genre: ['Rock'] },
})
// a File with the same name; the audio is never copiedReading looks at the tag regions only. Writing is a plan of new tag bytes and ranges of the old file, carried out in place when the size stays the same.
Drop an audio file, edit its tags and download the result. Everything runs in your browser; nothing is uploaded. Open "For nerds" to see the file byte by byte.
MP3, M4A, FLAC, Ogg, AIFF or WAV. It never leaves your browser.
Up to 30 seconds, saved as a WAV file. Click again to stop.
Open an audio file to see its tags, change them and download a copy. Curious how it is built? The details for nerds show every byte.
format
How this file is built, byte by byte. Everything the library read, nothing hidden.
| Region | Kind | Offset | Size |
|---|
readFromBlob(file)Each format keeps its tags somewhere else. audio-tag reads and writes all of them with the same metadata object.
Each file from its first byte (top) to its last. Color: tags audio-tag reads and writes. Hatched: audio data.
ID3v1 and v1.1, ID3v2.2, 2.3 and 2.4, and Lyrics3 v1 and v2.00. 104 frame types, including the CHAP/CTOC chapters, and 148 genres. Unknown frames keep their bytes.
The iTunes item list in moov/udta/meta/ilst, QuickTime mdta keys and udta text. When the metadata grows, every chunk offset (stco/co64) moves with it.
The VORBIS_COMMENT block and PICTURE blocks (RFC 9639). A write reuses the padding, so it is usually in place.
Vorbis, Opus and FLAC in Ogg: the comment header, with covers as METADATA_BLOCK_PICTURE. Only the header pages are rewritten, with new CRCs.
An ID3 chunk for rich metadata, plus the spec's NAME, AUTH, (c), ANNO and COMT chunks, kept in step.
An id3 chunk for rich metadata and the RIFF LIST/INFO list (INAM, IART and others) as a fallback, kept in step.
One package, three entry points: bytes (audio-tag), Blob and File (audio-tag/browser), files on disk (audio-tag/node). It also ships this website, to read offline.
npm install audio-tagpnpm add audio-tagyarn add audio-tagbun add audio-tag