【发布时间】:2022-08-02 19:19:33
【问题描述】:
enter code here
sr = s.Recognizer()
print(\'\'\' listening...
speak the first card\'\'\')
with s.Microphone() as m:
audio = sr.listen(m)
query = sr.recognize_google(audio, language=\'eng-in\')
first_card = input(\"Enter the first card: \")
second_card = input(\"Enter the second card: \")
third_card = input(\"Enter the third card: \")
fourth_card = input(\"Enter the fourth card: \")
print(\"the upnext cards are\", fourth_card, third_card, second_card, first_card)
我希望用户语音输入第一张卡,第二张卡等等,而不是用键盘输入它们。
标签: python input speech-recognition