@vkontakte/calls-audio-effects 1.2.10-dev.12fb226c.0 → 1.2.10-dev.652c81ba.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AudioEffects.d.ts +1 -1
- package/audio-effects.cjs.js +568 -478
- package/audio-effects.esm.js +568 -478
- package/controllers/VadController.d.ts +6 -3
- package/effects/EffectVadAi.d.ts +20 -0
- package/package.json +2 -2
- package/workers/VadTfliteWorker.d.ts +6 -0
- /package/workers/{VadAiWorker.d.ts → VadOnnxWorker.d.ts} +0 -0
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { type EffectVadAiOptions } from '../effects/EffectVadAi';
|
|
2
|
+
export interface VadControllerOptions extends EffectVadAiOptions {
|
|
3
|
+
/** Speech probability threshold for enabling track. Default: 0.66 */
|
|
3
4
|
threshold?: number;
|
|
4
|
-
/**
|
|
5
|
+
/** How many ms after last "speech" to keep enabled=true. Default: 300 */
|
|
5
6
|
hangoverMs?: number;
|
|
6
7
|
}
|
|
7
8
|
export interface VadLib {
|
|
@@ -13,6 +14,7 @@ export declare class VadController {
|
|
|
13
14
|
private _vadInputTrack;
|
|
14
15
|
private _threshold;
|
|
15
16
|
private _hangoverMs;
|
|
17
|
+
private _effectOptions;
|
|
16
18
|
private _isSpeaking;
|
|
17
19
|
private _lastSpeechAt;
|
|
18
20
|
private _hangoverTimer;
|
|
@@ -22,6 +24,7 @@ export declare class VadController {
|
|
|
22
24
|
private _logger;
|
|
23
25
|
constructor(sendTrack?: MediaStreamTrack | null, options?: VadControllerOptions);
|
|
24
26
|
setOptions(options: VadControllerOptions): void;
|
|
27
|
+
private _applyEffectOptions;
|
|
25
28
|
setLogger(loggerFunction: (type: string, ...args: unknown[]) => void, loggerName?: string): void;
|
|
26
29
|
init(): Promise<void>;
|
|
27
30
|
setSendTrack(track: MediaStreamTrack | null): void;
|
package/effects/EffectVadAi.d.ts
CHANGED
|
@@ -1,11 +1,31 @@
|
|
|
1
1
|
import { DataProcessing } from '../processor/AudioProcessor';
|
|
2
2
|
import { WorkerAudioProcessor } from '../processor/WorkerAudioProcessor';
|
|
3
|
+
export type VadModelType = 'onnx' | 'tflite';
|
|
4
|
+
export declare const DEFAULT_VAD_AI_URLS: {
|
|
5
|
+
readonly modelUrl: "https://calls-sdk.cdn-vk.ru/models/bcresnet_no_center_mult2_20ms.onnx";
|
|
6
|
+
readonly modelDataUrl: "https://calls-sdk.cdn-vk.ru/models/bcresnet_no_center_mult2_20ms.onnx.data";
|
|
7
|
+
readonly ortWasmUrl: "https://calls-sdk.cdn-vk.ru/vendor/onnxruntime-web/ort-wasm-simd-threaded.wasm";
|
|
8
|
+
readonly ortMjsUrl: "https://calls-sdk.cdn-vk.ru/vendor/onnxruntime-web/ort-wasm-simd-threaded.mjs";
|
|
9
|
+
};
|
|
10
|
+
export interface EffectVadAiOptions {
|
|
11
|
+
modelType?: VadModelType;
|
|
12
|
+
modelUrl?: string;
|
|
13
|
+
modelDataUrl?: string;
|
|
14
|
+
ortWasmUrl?: string;
|
|
15
|
+
ortMjsUrl?: string;
|
|
16
|
+
}
|
|
3
17
|
export interface VadProbs {
|
|
4
18
|
speechProb: number;
|
|
5
19
|
silenceProb: number;
|
|
6
20
|
}
|
|
7
21
|
export declare class EffectVadAi extends WorkerAudioProcessor implements DataProcessing {
|
|
8
22
|
onData: (probs: VadProbs) => void;
|
|
23
|
+
private readonly _modelType;
|
|
24
|
+
private readonly _modelUrl;
|
|
25
|
+
private readonly _modelDataUrl;
|
|
26
|
+
private readonly _ortWasmUrl;
|
|
27
|
+
private readonly _ortMjsUrl;
|
|
28
|
+
constructor(options?: EffectVadAiOptions);
|
|
9
29
|
init(): Promise<void>;
|
|
10
30
|
protected onWorkletData(data: ArrayBuffer): void;
|
|
11
31
|
protected onWorkerData(probs: VadProbs): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vkontakte/calls-audio-effects",
|
|
3
|
-
"version": "1.2.10-dev.
|
|
3
|
+
"version": "1.2.10-dev.652c81ba.0",
|
|
4
4
|
"author": "vk.com",
|
|
5
5
|
"description": "Audio effects library for video calls based on the vk.com platform",
|
|
6
6
|
"homepage": "https://vk.com",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"**/*.d.ts"
|
|
15
15
|
],
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@vkontakte/audio-processing": "0.0.8",
|
|
17
|
+
"@vkontakte/audio-processing": "0.0.8-dev.0848d3fd",
|
|
18
18
|
"onnxruntime-web": "^1.26.0"
|
|
19
19
|
}
|
|
20
20
|
}
|
|
File without changes
|