forked from React-Group/interstellar_ai
22 lines
No EOL
610 B
TypeScript
22 lines
No EOL
610 B
TypeScript
import axios from "axios";
|
|
|
|
class VoiceSend {
|
|
sendToVoiceRecognition(audio_data: Blob) {
|
|
console.log("sending recording...");
|
|
|
|
const dataSend = { 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; |