parent
270785a21f
commit
ac0570b82c
7 changed files with 21 additions and 1 deletions
|
|
@ -804,6 +804,9 @@ async function buildAudioPipeline(rawStream) {
|
|||
const processor = new deepFilter.DeepFilterNet3Core({
|
||||
sampleRate: 48000,
|
||||
noiseReductionLevel: 70,
|
||||
assetConfig: {
|
||||
cdnUrl: resolveDeepFilterAssetsBaseUrl(),
|
||||
},
|
||||
});
|
||||
await processor.initialize();
|
||||
const workletNode = await processor.createAudioWorkletNode(ctx);
|
||||
|
|
@ -911,6 +914,13 @@ function resolveDeepFilterModuleUrl() {
|
|||
return '/static/vendor/deepfilternet3-noise-filter.esm.js';
|
||||
}
|
||||
|
||||
function resolveDeepFilterAssetsBaseUrl() {
|
||||
if (location.protocol === 'file:') {
|
||||
return new URL('./vendor/deepfilternet3', location.href).toString();
|
||||
}
|
||||
return '/static/vendor/deepfilternet3';
|
||||
}
|
||||
|
||||
async function getDeepFilterModule() {
|
||||
if (state.voice.deepFilterModule) return state.voice.deepFilterModule;
|
||||
const moduleUrl = resolveDeepFilterModuleUrl();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue