How nathang15/voice-recognition-authentication-system works
Project type and purpose
• This is a standalone, AI-based voice authentication CLI tool written in Python.
• Purpose: allow users to register and log in by speaking a username and passphrase, rather than typing credentials.
File structure
• Top-level directory “Code/” contains 6 modules:
• credentials_setting.py (handles reading/writing user credentials)
• hash_salt.py (wraps bcrypt hashing and salting)
• main.py (orchestrates the overall flow)
• system_speak.py (text-to-speech operations via pyttsx3)
• user_setup.py (registration flow)
• verification.py (login/verification flow)
• No web server or frontend framework—pure Python CLI.
• External dependencies are captured in README: Whisper (speech-to-text), pyttsx3 (text-to-speech), bcrypt (password hashing).
README for additional insights
• The system loops through a Q&A flow: TTS prompts → user speaks → Whisper transcribes → business logic (register/verify) → hash & store or compare against stored hash → TTS feedback.
• Credentials are stored locally (e.g., file or simple database).
Main components & their interactions
a. Components:
• Audio Input (microphone)
• Speech Recognition Module (OpenAI Whisper)
• Business Logic Layer
– Registration Service (user_setup.py + credentials_setting.py)
– Verification Service (verification.py + hash_salt.py)
• Data Storage (local credential store)
• Text-to-Speech Module (system_speak.py using pyttsx3)
• Orchestrator (main.py)
b. Data flows:
• Orchestrator → TTS prompts → Audio Input → Whisper → text
• Text → Business Logic → hashing/DB read-write → result
• Result → Orchestrator → TTS feedback → user
c. Architectural patterns:
• Pipeline style: audio in → recognition → logic → storage → TTS out
• Separation of concerns: speech I/O, hashing, storage, orchestration are in separate modules.
d. Key technologies:
• whisper (speech-to-text)
• pyttsx3 (text-to-speech)
• bcrypt (secure hash & salt)
• Python standard library (file I/O / CLI)
Detailed breakdown for the engineer
• Inside it, arrange horizontally:
[ User ] → (mic) → [ Whisper STT ] → [ Orchestrator (main.py) ] → branching to
├─ [ Registration Flow (user_setup.py + credentials_setting.py) ]
└─ [ Verification Flow (verification.py + hash_salt.py) ]
Both flows interact with → [ Local Credential Store ]
Orchestrator also → [ TTS (system_speak.py) ] → (speaker) → back to User
• Side note: “Whisper model is loaded at startup; bcrypt salts stored per-user.”