import axios from "axios"; class VoiceSend { sendToVoiceRecognition(audio_data: Blob) { console.log("sending recording..."); const dataSend = { audio:audio_data, option:"offline", recognition_type: "basic" } 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;