Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix getaudio error #42

Merged
merged 1 commit into from
Sep 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions src/components/Video/translatedAudio.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,19 @@ import { Button } from 'rsuite';
import { useParams } from 'react-router-dom';

const TranslatedAudio = () => {
const [audio, setAudio] = useState<string | undefined>(undefined); // Specify the type of audio state
const { vidId } = useParams<{ vidId: string }>(); // Define the type for vidId
const [audio, setAudio] = useState<string | undefined>(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);
Expand Down
Loading