voice recorder (WIP)

This commit is contained in:
Patrick_Pluto 2024-09-25 12:33:52 +02:00
parent 2c72090de4
commit 16177ccacc
2 changed files with 74 additions and 2 deletions

View file

@ -0,0 +1,28 @@
import axios from "axios";
class VoiceSend {
voiceDataTemplate = {
type: "basic",
audio_data: null,
option: "offline"
}
sendToVoiceRecognition(audio_data: Blob, data: any) {
var dataSend = data
dataSend['audio_data'] = audio_data
axios.post("http://localhost:5000/interstellar_ai/api/voice_recognition", dataSend)
.then((response: any) => {
console.log(response['response'])
return response['response']
})
.catch(error => {
console.log("Error calling API:", error)
postMessage({ status: 500 })
})
}
}
export default VoiceSend;