@tensamin/audio 0.1.14 → 0.2.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/README.md +48 -231
- package/dist/chunk-6BJ4XGSA.mjs +80 -0
- package/dist/chunk-AQ5RVY33.mjs +74 -0
- package/dist/chunk-IS37FHDN.mjs +33 -0
- package/dist/chunk-K4J3UUOR.mjs +178 -0
- package/dist/chunk-QNQK6QFB.mjs +71 -0
- package/dist/context/audio-context.d.mts +0 -24
- package/dist/context/audio-context.d.ts +0 -24
- package/dist/index.d.mts +2 -8
- package/dist/index.d.ts +2 -8
- package/dist/index.js +285 -680
- package/dist/index.mjs +8 -43
- package/dist/livekit/integration.d.mts +3 -7
- package/dist/livekit/integration.d.ts +3 -7
- package/dist/livekit/integration.js +280 -626
- package/dist/livekit/integration.mjs +7 -8
- package/dist/noise-suppression/deepfilternet-node.d.mts +12 -0
- package/dist/noise-suppression/deepfilternet-node.d.ts +12 -0
- package/dist/noise-suppression/deepfilternet-node.js +57 -0
- package/dist/noise-suppression/deepfilternet-node.mjs +6 -0
- package/dist/pipeline/audio-pipeline.d.mts +2 -2
- package/dist/pipeline/audio-pipeline.d.ts +2 -2
- package/dist/pipeline/audio-pipeline.js +219 -554
- package/dist/pipeline/audio-pipeline.mjs +4 -5
- package/dist/types.d.mts +42 -257
- package/dist/types.d.ts +42 -257
- package/dist/vad/vad-node.d.mts +7 -9
- package/dist/vad/vad-node.d.ts +7 -9
- package/dist/vad/vad-node.js +47 -156
- package/dist/vad/vad-node.mjs +3 -3
- package/dist/vad/vad-state.d.mts +9 -11
- package/dist/vad/vad-state.d.ts +9 -11
- package/dist/vad/vad-state.js +50 -79
- package/dist/vad/vad-state.mjs +3 -3
- package/package.json +21 -21
- package/dist/chunk-2G2JFHJY.mjs +0 -180
- package/dist/chunk-6F2HZUYO.mjs +0 -91
- package/dist/chunk-K4YLH73B.mjs +0 -103
- package/dist/chunk-R5M2DGAQ.mjs +0 -311
- package/dist/chunk-UFKIAMG3.mjs +0 -47
- package/dist/chunk-XO6B3D4A.mjs +0 -67
- package/dist/extensibility/plugins.d.mts +0 -9
- package/dist/extensibility/plugins.d.ts +0 -9
- package/dist/extensibility/plugins.js +0 -320
- package/dist/extensibility/plugins.mjs +0 -14
- package/dist/noise-suppression/rnnoise-node.d.mts +0 -10
- package/dist/noise-suppression/rnnoise-node.d.ts +0 -10
- package/dist/noise-suppression/rnnoise-node.js +0 -101
- package/dist/noise-suppression/rnnoise-node.mjs +0 -6
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-K4YLH73B.mjs";
|
|
2
|
+
attachSpeakingDetectionToTrack
|
|
3
|
+
} from "../chunk-6BJ4XGSA.mjs";
|
|
4
|
+
import "../chunk-K4J3UUOR.mjs";
|
|
6
5
|
import "../chunk-OZ7KMC4S.mjs";
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-
|
|
6
|
+
import "../chunk-IS37FHDN.mjs";
|
|
7
|
+
import "../chunk-QNQK6QFB.mjs";
|
|
8
|
+
import "../chunk-AQ5RVY33.mjs";
|
|
10
9
|
export {
|
|
11
|
-
|
|
10
|
+
attachSpeakingDetectionToTrack
|
|
12
11
|
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DeepFilterNet3Processor } from 'deepfilternet3-noise-filter';
|
|
2
|
+
import { NoiseSuppressionConfig } from '../types.mjs';
|
|
3
|
+
import 'mitt';
|
|
4
|
+
|
|
5
|
+
interface DeepFilterNet3Node {
|
|
6
|
+
node: AudioWorkletNode;
|
|
7
|
+
processor: DeepFilterNet3Processor;
|
|
8
|
+
dispose: () => void;
|
|
9
|
+
}
|
|
10
|
+
declare function createDeepFilterNet3Node(context: AudioContext, config?: NoiseSuppressionConfig): Promise<DeepFilterNet3Node>;
|
|
11
|
+
|
|
12
|
+
export { type DeepFilterNet3Node, createDeepFilterNet3Node };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DeepFilterNet3Processor } from 'deepfilternet3-noise-filter';
|
|
2
|
+
import { NoiseSuppressionConfig } from '../types.js';
|
|
3
|
+
import 'mitt';
|
|
4
|
+
|
|
5
|
+
interface DeepFilterNet3Node {
|
|
6
|
+
node: AudioWorkletNode;
|
|
7
|
+
processor: DeepFilterNet3Processor;
|
|
8
|
+
dispose: () => void;
|
|
9
|
+
}
|
|
10
|
+
declare function createDeepFilterNet3Node(context: AudioContext, config?: NoiseSuppressionConfig): Promise<DeepFilterNet3Node>;
|
|
11
|
+
|
|
12
|
+
export { type DeepFilterNet3Node, createDeepFilterNet3Node };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/noise-suppression/deepfilternet-node.ts
|
|
21
|
+
var deepfilternet_node_exports = {};
|
|
22
|
+
__export(deepfilternet_node_exports, {
|
|
23
|
+
createDeepFilterNet3Node: () => createDeepFilterNet3Node
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(deepfilternet_node_exports);
|
|
26
|
+
var import_deepfilternet3_noise_filter = require("deepfilternet3-noise-filter");
|
|
27
|
+
async function createDeepFilterNet3Node(context, config) {
|
|
28
|
+
const processorConfig = {
|
|
29
|
+
sampleRate: context.sampleRate,
|
|
30
|
+
noiseReductionLevel: config?.noiseReductionLevel ?? 60
|
|
31
|
+
};
|
|
32
|
+
if (config?.assetConfig) {
|
|
33
|
+
processorConfig.assetConfig = config.assetConfig;
|
|
34
|
+
}
|
|
35
|
+
const processor = new import_deepfilternet3_noise_filter.DeepFilterNet3Processor(processorConfig);
|
|
36
|
+
await processor.initialize();
|
|
37
|
+
const node = await processor.createAudioWorkletNode(context);
|
|
38
|
+
const enabled = config?.enabled ?? true;
|
|
39
|
+
if (!enabled) {
|
|
40
|
+
processor.setNoiseSuppressionEnabled(false);
|
|
41
|
+
}
|
|
42
|
+
return {
|
|
43
|
+
node,
|
|
44
|
+
processor,
|
|
45
|
+
dispose: () => {
|
|
46
|
+
try {
|
|
47
|
+
processor.destroy();
|
|
48
|
+
} catch (error) {
|
|
49
|
+
console.error("Failed to dispose DeepFilterNet3 processor", error);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
55
|
+
0 && (module.exports = {
|
|
56
|
+
createDeepFilterNet3Node
|
|
57
|
+
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LivekitSpeakingOptions, AudioPipelineHandle } from '../types.mjs';
|
|
2
2
|
import 'mitt';
|
|
3
3
|
|
|
4
|
-
declare function createAudioPipeline(sourceTrack: MediaStreamTrack, config?:
|
|
4
|
+
declare function createAudioPipeline(sourceTrack: MediaStreamTrack, config?: LivekitSpeakingOptions): Promise<AudioPipelineHandle>;
|
|
5
5
|
|
|
6
6
|
export { createAudioPipeline };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LivekitSpeakingOptions, AudioPipelineHandle } from '../types.js';
|
|
2
2
|
import 'mitt';
|
|
3
3
|
|
|
4
|
-
declare function createAudioPipeline(sourceTrack: MediaStreamTrack, config?:
|
|
4
|
+
declare function createAudioPipeline(sourceTrack: MediaStreamTrack, config?: LivekitSpeakingOptions): Promise<AudioPipelineHandle>;
|
|
5
5
|
|
|
6
6
|
export { createAudioPipeline };
|