From 2517307ffcf738720bfd7aa2da09f0a87b0695ae Mon Sep 17 00:00:00 2001 From: YasinOnm08 Date: Thu, 26 Sep 2024 09:37:33 +0200 Subject: [PATCH] voice recognition trial 3 --- app/backend/voice_backend.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/app/backend/voice_backend.ts b/app/backend/voice_backend.ts index f5cc97f..d2466c2 100644 --- a/app/backend/voice_backend.ts +++ b/app/backend/voice_backend.ts @@ -1,14 +1,19 @@ import axios from "axios"; + class VoiceSend { sendToVoiceRecognition(audio_data: Blob) { console.log("sending recording..."); + console.log(typeof (audio_data)); + console.log(audio_data instanceof Blob); - const dataSend = { audio:audio_data, option:"offline", recognition_type: "basic" } + + + const dataSend = { option:"offline", type: "basic",audio:audio_data } axios.post("http://localhost:5000/interstellar_ai/api/voice_recognition", dataSend) - .then((response: any) => { - console.log(response['response']) - return response['response'] + .then((response) => { + console.log(response.data) + return response.data.response }) .catch(error => { console.log("Error calling API:", error)