Python 如何在文本转换为语音时打印
我希望我的python程序在将文本转换为语音的过程中打印,但在说话后获取输入需要一段时间。。。请提出任何想法(:Python 如何在文本转换为语音时打印,python,text-to-speech,Python,Text To Speech,我希望我的python程序在将文本转换为语音的过程中打印,但在说话后获取输入需要一段时间。。。请提出任何想法(: 你可以把演讲变成一条线索。 import pyttsx3 import math speaker = pyttsx3.init() speaker.say("Enter operator") speaker.runAndWait() print("Valid Operators:\n" "type \"a
你可以把演讲变成一条线索。
import pyttsx3
import math
speaker = pyttsx3.init()
speaker.say("Enter operator")
speaker.runAndWait()
print("Valid Operators:\n"
"type \"add\" for adding\n"
"type \"subtract\" for subtracting\n"
"type \"divide\" for dividing\n"
"type \"multiply\" for multiplying\n"
"type \"Square root\" for square-root\n"
"type \"Square\" for square of a number\n")
op = input("Enter your operator:\n")
import pyttsx3
import math
import threading
speaker = pyttsx3.init()
def say_thread(s):
speaker.say(s)
speaker.runAndWait()
def say(s)
x = threading.Thread(target=say_thread, args=("Enter operation",))
x.start()
say( "Enter operation" )
print("Valid Operators:\n"
"type \"add\" for adding\n"
"type \"subtract\" for subtracting\n"
"type \"divide\" for dividing\n"
"type \"multiply\" for multiplying\n"
"type \"Square root\" for square-root\n"
"type \"Square\" for square of a number\n")
op = input("Enter your operator:\n")```