From 1664c2c62de97f0064557de89d068b1901bbdc38 Mon Sep 17 00:00:00 2001 From: "arjxn.py" Date: Sat, 30 Sep 2023 20:26:10 +0530 Subject: [PATCH] Fix getaudio error --- src/components/Video/translatedAudio.tsx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/components/Video/translatedAudio.tsx b/src/components/Video/translatedAudio.tsx index 19df04d..2ac82eb 100644 --- a/src/components/Video/translatedAudio.tsx +++ b/src/components/Video/translatedAudio.tsx @@ -4,17 +4,19 @@ import { Button } from 'rsuite'; import { useParams } from 'react-router-dom'; const TranslatedAudio = () => { - const [audio, setAudio] = useState(undefined); // Specify the type of audio state - const { vidId } = useParams<{ vidId: string }>(); // Define the type for vidId + const [audio, setAudio] = useState(undefined); + const { vidId } = useParams<{ vidId: string }>(); const GETKEY = process.env.REACT_APP_DOWN; const gts = async () => { - const API_ENDPOINT = `${GETKEY}/${vidId}`; // Correct the URL format + const API_ENDPOINT = `${GETKEY}${vidId}`; try { - const response = await axios.get(API_ENDPOINT, { - responseType: 'blob', - }); + const response = await axios({ + method: 'GET', + url: API_ENDPOINT, + responseType: 'blob' + }) console.log('Response: ', response); const blobUrl = URL.createObjectURL(response.data);