An open API service indexing awesome lists of open source software.

https://github.com/subframe7536/music-metadata-wasm

read / write the music file metadata using wasm, powered by lofty-rs
https://github.com/subframe7536/music-metadata-wasm

audio music-metadata tagging wasm wasm-pack

Last synced: 6 months ago
JSON representation

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

Awesome Lists containing this project

README

          

# music-metadata-wasm

read / write the music file metadata using wasm, powered by [`lofty-rs`](https://github.com/Serial-ATA/lofty-rs)

## Install

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

## Usage

```ts
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