1

I've tried many different lines of code and can't get any output. It reads the mic just fine but won't say anything. I've been working on this for 3 days and can't get any speech out. I've also tried version 2.7 of pyttsx3 and the latest version, I"m on win 11

import speech_recognition as sr
import pyttsx3

listener = sr.Recognizer()
engine = pyttsx3.init() #I've tried "dummy" and "sapi5" also
engine.setProperty('rate', 150)
engine.setProperty('volume', 1)

engine.say("What's up")
engine.runAndWait()
sdog
  • 19
  • 1
  • 5
  • `engine.runAndWait` is a function, change it to `engine.runAndWait()`. – BrainFl Mar 08 '22 at 01:25
  • That didn't do it. Before it even get's that far it should say 'What's up" – sdog Mar 08 '22 at 01:36
  • do you get error message? You could put `print(text)` after `say()` to see if it runs after `say()`. Maybe problem is hardware - your speakers. OR maybe problem is some audio driver in system. Or maybe it needs to install some C/C++ library to play sound. – furas Mar 08 '22 at 03:36
  • Did the print and mic is working fine. Headphones work fine, I get audio from everything except this damn code. – sdog Mar 08 '22 at 14:58

0 Answers0