This project consists of:
- Flask server (Python) that receives audio files, converts and transcribes them using VOSK, and estimates the number of speakers.
- React client that lets users upload audio files and view transcription and speaker count.
project-root/
├── server/
│ ├── app.py
│ ├── requirements.txt
│ └── models/
│ ├── vosk-model-en-us-0.22/
│ └── vosk-model-spk-0.4/
├── client/
│ ├── package.json
│ ├── public/
│ └── src/
└── README.md- Python 3.8+
- FFmpeg installed (Download: https://ffmpeg.org/download.html)
Make sureffmpeg.exeandffprobe.exeare located at:
C:\ffmpeg\ffmpeg\bin\
cd audio-server
pip install -r requirements.txtDownload VOSK Models:
- Download from: https://alphacephei.com/vosk/models
- Place models inside server/models/:
Run server:
python app.pyDefault server address: http://localhost:5000
Requirements: Node.js 14+
Install and run:
cd audio-client
npm install
npm startClient will run on http://localhost:3000.
Make sure the React app sends API requests to http://localhost:5000/analyze, or use a proxy in package.json.
- Endpoint: POST /analyze
- Content-Type: multipart/form-data
- Required field: file (MP3 or WAV file)
Response:
{
"status": "success",
"transcription": "hello this is a test",
"num_speakers": 2,
"duration": 9.23
}- Audio is automatically converted to mono and 16kHz.
- If speaker model is not found, the response will default to 1 speaker.
- Temporary WAV files are deleted after processing.