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
- Host: GitHub
- URL: https://github.com/subframe7536/music-metadata-wasm
- Owner: subframe7536
- License: mit
- Created: 2024-04-25T08:44:39.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-08-29T03:30:47.000Z (about 1 year ago)
- Last Synced: 2024-11-06T10:05:00.143Z (11 months ago)
- Topics: audio, music-metadata, tagging, wasm, wasm-pack
- Language: Rust
- Homepage:
- Size: 6.36 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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