How pingakshgaur/desktop-assistant-scai works
Project Type and Purpose
• Type: Stand-alone desktop utility (monolithic Python application).
• Purpose: Voice-controlled assistant that listens for user commands and automates tasks—web searches, app launches, system cleanup, email, music playback, etc.
File Structure
• Top-level script: scai-d.py – orchestrates all features.
• SFX/ – WAV files for interaction sounds (system ready, exit, etc.).
• Config files: REQUIREMENTS.md implied dependencies; no separate module directories.
Key Architectural Components
From the README and code references, these logical modules emerge:
a. Input Layer
– Microphone → speech_recognition library
b. Pre-Processing & Command Parser
– Text normalization, “Hey SCAI” wake-word detection
c. Core Engine (Dispatcher)
– Maps parsed commands to actions
d. Action Modules
1. Text-to-Speech (pyttsx3)
2. Sound Effects Player (winsound or winsound wrapper)
3. Web Automator (webbrowser + pyautogui for clicks/scrolls)
4. Application Controller (pyautogui + os.startfile)
5. System Manager (os, shutil for temp files; send2trash)
6. Email Sender (smtplib, email)
7. Wikipedia Fetcher (wikipedia API)
8. Date/Time/Weather (datetime + external weather API if any)
e. External Services
– Gmail SMTP
– Wikipedia API
– Web search engines (Google, YouTube)
f. Data Store
– None persistent; configuration constants (file paths, voice settings) in code
Relationships & Data Flow
• Microphone audio → Speech Recognition → Text
• Text → Command Parser → Action Identification
• Action → One of Action Modules → System or External Service
• Action Module → Output → TTS + Sound Effects → Speaker
Architectural Patterns & Principles
• Single-process, event‐driven dispatcher
• Modular separation: Input, Parser, Dispatcher, Action Handlers
• External integration via standard Python libraries
• Configuration through constants at top of script