timgremore commited on
Commit
47f0c94
1 Parent(s): 5818959

fix: Temporarily put back sampleRate configuration

Browse files

Results without an assigned sampleRate were wrong. Temporarily assigning a sampleRate provides reasonable accuracy in webkit browsers. However, voice recording will not work in Firefox.

Files changed (1) hide show
  1. assets/js/app.js +1 -1
assets/js/app.js CHANGED
@@ -65,7 +65,7 @@ Hooks.AudioRecorder = {
65
  console.log("Starting audio recording");
66
 
67
  if (!audioContext) {
68
- audioContext = new AudioContext();
69
 
70
  await audioContext.audioWorklet.addModule("/assets/pcm-processor.js");
71
 
 
65
  console.log("Starting audio recording");
66
 
67
  if (!audioContext) {
68
+ audioContext = new AudioContext({ sampleRate: 16_000 });
69
 
70
  await audioContext.audioWorklet.addModule("/assets/pcm-processor.js");
71