Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Use literal path in audioWorklet.addModule for compatibility with Web…
Browse files Browse the repository at this point in the history
…pack 5
  • Loading branch information
Johennes committed Nov 9, 2023
1 parent 47a4e4a commit 689cea2
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/audio/VoiceRecording.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 689cea2

Please sign in to comment.