Aizen is a Python-based voice assistant that listens for commands via your microphone, performs various tasks, and provides spoken responses using text-to-speech. It uses the Google Gemini API to handle unrecognized commands or general queries.
- Voice Activation: Uses wake words (e.g., "Hey Aizen", "Aizen") to start listening for commands.
- Open Applications & Websites: Opens installed applications (via system PATH) or specified websites (e.g., "open notepad", "open google.com").
- Close Applications: Attempts to close running applications using
taskkill(Windows only). - Web Search: Performs Google searches (e.g., "search for python tutorials").
- Youtube: Opens Youtube results for specified queries (e.g., "play relaxing music").
- Weather Information: Fetches weather details for a location via Google search (e.g., "weather in India").
- Time & Date: Reports the current time and date.
- News Headlines: Opens Google News for the latest headlines.
- Jokes: Tells programming jokes using the
pyjokeslibrary. - AI Integration: Leverages Google Gemini API (
gemini-1.5-flash-latest) to understand and respond to commands not explicitly programmed. - Text-to-Speech: Provides audible responses to commands and queries.
- Python 3.x
pip(Python package installer)- Git (for cloning the repository)
- A working microphone connected and configured on your system.
- (Potentially) System libraries for audio I/O, such as PortAudio (often required by PyAudio). If
pip install PyAudiofails, search for instructions specific to your OS (Windows/macOS/Linux).
-
Clone or Fork the Repository:
- Fork this repository on GitHub and clone your fork, OR
- Clone this repository directly:
git clone https://github.com/anjalisah89/aizen-voice-assistant.git cd aizen-voice-assistant
-
Create and Activate a Virtual Environment:
-
It's highly recommended to use a virtual environment to manage dependencies.
-
Windows (PowerShell):
python -m venv .venv .\.venv\Scripts\Activate.ps1 -
Windows (Command Prompt):
python -m venv .venv .\.venv\Scripts\activate.bat
-
Linux / macOS (Bash/Zsh):
python3 -m venv .venv source .venv/bin/activate -
Confirm Activation: Your terminal prompt should now be prefixed with
(.venv), like this:(.venv) PS C:\Users\YourUser\Path\To\Project>
-
-
Install Dependencies:
- Ensure you have a
requirements.txtfile (as shown above) in your project directory. - Install the required packages:
pip install -r requirements.txt
- Ensure you have a
-
Set Up Google Gemini API Key:
- Generate a Google Gemini API key. Follow the official instructions: Google AI Setup Guide
- Create a file named
.envin the root directory of the project. - Add your API key to the
.envfile like this:GEMINI_API_KEY=YOUR_ACTUAL_API_KEY
- Replace
YOUR_ACTUAL_API_KEYwith your real key. - Important: Add
.envto your.gitignorefile to avoid accidentally committing your secret key.
-
Run the Assistant:
- Make sure your virtual environment is activated.
- Navigate to the project directory in your terminal.
- Run the Python script (assuming your file is named
main.py, rename if necessary):python main.py
- You'll be greeted with:
Aizen: Initializing Aizen... Aizen: Hey there, I am Aizen. How can I help you today?
-
Interact with Aizen:
- The script will initialize ("Initializing Aizen...").
- It will then listen for a wake word ("Listening for wake word...").
- Say one of the wake words (e.g., "Hey Aizen", "Aizen").
- Aizen will respond ("Yeah, I'm here!") and start listening for your command ("Listening for your command...").
- State your command clearly (e.g., "What time is it?", "Open Firefox", "Tell me a joke", "Search for Python tutorials", "Play music", "Weather in Delhi", "Any other Commands").
- Aizen will process the command and respond. After processing, it will go back to listening for the wake word.
- To stop the assistant, say "stop", "exit", or "goodbye".
- The "close application" feature uses the
taskkillcommand and is only functional on Windows. - Application opening (
os.startfile) behavior might differ slightly across operating systems. - Microphone access and TTS engine performance can vary depending on your OS and hardware setup.