Text to spech python, Help
EricBromstead (10)

I Tried this code here:

import win32com.client as wincl
speak = wincl.Dispatch("SAPI.SpVoice")
speak.Speak("Hello World")

but I get the error:

Repl.it: package installation failure

Traceback (most recent call last):
File "python", line 1, in <module>
ModuleNotFoundError: No module named 'win32com'

This error seems to be happening in even the other text to speech repls such as https://repl.it/@Kingsley005/Python-Text-to-Speech

Any help is appreciated!

EDIT:

I Also Tried the Watson TTS thing too but that doesn't work either going to check out @basicer

You are viewing a single comment. View All
pyelias (925)

repl.it runs Linux, not Windows, so Windows modules like win32com don't work. Also, repl.it does not currently support playing sound, so if you want to run this code, you'll have to do it on your own computer.

EricBromstead (10)

@pyelias Ok well I tried the Linux one anyway: (Just in case)

import pyttsx
engine = pyttsx.init()
engine.say('Good morning.')
engine.runAndWait()

And now I get this:

Traceback (most recent call last):
File "python", line 1, in <module>
ModuleNotFoundError: No module named 'engine'

Is there a way to fix this or is there really NO WAY to get repl.it to make sounds... if so that sucks :(

amasad (1742)

@pyelias we're thinking about sounds though. @basicer had some ideas here.

EricBromstead (10)

@amasad WAIT A SECOND YOUR THE CEO. Wow! Yes I really encorage the whole sound feature, if you can't do i now that would be great in the future! I also want to thank you for making this site, Im teaching some friends how to code python on here! Thx a lot! :D

amasad (1742)

@EricBromstead thank you for using repl.it!!
We're just trying to figure out how to do it cross-platform.