music-metadata-wasm
TypeScript icon, indicating that this package has built-in type declarations

0.1.2 • Public • Published

music-metadata-wasm

read / write the music file metadata using wasm, powered by lofty-rs

Install

npm install music-metadata-wasm
yarn add music-metadata-wasm
pnpm add music-metadata-wasm

Usage

import { MetaFile } from 'music-metadata-wasm'
import url from '../samples/flac.flac?url'

console.time('total')

const _ = await fetch(url).then(res => res.arrayBuffer())
const buffer = new Uint8Array(_)
const oldMetadata = new MetaFile(buffer)
oldMetadata.title = 'test'

oldMetadata.save()
const newBuffer = oldMetadata.buffer
oldMetadata.dispose()

const data = new MetaFile(newBuffer)
console.log(data.title)
document.querySelector('div')!.innerHTML = data.pictures?.[0].mimeType || 'no cover'

console.timeEnd('total')

License

MIT

/music-metadata-wasm/

    Package Sidebar

    Install

    npm i music-metadata-wasm

    Weekly Downloads

    1

    Version

    0.1.2

    License

    MIT

    Unpacked Size

    750 kB

    Total Files

    8

    Last publish

    Collaborators

    • subframe7536