JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q26466F
  • License MIT

Opus codec ported with emscripten, supports PCM in 32-bits Float format. Useful for Web Audio AudioWorkletProcessor

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

  1. Webpack 5 Lazy-loading support (using await import() syntax)
  2. Automatically fallback to opus.asm.js if WASM is not supported
  3. Support 32-bits Float formatted PCM data
  4. Lower memory usage by limiting the stack size and the heap size further