节点和浏览器的快速操作绑定
bun add @evan/opus
npm install @evan/opus
import { Encoder, Decoder } from '@evan/opus';
const e = new Encoder({ channels: 2, sample_rate: 48_000 });
const d = new Decoder({ channels: 2, sample_rate: 48_000 });
d.decode(e.encode(pcm));
支持的平台
| 节点@ 10 | 节点@ 12 | 节点@ 14 | 节点@ 16 | 节点@ 18 | |
|---|---|---|---|---|---|
| 三十二岁 | ✕ | ✓ | ✓ | ✓ | ✓ |
| 马可斯 x64 | ✓ | ✓ | ✓ | ✓ | ✓ |
| 马可斯臂64 | ✓ | ✓ | ✓ | ✓ | ✓ |
| 窗口 x64 | ✓ | ✓ | ✓ | ✓ | ✓ |
| linux x64 gnu 函数 | ✓ | ✓ | ✓ | ✓ | ✓ |
| linux arm64 gnu (法语) | ✓ | ✓ | ✓ | ✓ | ✓ |
您可以通过设置强制使用 OPUS_FORCE_WASM env 变量
deno 和浏览器使用 @evan/wasm/target/opus/deno.js 从 无编号 :页:1
基准

许可证
麻省理工学院 爱文