@thinkridge/rlib-soundfont
v0.0.4
Published
SoundFont decoder
Maintainers
Readme
@thinkridge/rlib-soundfont
SoundFont (.sf2) decoder for Web / Node.js using WebAssembly.
Repository
Monorepo root
https://github.com/thinkridge/rlib-SoundsPackage location (@thinkridge/rlib-soundfont)
https://github.com/thinkridge/rlib-Sounds/tree/main/rlib-SoundFont/npmpackage
Installation
npm install @thinkridge/rlib-soundfontUsage (Node.js)
import * as fs from "node:fs/promises";
import { RlibSoundfont } from "@thinkridge/rlib-soundfont";
const rlibSoundfont = new RlibSoundfont();
try {
const sf2Binary = new Uint8Array(await fs.readFile("example.sf2"));
const smfBinary = new Uint8Array(await fs.readFile("test.mid"));
await rlibSoundfont.initSoundfont(sf2Binary);
const wavBinary = await rlibSoundfont.smfToWav(smfBinary); // smf -> wav
} catch (e) {
console.error(e);
} finally {
rlibSoundfont.dispose();
}License
MIT © Thinkridge Co., Ltd.
Build
This package is published with prebuilt artifacts. End users do not need emsdk or Docker.
