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)