Socket
Socket
Sign inDemoInstall

@wasm-audio-decoders/common

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wasm-audio-decoders/common - npm Package Compare versions

Comparing version 1.0.0 to 2.0.0

2

package.json
{
"name": "@wasm-audio-decoders/common",
"version": "1.0.0",
"version": "2.0.0",
"description": "Web Assembly Audio Decoders Common",

@@ -5,0 +5,0 @@ "module": "index.js",

@@ -1,4 +0,5 @@

const compiledWasm = new WeakMap();
export default class WASMAudioDecoderCommon {
// share the same WASM instance per thread
static instances = new WeakMap();
export default class WASMAudioDecoderCommon {
constructor(wasm) {

@@ -18,15 +19,9 @@ this._wasm = wasm;

// new decoder instance
if (this._isWebWorker) {
// web worker
if (WASMAudioDecoderCommon.instances.has(this._EmscriptenWASM)) {
// reuse existing compilation
this._wasm = WASMAudioDecoderCommon.instances.get(this._EmscriptenWASM);
} else {
// first compilation
this._wasm = new this._EmscriptenWASM(WASMAudioDecoderCommon);
} else {
// main thread
if (compiledWasm.has(this._EmscriptenWASM)) {
// reuse existing compilation
this._wasm = compiledWasm.get(this._EmscriptenWASM);
} else {
// first compilation
this._wasm = new this._EmscriptenWASM(WASMAudioDecoderCommon);
compiledWasm.set(this._EmscriptenWASM, this._wasm);
}
WASMAudioDecoderCommon.instances.set(this._EmscriptenWASM, this._wasm);
}

@@ -73,12 +68,2 @@ }

static getDecodedAudioConcat(channelData, samplesDecoded, sampleRate) {
return WASMAudioDecoderCommon.getDecodedAudio(
channelData.map((data) =>
WASMAudioDecoderCommon.concatFloat32(data, samplesDecoded)
),
samplesDecoded,
sampleRate
);
}
static getDecodedAudioMultiChannel(

@@ -85,0 +70,0 @@ input,

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc