Skip to content

A simple Python-based voice assistant that listens for spoken commands and performs common tasks such as telling the time, opening websites, and playing music.

Notifications You must be signed in to change notification settings

MaryvilleUniversity-AI/python-voice-assistant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Python Voice Assistant

A simple voice-controlled desktop assistant built in Python using the 'speech-recognition' library. This assistant listens for your voice commands, responds in real time, and performs tasks such as opening websites, telling the time, and playing music.

Features

  • Always listening using background speech recognition
  • Tells the current time
  • Opens popular websites (Google, YouTube, Wikipedia)
  • ** Plays music on YouTube**
  • Basic text responses (can be upgraded to text-to-speech)
  • Stops on command ("stop", "exit", or "goodbye")

How It Works

  1. The program uses the Google Speech Recognition API to convert your voice into text.
  2. It continuously listens in the background using 'listen_in_background()' from the 'speech_recognition' module.
  3. When it detects a command, it processes the text and performs the corresponding action, like opening a browser or printing a message.

Requirements

Make sure you have Python 3.8+ installed, then install these dependencies:

pip install SpeechRecognition
pip install PyAudio

Example Commands

  • "What time is it?" = Tells the current time
  • "Open Google" = Opens Google in browser
  • "Open Wikipedia" = Opens Wikipedia main page
  • "Open YouTube" = Open YouTube
  • "Play music" = Opens a preset YouTube song
  • "Stop"/"Exit"/"Goodbye" = Closes the program

Project Structure

voice-assistant/
│
├── assistant.py        # Main Python program
├── README.md           # Project documentation
└── requirements.txt    # Dependencies list

Running the Program

  1. Clone the Repository:
git clone https://github.com/your-username/voice-assistant.git
cd voice-assistant
  1. Install dependencies:
pip install -r requirements.txt
  1. Run the assistant:
python assistant.py

About

A simple Python-based voice assistant that listens for spoken commands and performs common tasks such as telling the time, opening websites, and playing music.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages