Compare commits
2 commits
b7416c7c2b
...
6f9c24ac60
| Author | SHA1 | Date | |
|---|---|---|---|
| 6f9c24ac60 | |||
| 539e2a4ab8 |
2 changed files with 20 additions and 6 deletions
|
|
@ -23,7 +23,7 @@ const state = {
|
||||||
muted: false,
|
muted: false,
|
||||||
sharingVideo: false,
|
sharingVideo: false,
|
||||||
sharingScreen: false,
|
sharingScreen: false,
|
||||||
noiseFilterMode: 'deepfilter',
|
noiseFilterMode: 'off',
|
||||||
activeNoiseFilter: 'off',
|
activeNoiseFilter: 'off',
|
||||||
deepFilterProcessor: null,
|
deepFilterProcessor: null,
|
||||||
deepFilterModule: null,
|
deepFilterModule: null,
|
||||||
|
|
@ -805,8 +805,15 @@ async function buildAudioPipeline(rawStream) {
|
||||||
sampleRate: 48000,
|
sampleRate: 48000,
|
||||||
noiseReductionLevel: 70,
|
noiseReductionLevel: 70,
|
||||||
});
|
});
|
||||||
await processor.initialize();
|
const timeoutMs = 2500;
|
||||||
const workletNode = await processor.createAudioWorkletNode(ctx);
|
const withTimeout = (promise, label) =>
|
||||||
|
Promise.race([
|
||||||
|
promise,
|
||||||
|
new Promise((_, reject) => setTimeout(() => reject(new Error(`${label} timed out`)), timeoutMs)),
|
||||||
|
]);
|
||||||
|
|
||||||
|
await withTimeout(processor.initialize(), "DeepFilter initialize");
|
||||||
|
const workletNode = await withTimeout(processor.createAudioWorkletNode(ctx), "DeepFilter worklet");
|
||||||
processor.setNoiseSuppressionEnabled(true);
|
processor.setNoiseSuppressionEnabled(true);
|
||||||
state.voice.deepFilterProcessor = processor;
|
state.voice.deepFilterProcessor = processor;
|
||||||
source.connect(workletNode);
|
source.connect(workletNode);
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ const state = {
|
||||||
muted: false,
|
muted: false,
|
||||||
sharingVideo: false,
|
sharingVideo: false,
|
||||||
sharingScreen: false,
|
sharingScreen: false,
|
||||||
noiseFilterMode: 'deepfilter',
|
noiseFilterMode: 'off',
|
||||||
activeNoiseFilter: 'off',
|
activeNoiseFilter: 'off',
|
||||||
deepFilterProcessor: null,
|
deepFilterProcessor: null,
|
||||||
deepFilterModule: null,
|
deepFilterModule: null,
|
||||||
|
|
@ -767,8 +767,15 @@ async function buildAudioPipeline(rawStream) {
|
||||||
sampleRate: 48000,
|
sampleRate: 48000,
|
||||||
noiseReductionLevel: 70,
|
noiseReductionLevel: 70,
|
||||||
});
|
});
|
||||||
await processor.initialize();
|
const timeoutMs = 2500;
|
||||||
const workletNode = await processor.createAudioWorkletNode(ctx);
|
const withTimeout = (promise, label) =>
|
||||||
|
Promise.race([
|
||||||
|
promise,
|
||||||
|
new Promise((_, reject) => setTimeout(() => reject(new Error(`${label} timed out`)), timeoutMs)),
|
||||||
|
]);
|
||||||
|
|
||||||
|
await withTimeout(processor.initialize(), "DeepFilter initialize");
|
||||||
|
const workletNode = await withTimeout(processor.createAudioWorkletNode(ctx), "DeepFilter worklet");
|
||||||
processor.setNoiseSuppressionEnabled(true);
|
processor.setNoiseSuppressionEnabled(true);
|
||||||
state.voice.deepFilterProcessor = processor;
|
state.voice.deepFilterProcessor = processor;
|
||||||
source.connect(workletNode);
|
source.connect(workletNode);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue