This application, built using React and FastAPI, provides an intuitive and efficient way to register and verify user identities through voice comparison.
- Screenshots
- Introduction
- Key Features
- Architecture
- Installation
- Usage
- API Endpoints
- Known Issues and Limitations
- Contributing
- License
- Acknowledgments
Figure 1: Adding a new user with voice sample
Figure 2: Voice comparison interface
Figure 3: User management interface
Figure 4: Deleting a User
Figure 5: Shimmer loading animation
The Voice Verification System is a modern web application that allows users to register their voice and later verify their identity through voice comparison. It combines the power of React for the frontend and FastAPI for the backend to create a seamless and efficient user experience.
π€ Voice Registration
- Users can register by providing personal information and a voice sample.
- Secure storage of user data and voice embeddings.
- Form validation ensures accurate and complete user information.
π Voice Comparison
- Compare a new voice sample against registered users.
- Receive similarity scores and verification results.
- Dimensional visualization of voice embeddings for intuitive comparison.
π₯ User Management
- Add new users through an intuitive form that has validation.
- View and manage registered users through an intuitive interface.
- Delete user profiles when necessary.
π Data Visualization
- Interactive radar chart displaying multi-dimensional voice embeddings.
- Adjustable number of dimensions for detailed analysis.
β³ Shimmer Loading
- Smooth loading animations during data fetching and processing.
- Enhances user experience by providing visual feedback on loading states.
π₯οΈ Responsive UI
- Modern, responsive design using PrimeReact components.
- Intuitive navigation between different sections of the app.
β‘ Fast and Efficient
- Utilizes Vite for rapid development and optimized builds.
- FastAPI backend for high-performance API operations.
π Advanced Audio Processing
- Leverages PyAnnote for sophisticated audio analysis and feature extraction.
ποΈ Efficient Data Storage
- Uses ChromaDB for vector storage, enabling fast similarity searches.
- SQLite database for structured data storage.
The React frontend is organized as follows:
voice-verification/
βββ public/
βββ src/
β βββ components/
β β βββ Navbar.css
β β βββ VoiceComparisonChart.jsx
β βββ pages/
β β βββ AddUserPage.jsx
β β βββ ComparePage.jsx
β β βββ UsersPage.jsx
β β βββ NotFoundPage.jsx
β βββ App.css
β βββ App.jsx
β βββ main.jsx
βββ index.html
βββ package.json
βββ package-lock.json
βββ vite.config.js
The FastAPI backend follows this structure:
backend/
βββ app/
β βββ api.py
β βββ models/
β β βββ custom_exceptions.py
β β βββ user.py
β β βββ pydantic_models.py
β βββ repositories/
β β βββ user_repository.py
β β βββ chroma_repository.py
β β βββ audio_repository.py
βββ main.py
βββ requirements.txt
To install and run the Voice Verification System, follow these steps:
-
Open two terminal windows.
-
In the first terminal:
a. Create and activate a virtual environment (recommended): Using Python's built-in venv:python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
Or using Conda:
conda create -n voice_verification python=3.9 conda activate voice_verification
b. Navigate to the backend directory:
cd backend
c. Install the Python requirements:
pip install -r requirements.txt
d. Run the backend server:
python main.py
-
In the second terminal:
a. Navigate to the voice-verification folder:cd voice-verification
b. Install the Node.js dependencies:
npm install
c. Start the development server:
npm run dev
-
Open your web browser and go to the provided link, typically:
http://localhost:5173
You should now have both the backend and frontend running, and you can access the Voice Verification System through your web browser.
- Add User: Navigate to the "Add User" page to register a new user with their voice sample.
- Compare Voice: Use the "Compare" page to record a voice sample and compare it against registered users.
- Manage Users: The "Users" page allows you to view and manage registered users.
Our Voice Verification System provides a comprehensive set of RESTful API endpoints for user management and audio processing. Below is a detailed overview of the available endpoints:
Method | Endpoint | Description |
---|---|---|
POST |
/users |
Register a new user with voice sample |
GET |
/users/{user_id} |
Retrieve a specific user's information |
PUT |
/users/{user_id} |
Update a user's information |
DELETE |
/users/{user_id} |
Delete a user |
GET |
/users |
Retrieve all registered users |
GET |
/users_with_embeddings |
Retrieve all users with their voice embeddings |
POST |
/audio/process |
Process and save a new voice sample for a user |
POST |
/audio/compare |
Compare a voice sample against a registered user |
POST /users
- Body:
multipart/form-data
name
: stringsurname
: stringemail
: stringaudio
: file (voice sample)
- Response: User object with ID
GET /users/{user_id}
- Parameters:
user_id
: integer (path parameter)
- Response: User object
PUT /users/{user_id}
- Parameters:
user_id
: integer (path parameter)
- Body: JSON
name
: stringsurname
: stringemail
: string
- Response: Updated user object
DELETE /users/{user_id}
- Parameters:
user_id
: integer (path parameter)
- Response: Success message
GET /users
- Response: Array of user objects
GET /users_with_embeddings
- Response: Array of user objects including voice embeddings
POST /audio/process
- Body:
multipart/form-data
user_id
: integerfile
: file (audio sample)
- Response: Success message
POST /audio/compare
- Body:
multipart/form-data
user_id
: integerfile
: file (voice sample to compare)
- Response: Similarity score and voice embeddings
Known issues and limitations of the project include:
- Email Uniqueness: While the system requires a unique email address for each user, it does not provide specific feedback when attempting to register with an already-used email. Instead, it returns a generic "Failed to register user" error, which may confuse users trying to sign up with an email that's already in the system.
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
-
PrimeReact for UI components
-
PyAnnote for audio processing
-
ChromaDB for vector storage
-
PyAnnote for audio processing
-
ChromaDB for vector storage