forked from React-Group/interstellar_ai
voice recognition trial 3
This commit is contained in:
parent
077b748849
commit
2517307ffc
1 changed files with 9 additions and 4 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue