opus-decoder
Advanced tools
Comparing version 0.3.4 to 0.3.5
{ | ||
"name": "opus-decoder", | ||
"version": "0.3.4", | ||
"version": "0.3.5", | ||
"description": "Web Assembly streaming Opus decoder", | ||
@@ -43,4 +43,4 @@ "main": "dist/opus-decoder.min.js", | ||
"dependencies": { | ||
"@wasm-audio-decoders/common": "0.0.1" | ||
"@wasm-audio-decoders/common": "1.0.0" | ||
} | ||
} |
@@ -86,3 +86,3 @@ # `opus-decoder` | ||
], | ||
samplesDecoded: 1234, // number of PCM samples that were decoded | ||
samplesDecoded: 1234, // number of PCM samples that were decoded per channel | ||
sampleRate: 48000 // sample rate of the decoded PCM | ||
@@ -89,0 +89,0 @@ } |
@@ -6,11 +6,12 @@ import { WASMAudioDecoderCommon } from "@wasm-audio-decoders/common"; | ||
export default class OpusDecoder { | ||
constructor(_WASMAudioDecoderCommon, _EmscriptenWASM) { | ||
this._isWebWorker = _WASMAudioDecoderCommon && _EmscriptenWASM; | ||
constructor(options = {}) { | ||
// injects dependencies when running as a web worker | ||
this._isWebWorker = this.constructor.isWebWorker; | ||
this._WASMAudioDecoderCommon = | ||
_WASMAudioDecoderCommon || WASMAudioDecoderCommon; | ||
this._EmscriptenWASM = _EmscriptenWASM || EmscriptenWASM; | ||
this.constructor.WASMAudioDecoderCommon || WASMAudioDecoderCommon; | ||
this._EmscriptenWASM = this.constructor.EmscriptenWASM || EmscriptenWASM; | ||
this._inputPtrSize = (0.12 * 510000) / 8; | ||
this._outputPtrSize = 120 * 48; | ||
this._channelsOut = 2; | ||
this._outputChannels = 2; | ||
@@ -57,4 +58,3 @@ this._ready = this._init(); | ||
opusFrame.length, | ||
this._leftPtr, | ||
this._rightPtr | ||
this._outputPtr | ||
); | ||
@@ -64,4 +64,4 @@ | ||
[ | ||
this._leftArr.slice(0, samplesDecoded), | ||
this._rightArr.slice(0, samplesDecoded), | ||
this._output.slice(0, samplesDecoded), | ||
this._output.slice(samplesDecoded, samplesDecoded * 2), | ||
], | ||
@@ -68,0 +68,0 @@ samplesDecoded, |
@@ -6,4 +6,4 @@ import { WASMAudioDecoderWorker } from "@wasm-audio-decoders/common"; | ||
export default class OpusDecoderWebWorker extends WASMAudioDecoderWorker { | ||
constructor() { | ||
super(OpusDecoder, EmscriptenWASM); | ||
constructor(options) { | ||
super(options, OpusDecoder, EmscriptenWASM); | ||
} | ||
@@ -10,0 +10,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
High entropy strings
Supply chain riskContains high entropy strings. This could be a sign of encrypted data, leaked secrets or obfuscated code.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
High entropy strings
Supply chain riskContains high entropy strings. This could be a sign of encrypted data, leaked secrets or obfuscated code.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
199640
857
+ Added@wasm-audio-decoders/common@1.0.0(transitive)
- Removed@wasm-audio-decoders/common@0.0.1(transitive)