废柴
莱梅 以 TypeScript / JavaScript 桥 API 编译为独立的 WASM .
安装和示例使用
npm install @closeio/lame-wasm
import { init } from "@closeio/lame-wasm";
async function record() {
// Mono 48kbps PCM input, 128kbps output
const lame = await init({
channels: 1,
sampleRate: 48_000, // Perhaps from a `new AudioContext().sampleRate`...
kilobitRate: 128,
});
const chunks = [];
chunks.push(lame.encodeFloat(pcmData));
chunks.push(lame.flush()); // finish with a flush
const mp3 = new Blob(chunks, { type: "audio/mp3" });
}
许可证
lame-wasm 本人根据麻省理工学院许可证持有执照,而 LAME 库根据
页:1 图书馆一般公共许可证V2。 。 。 . lame-wasm 不含源代码或
修改 LAME在国家预防机制登记册中分发的表格包括:
页:1 LAME 对象代码.
发展
与 default 尼克斯外壳 :
nix develop --no-pure-eval '#.'
# Formatting
nix fmt .
oxfmt .
# Linting/typecheck
oxlint
tsc
# Demo development
vite
# Publishing (command order matters)
# Don't forget to update the CHANGELOG, package.json version, and add a git tag
vite build
tsc -p tsconfig.publish.json
pnpm login
pnpm publish --access public