Edit Content

Est adipisci rutrum minim hat dolorum, nobis nonummy natoque dolores delectus magna turpis.

Build a Voice-Controlled Assistant (TTS + STT Integration)

ABC AI & Robotics Research Institute Blog 7

Overview: Combine speech recognition and TTS to create a basic voice interface assistant.

Use Case: Use with robots, kiosks, or basic home automation systems.

Working Code:

import speech_recognition as sr
import pyttsx3

r = sr.Recognizer()
engine = pyttsx3.init()

def speak(text):
    engine.say(text)
    engine.runAndWait()

with sr.Microphone() as source:
    speak("How can I help you?")
    audio = r.listen(source)
    command = r.recognize_google(audio)
    print("Command:", command)
    if "time" in command:
        speak("It is 5 PM.")

Next Step: Add more commands like “play music” or “start robot” for real functionality.

Try in Colab: Voice Assistant in Colab


About the Author

Leave a Reply

Your email address will not be published. Required fields are marked *

You may also like these