diff --git a/client/src/Pages/LandingPage.tsx b/client/src/Pages/LandingPage.tsx index 171483d..6bd96b4 100644 --- a/client/src/Pages/LandingPage.tsx +++ b/client/src/Pages/LandingPage.tsx @@ -1,25 +1,31 @@ import { useNavigate } from 'react-router-dom'; -import { - Typography, - Container, - Button, - Paper, - Box, - Card, - CardContent, - Grid, - useTheme +import { + Typography, + Container, + Button, + Paper, + Box, + Card, + CardContent, + Grid, + useTheme, + Slide, + Zoom, } from '@mui/material'; -import { - CloudUpload as CloudUploadIcon, +import { + CloudUpload as CloudUploadIcon, PlayArrow as PlayArrowIcon, - Check as CheckIcon + Check as CheckIcon, + GraphicEq as GraphicEqIcon, + NoiseAware as NoiseAwareIcon, + MusicNote as MusicNoteIcon, } from '@mui/icons-material'; function LandingPage() { const navigate = useNavigate(); const theme = useTheme(); - + const showContent = true; + return ( - - - Welcome to FreqSplit - - - Upload, preview, and process your audio files with ease - - - - - - - + + + + Welcome to FreqSplit + + + Upload, preview, and process your audio files with ease + + + + + + + + - - - - - Easy Upload - - - Drag and drop your media files for quick processing - - - + + + + + + Upload or Record + + + Drag and drop your media files or record directly for quick processing. + + + + - - - - - Preview Media - - - Review your files before processing - - - + + + + + + Preview Media + + + Review your files before processing. + + + + - - - - - View Results - - - Download and share your processed media - - - + + + + + + View Results + + + Download and share your processed media. + + + + + + + + + + + + + Audio Source Separation (Demucs) + + + Separate audio sources with state-of-the-art Demucs. + + + + + + + + + + + + Noise Reduction (DeepFilterNet) + + + Reduce noise effectively using DeepFilterNet. + + + + + + + + + + + + Audio Processing (Librosa) + + + Advanced audio processing and manipulation with Librosa. + + + + diff --git a/client/src/Pages/UploadPage.tsx b/client/src/Pages/UploadPage.tsx index 4982a20..0de6821 100644 --- a/client/src/Pages/UploadPage.tsx +++ b/client/src/Pages/UploadPage.tsx @@ -13,7 +13,8 @@ import { } from "@mui/material"; import { CloudUpload as CloudUploadIcon, - VolumeUp as VolumeUpIcon, + Mic as MicIcon, + Stop as StopIcon } from "@mui/icons-material"; import StepperComponent from "../components/StepperComponent"; import { useWebSocket } from "../contexts/WebSocketContext"; @@ -29,6 +30,46 @@ function UploadPage() { const [isDragging, setIsDragging] = useState(false); const [upload, setUpload] = useState(false); const [inputEnabled, setInputEnabled] = useState(false); + const [isRecording, setIsRecording] = useState(false); + const [mediaRecorder, setMediaRecorder] = useState(null); + + const startRecording = async () => { + setUpload(false); + setResponse({ + audio_class: "", + file_uuid: "", + sr: 0, + spectrogram: "", + spec_sr: 0 + }); + try { + const stream = await navigator.mediaDevices.getUserMedia({ audio: true }); + const recorder = new MediaRecorder(stream); + setMediaRecorder(recorder); + + const chunks: Blob[] = []; + recorder.ondataavailable = (e) => chunks.push(e.data); + recorder.onstop = () => { + const blob = new Blob(chunks, { type: "audio/wav" }); + const file = new File([blob], "recording.wav", { type: "audio/wav" }); + validateAndSetFile(file); + handleUpload(file); + }; + + recorder.start(); + setIsRecording(true); + } catch (error) { + console.error("Failed to start recording:", error); + showErrorToast("Failed to start recording"); + } + }; + + const stopRecording = () => { + if (mediaRecorder) { + mediaRecorder.stop(); + setIsRecording(false); + } + }; const showErrorToast = (message: string) => { setToastMessage(message); @@ -220,8 +261,52 @@ function UploadPage() { - Upload Your Media + Upload or Record Your Media + document.getElementById("fileInput")?.click()} + > + + + + {file ? file.name : "Drop your file here or click to browse files"} + + Supported formats: MP3, WAV, AAC, OGG + document.getElementById("fileInput")?.click()} > - - - - - {file ? file.name : "Drop your file here or click to browse files"} - - - Max file size: 100MB - - {file && ( - - {file.type.includes("audio") ? : null} - {file.type} - {(file.size / (1024 * 1024)).toFixed(2)} MB - - )} + -