From: riqo Date: Sat, 7 Nov 2020 23:04:49 +0000 (-0600) Subject: add audio analyser fft data X-Git-Tag: v0.9~141^2~4 X-Git-Url: https://andrewgundersen.net/repos?a=commitdiff_plain;h=938eaff11d21d1773d7cfcc38356926de35fb6a0;p=mime-chat add audio analyser fft data --- diff --git a/src/background.ts b/src/background.ts index 2aaec65..e07342e 100644 --- a/src/background.ts +++ b/src/background.ts @@ -19,7 +19,7 @@ import { SpeechRecorder } from "speech-recorder"; // }); // -const recorder = new SpeechRecorder(); +const recorder = new SpeechRecorder({ sampleRate: 16000, framesPerBuffer: 320 }); // Keep a global reference of the window object, if you don't, the window will // be closed automatically when the JavaScript object is garbage collected. @@ -59,7 +59,7 @@ function createWindow() { recorder.start({ onAudio: (audio: object, speech: boolean) => { if (win) { - win.webContents.send('render-audio', { data: audio }) + win.webContents.send('render-audio', audio) } if (speech) { // TODO: send audio to crimata BE diff --git a/src/components/AI/index.vue b/src/components/AI/index.vue index 02bb6a9..2afa6f1 100644 --- a/src/components/AI/index.vue +++ b/src/components/AI/index.vue @@ -9,7 +9,7 @@ gradientUnits="objectBoundingBox" > - + @@ -33,13 +33,85 @@