voice recognition trial 3

This commit is contained in:
YasinOnm08 2024-09-26 09:37:33 +02:00
parent 077b748849
commit 2517307ffc

View file

@ -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)