opus-decoder
Advanced tools
Comparing version 0.5.1 to 0.5.2
{ | ||
"name": "opus-decoder", | ||
"version": "0.5.1", | ||
"version": "0.5.2", | ||
"description": "Web Assembly streaming Opus decoder", | ||
@@ -5,0 +5,0 @@ "type": "module", |
@@ -92,12 +92,20 @@ import { WASMAudioDecoderCommon } from "@wasm-audio-decoders/common"; | ||
} | ||
return samplesDecoded; | ||
return { | ||
outputBuffer: this._common.getOutputChannels( | ||
this._output.buf, | ||
this._outputChannels, | ||
samplesDecoded | ||
), | ||
samplesDecoded: samplesDecoded, | ||
}; | ||
}; | ||
this.decodeFrame = (opusFrame) => { | ||
const samplesDecoded = this._decode(opusFrame); | ||
const decoded = this._decode(opusFrame); | ||
return this._WASMAudioDecoderCommon.getDecodedAudioMultiChannel( | ||
this._output.buf, | ||
[decoded.outputBuffer], | ||
this._outputChannels, | ||
samplesDecoded, | ||
decoded.samplesDecoded, | ||
48000 | ||
@@ -113,15 +121,8 @@ ); | ||
while (i < opusFrames.length) { | ||
const samplesDecoded = this._decode(opusFrames[i++]); | ||
outputBuffers.push( | ||
this._common.getOutputChannels( | ||
this._output.buf, | ||
this._outputChannels, | ||
samplesDecoded | ||
) | ||
); | ||
outputSamples += samplesDecoded; | ||
const decoded = this._decode(opusFrames[i++]); | ||
outputBuffers.push(decoded.outputBuffer); | ||
outputSamples += decoded.samplesDecoded; | ||
} | ||
const data = this._WASMAudioDecoderCommon.getDecodedAudioMultiChannel( | ||
return this._WASMAudioDecoderCommon.getDecodedAudioMultiChannel( | ||
outputBuffers, | ||
@@ -132,4 +133,2 @@ this._outputChannels, | ||
); | ||
return data; | ||
}; | ||
@@ -136,0 +135,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
194058