https://github.com/evanwashere/opus
fast opus bindings for node and browsers
https://github.com/evanwashere/opus
native node opus opus-codec wasm
Last synced: about 1 month ago
JSON representation
fast opus bindings for node and browsers
- Host: GitHub
- URL: https://github.com/evanwashere/opus
- Owner: evanwashere
- License: mit
- Created: 2021-07-27T13:51:11.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2024-02-11T06:17:38.000Z (over 1 year ago)
- Last Synced: 2025-03-23T16:16:45.277Z (about 2 months ago)
- Topics: native, node, opus, opus-codec, wasm
- Language: JavaScript
- Homepage:
- Size: 6.44 MB
- Stars: 12
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# fast opus bindings for node and browsers
`bun add @evan/opus`
`npm install @evan/opus`
```js
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));
```## supported platforms
| | node@10 | node@12 | node@14 | node@16 | node@18 |
| ---------------- | ------- | ------- | ------- | ------- | ------- |
| wasm32 | ✕ | ✓ | ✓ | ✓ | ✓ |
| macos x64 | ✓ | ✓ | ✓ | ✓ | ✓ |
| macos arm64 | ✓ | ✓ | ✓ | ✓ | ✓ |
| windows x64 | ✓ | ✓ | ✓ | ✓ | ✓ |
| linux x64 gnu | ✓ | ✓ | ✓ | ✓ | ✓ |
| linux arm64 gnu | ✓ | ✓ | ✓ | ✓ | ✓ |you can force usage of wasm by setting `OPUS_FORCE_WASM` env variable
for deno and browsers use `@evan/wasm/target/opus/deno.js` from [npm](https://npmjs.com/@evan/wasm)/[cdn](https://unpkg.com/@evan/wasm/target/opus/deno.js)
## benchmarks

## License
MIT © [Evan](https://github.com/evanwashere)