From 689cea2f061120070f3db405289bd9ded108def5 Mon Sep 17 00:00:00 2001 From: Johannes Marbach Date: Thu, 9 Nov 2023 16:50:56 +0100 Subject: [PATCH] Use literal path in audioWorklet.addModule for compatibility with Webpack 5 --- src/audio/VoiceRecording.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/audio/VoiceRecording.ts b/src/audio/VoiceRecording.ts index 2e1f5634fbe..e92f732c5cc 100644 --- a/src/audio/VoiceRecording.ts +++ b/src/audio/VoiceRecording.ts @@ -28,7 +28,6 @@ import { UPDATE_EVENT } from "../stores/AsyncStore"; import { createAudioContext } from "./compat"; import { FixedRollingArray } from "../utils/FixedRollingArray"; import { clamp } from "../utils/numbers"; -import mxRecorderWorkletPath from "./RecorderWorklet"; const CHANNELS = 1; // stereo isn't important export const SAMPLE_RATE = 48000; // 48khz is what WebRTC uses. 12khz is where we lose quality. @@ -129,7 +128,7 @@ export class VoiceRecording extends EventEmitter implements IDestroyable { if (this.recorderContext.audioWorklet) { // Set up our worklet. We use this for timing information and waveform analysis: the // web audio API prefers this be done async to avoid holding the main thread with math. - await this.recorderContext.audioWorklet.addModule(mxRecorderWorkletPath); + await this.recorderContext.audioWorklet.addModule("./RecorderWorklet"); this.recorderWorklet = new AudioWorkletNode(this.recorderContext, WORKLET_NAME); this.recorderSource.connect(this.recorderWorklet); this.recorderWorklet.connect(this.recorderContext.destination);