当我在 python 脚本下运行时,它显示一些错误。
a="Item,name,1Item,name,2"
b=a.split(",")
c=b.reduce((accumulator, currentValue, currentIndex, array) =>{
return currentIndex % 2 ?(accumulator + " " + currentValue) :(accumulator + "," + currentValue)
})
console.log(c)
//Item name,1Item name,2
我尝试了几乎所有在线可用的解决方案,但仍然没有解决我的问题。 命令行中的错误信息是:
import speech_recognition as s
sr=s.Recognizer()
print("Please, speak now....")
with s.Microphone() as m:
audio=sr.listen(m)
query=sr.recognize_google(audio,language='eng-in')
print(query)
但是当我在 jupyter-notebook 或 Pycharm 上运行这个 python 脚本时,它没有显示任何错误,但仍然没有从麦克风获取任何输入(但麦克风启动),也没有显示任何输出。