Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not speaking more than the first word in Mac OSX #128

Open
vishwanath1306 opened this issue Jul 16, 2018 · 1 comment
Open

Not speaking more than the first word in Mac OSX #128

vishwanath1306 opened this issue Jul 16, 2018 · 1 comment

Comments

@vishwanath1306
Copy link

vishwanath1306 commented Jul 16, 2018

Whenever I'm trying to talk more than the first word in my program, espeak doesn't seem to be working. I am using Python 3.6.0, and running the command. The code is as follows:

    delay = 200
    word_ = f"The word is {word}"
    meaning_ = f"The meaning is {meaning}"
    command1 = f"espeak -g{delay} {word_}"
    command2 = f"espeak -g{delay} {meaning_}"
    for i in range(0,3):
        os.system(command1)
        os.system(command2)

In word, if instead of The word is, I give The_word_is, it works fine.

Do help me out, or suggest if some other offline library can solve this purpose.

@valdisvi
Copy link
Contributor

If text is passed to espeak as parameter in command line, it should be written as single "single word" or 'single word" (i.e. wrapped in in single or double quotes). This example works:

#!/usr/bin/python3
import os
phrase = "This is one sentence. This is another."
command = "espeak '"+ phrase + "'"
os.system(command)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants