music-metadata-wasm
v0.1.3
Published
read / write the music file metadata using wasm, powered by lofty-rs
Downloads
5
Maintainers
Readme
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')
Todo
- [ ] Napi 3
License
MIT