This commit is contained in:
YasinOnm08 2024-10-07 11:16:51 +02:00
parent 2e67f911c1
commit 0f610d3c18
11 changed files with 408 additions and 288 deletions

View file

@ -6,7 +6,11 @@ export const sendToVoiceRecognition = (audio_data: Blob): Promise<string> => {
formdata.append("audio", audio_data)
const apiURL = new URL("http://localhost:5000/interstellar_ai/api/voice_recognition")
apiURL.hostname = window.location.hostname;
if (typeof window !== 'undefined') {
apiURL.hostname = window.location.hostname;
} else {
apiURL.hostname = "localhost"
}
return axios.post(apiURL.href, formdata)
.then((response) => {