0

I use this code but i get no sound can someone help me.

import pyttsx3
speaker = pyttsx3.init()
speaker.say('hello there')
speaker.runAndWait()
Wayne
  • 6,607
  • 8
  • 36
  • 93
hallo
  • 1

1 Answers1

0

This is supposed to work. If you are running it on an online IDE, like Replit, it will not work

AstroGuy
  • 56
  • 6
  • 1
    If the point of running that code was only to get text-to-speech working alongside your Python code, you can use **Jupyter online** (both classic & JupyterLab) to get your own system to speak the text by passing it via javascript to your local system's Speech synthesis, see [here](https://mindtrove.info/jupyter-tidbit-run-and-say-done/) for examples of code that works. Those approaches run in notebooks in sessions launched from the first two tiles [here at Try Jupyter](https://jupyter.org/try). – Wayne Feb 14 '22 at 20:10