0

When I open up my command prompt, i am able to type espeak and then the text i want to be said, however when i try to do this through my python code using os it says

'espeak' is not recognized as an internal or external command, operable program or batch file.

import os
text = "Apples"
os.system('espeak "{}"'.format(text))

I've tinkered with the code a fair amount but there is not much to tinker

Trenton McKinney
  • 56,955
  • 33
  • 144
  • 158
Mark.B
  • 31
  • 1
  • 5

1 Answers1

1

try /usr/bin/espeak instead of espeak. That works for my machine.

In order to be sure it works for your host I suggest you open a console and type

type espeak

This will output the absolute path of espeak. Copy that one into your system command

gelonida
  • 5,327
  • 2
  • 23
  • 41