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 5.0.2 to 5.1.0

2

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

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

@@ -57,6 +57,7 @@ export default function WASMAudioDecoderCommon(caller) {

getDecodedAudio: {
value: (channelData, samplesDecoded, sampleRate) => ({
value: (channelData, samplesDecoded, sampleRate, bitDepth) => ({
channelData,
samplesDecoded,
sampleRate,
bitDepth
}),

@@ -66,3 +67,3 @@ },

getDecodedAudioMultiChannel: {
value(input, channelsDecoded, samplesDecoded, sampleRate) {
value(input, channelsDecoded, samplesDecoded, sampleRate, bitDepth) {
let channelData = [],

@@ -74,3 +75,3 @@ i,

const channel = [];
for (j = 0; j < input.length; ) channel.push(input[j++][i]);
for (j = 0; j < input.length; ) channel.push(input[j++][i] || []);
channelData.push(

@@ -84,3 +85,4 @@ WASMAudioDecoderCommon.concatFloat32(channel, samplesDecoded)

samplesDecoded,
sampleRate
sampleRate,
bitDepth
);

@@ -205,5 +207,5 @@ },

this.allocateTypedArray = (len, TypedArray) => {
this.allocateTypedArray = (len, TypedArray, setPointer = true) => {
const ptr = this._wasm._malloc(TypedArray.BYTES_PER_ELEMENT * len);
this._pointers.add(ptr);
if (setPointer) this._pointers.add(ptr);

@@ -217,3 +219,3 @@ return {

this.free = () => {
this.free = (ptr) => {
this._pointers.forEach((ptr) => {

@@ -238,9 +240,11 @@ this._wasm._free(ptr);

return this._wasm.ready.then(() => {
caller._input = this.allocateTypedArray(_inputSize, uint8Array);
if (_inputSize)
caller._input = this.allocateTypedArray(_inputSize, uint8Array);
// output buffer
caller._output = this.allocateTypedArray(
_outputChannels * _outputChannelSize,
float32Array
);
if (_outputChannelSize)
caller._output = this.allocateTypedArray(
_outputChannels * _outputChannelSize,
float32Array
);

@@ -247,0 +251,0 @@ return this;

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