Package Exports
- @vocaltale/opus.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@vocaltale/opus.js) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
opus.js
Inspired by OpusScript, or an enhanced version, of a JavaScript library compiled from libopus using Emscripten.
Usage
import Opus, { OpusApplication } from '@vocaltale/opus.js'
opus = new Opus(48000, 1, OpusApplication.RESTRICTED_LOWDELAY)
const frameFloat = new Float32Array(1920)
frameFloat.fill(0.1)
const encodedFloat = opus.encodeFloat(frameFloat)
const decodedFloat = opus.decodeFloat(encodedFloat)
opus.delete()
Enhancements
- Webpack 5 Lazy-loading support (using
await import()syntax) - Automatically fallback to
opus.asm.jsifWASMis not supported - Support 32-bits Float formatted PCM data
- Lower memory usage by limiting the stack size and the heap size further