New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@100mslive/hms-noise-suppression

Package Overview
Dependencies
Maintainers
16
Versions
242
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@100mslive/hms-noise-suppression - npm Package Compare versions

Comparing version

to
0.1.4-1

1

dist/HMSNoiseSupressorPlugin.d.ts

@@ -17,2 +17,3 @@ import { HMSAudioPlugin, HMSAudioPluginType } from '@100mslive/hms-video';

setNoiseSuppression(value: boolean): void;
removeNoise(buffer: any, module: any): void;
processAudioTrack(audioContext: AudioContext, sourceNode: MediaStreamAudioSourceNode): Promise<AudioNode>;

@@ -19,0 +20,0 @@ private log;

2

package.json
{
"version": "0.1.3",
"version": "0.1.4-1",
"license": "MIT",

@@ -4,0 +4,0 @@ "main": "dist/index.js",

@@ -77,3 +77,7 @@ // @ts-ignore

this.setNoiseSuppression(false);
this.processingNode.disconnect();
if(this.processingNode){
this.processingNode.disconnect();
}
//TODO: see if we need to disconnect audio nodes also

@@ -85,2 +89,13 @@ }

}
removeNoise(buffer: any, module: any) {
let ptr = module.ptr;
let st = module.st;
for (let i = 0; i < 480; i++) {
module.HEAPF32[(ptr >> 2) + i] = buffer[i] * 32768;
}
module._rnnoise_process_frame(st, ptr, ptr);
for (let i = 0; i < 480; i++) {
buffer[i] = module.HEAPF32[(ptr >> 2) + i] / 32768;
}
}

@@ -116,13 +131,4 @@ processAudioTrack(audioContext: AudioContext, sourceNode: MediaStreamAudioSourceNode): Promise<AudioNode> {

function removeNoise(buffer: any, module: any) {
let ptr = module.ptr;
let st = module.st;
for (let i = 0; i < 480; i++) {
module.HEAPF32[(ptr >> 2) + i] = buffer[i] * 32768;
}
module._rnnoise_process_frame(st, ptr, ptr);
for (let i = 0; i < 480; i++) {
buffer[i] = module.HEAPF32[(ptr >> 2) + i] / 32768;
}
}
this.log(TAG, this.suppressNoise);

@@ -134,4 +140,3 @@ this.processingNode.onaudioprocess = (e: any) => {

// Drain input buffer.
this.log(TAG, this.suppressNoise);
for (let i = 0; i < bufferSize; i++) {

@@ -147,3 +152,3 @@ inputBuffer.push(input[i]);

if (this.suppressNoise) {
removeNoise(frameBuffer, this.module);
this.removeNoise(frameBuffer, this.module);
}

@@ -150,0 +155,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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet