Skip to content

Voice Verification System: A web app built using PrimeReact, FastAPI, ChromaDB and PyAnnote-Audio for registering and verifying user identities through voice comparison. Features include voice registration, comparison, user management, and embedding visualization.

Notifications You must be signed in to change notification settings

esammahdi/Voice-Verification

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

10 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

voice verification system logo

Voice Verification System

πŸŽ™οΈ A Simple Yet Powerful Voice Identity Verification Application

This application, built using React and FastAPI, provides an intuitive and efficient way to register and verify user identities through voice comparison.

License Latest release React FastAPI

Frontend:
react PrimeReact Vite

Backend:
fastapi PyAnnote

Database:

sqlite chroma

Programming Languages:

python javascript html5 css3


Table of Contents

Screenshots

Add User Page with Validation

Figure 1: Adding a new user with voice sample

Compare Page with Results

Figure 2: Voice comparison interface

Users Page

Figure 3: User management interface

User Deletion

Figure 4: Deleting a User

Shimmer Loading

Figure 5: Shimmer loading animation

Introduction

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.

Key Features

🎀 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.

Architecture

Frontend Structure

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

Backend Structure

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

Installation

To install and run the Voice Verification System, follow these steps:

  1. Open two terminal windows.

  2. 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
  3. 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
  4. 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.

Usage

  1. Add User: Navigate to the "Add User" page to register a new user with their voice sample.
  2. Compare Voice: Use the "Compare" page to record a voice sample and compare it against registered users.
  3. Manage Users: The "Users" page allows you to view and manage registered users.

API Endpoints

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

Detailed Endpoint Descriptions

Register a New User

POST /users
  • Body: multipart/form-data
    • name: string
    • surname: string
    • email: string
    • audio: file (voice sample)
  • Response: User object with ID

Retrieve a Specific User

GET /users/{user_id}
  • Parameters:
    • user_id: integer (path parameter)
  • Response: User object

Update a User

PUT /users/{user_id}
  • Parameters:
    • user_id: integer (path parameter)
  • Body: JSON
    • name: string
    • surname: string
    • email: string
  • Response: Updated user object

Delete a User

DELETE /users/{user_id}
  • Parameters:
    • user_id: integer (path parameter)
  • Response: Success message

Retrieve All Users

GET /users
  • Response: Array of user objects

Retrieve Users with Embeddings

GET /users_with_embeddings
  • Response: Array of user objects including voice embeddings

Process Audio

POST /audio/process
  • Body: multipart/form-data
    • user_id: integer
    • file: file (audio sample)
  • Response: Success message

Compare Voice Sample

POST /audio/compare
  • Body: multipart/form-data
    • user_id: integer
    • file: file (voice sample to compare)
  • Response: Similarity score and voice embeddings

Known Issues and Limitations

Known issues and limitations of the project include:

  1. 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.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

About

Voice Verification System: A web app built using PrimeReact, FastAPI, ChromaDB and PyAnnote-Audio for registering and verifying user identities through voice comparison. Features include voice registration, comparison, user management, and embedding visualization.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published