Voice Assistant using Python is a versatile virtual assistant designed to automate tasks through voice commands. It enhances productivity by managing schedules, searching the web, and providing health recommendations, all while utilizing machine learning for optimal responses.
claude install kinganupamdutta27/Voice-Assistant-using-PythonVoice Assistant using Python is a versatile virtual assistant designed to automate tasks through voice commands. It enhances productivity by managing schedules, searching the web, and providing health recommendations, all while utilizing machine learning for optimal responses.
Scheduling appointments
Searching for information online
Providing weather updates
Reminding users of tasks
claude install kinganupamdutta27/Voice-Assistant-using-Pythongit clone https://github.com/kinganupamdutta27/Voice-Assistant-using-PythonCopy the install command above and run it in your terminal.
Launch Claude Code, Cursor, or your preferred AI coding agent.
Use the prompt template or examples below to test the skill.
Adapt the skill to your specific use case and workflow.
Create a Python script for a voice assistant that can perform the following tasks: [TASKS]. The assistant should use [SPEECH_RECOGNITION_LIBRARY] for voice input and [TEXT_TO_SPEECH_LIBRARY] for responses. Include error handling for common issues like network connectivity problems or unrecognized commands. The assistant should also log all interactions to a file named [LOG_FILE_NAME] for future reference.
# Voice Assistant Script
```python
import speech_recognition as sr
import pyttsx3
import datetime
import webbrowser
import os
# Initialize text-to-speech engine
engine = pyttsx3.init()
# Function to convert text to speech
def speak(text):
engine.say(text)
engine.runAndWait()
# Function to recognize speech
def recognize_speech():
recognizer = sr.Recognizer()
with sr.Microphone() as source:
print("Listening...")
audio = recognizer.listen(source)
try:
print("Recognizing...")
query = recognizer.recognize_google(audio, language='en-US')
print(f"User said: {query}\n")
return query.lower()
except Exception as e:
print("Sorry, I did not catch that.\n")
return "None"
# Main function to handle voice commands
def main():
speak("Hello! I am your voice assistant. How can I help you?")
while True:
query = recognize_speech()
if 'time' in query:
current_time = datetime.datetime.now().strftime("%H:%M")
speak(f"The current time is {current_time}")
elif 'search' in query:
speak("What would you like to search for?")
search_query = recognize_speech()
if search_query != "None":
webbrowser.open(f"https://www.google.com/search?q={search_query}")
speak(f"Searching for {search_query}")
elif 'exit' in query:
speak("Goodbye! Have a great day.")
break
else:
speak("Sorry, I did not understand that command.")
if __name__ == "__main__":
main()
```Take a free 3-minute scan and get personalized AI skill recommendations.
Take free scan