Thư viện nhận dạng giọng nói
-
mn cho e hỏi : chương trình chuyển giọng nói thành văn bản , e đã đọc qua nhiều tài liệu , nhưng vẫn không chạy đc , e nghĩ do không nhận micro , có cách nào không ak , thanks
đây là code ạ :
import speech_recognition
speech_identifier = speech_recognition.Recognizer()def phrase():
with speech_recognition.Microphone(device_index=1) as source: speech_identifier.adjust_for_ambient_noise(source) audio = speech_identifier.listen(source) try: return speech_identifier.recognize_google(audio , language = 'vi-VN') except : print("I'm waiting for your command") return " "
while 1:
str=phrase()
#say(str)
print (str)
-
@nguyễn-văn-cường đã nói trong Thư viện nhận dạng giọng nói:
import speech_recognition
speech_identifier = speech_recognition.Recognizer()
def phrase():
with speech_recognition.Microphone(device_index=1) as source:
speech_identifier.adjust_for_ambient_noise(source)
audio = speech_identifier.listen(source)try: return speech_identifier.recognize_google(audio , language = 'vi-VN') except : print("I'm waiting for your command") return " "
while 1:
str=phrase()
#say(str)
print (str)Chào bạn,
Chương trình chạy ngon lành bạn nhé.
http://prntscr.com/kdmtsw
-
@khanhnnvn , uk cảm ơn ban , mình cũng vừa chạy đc , nhưng có cách nào để cải thiện tốc độ không vậy , việc xử lí khá lâu , nếu được thì có thư viện hay api nào nhanh hơn k ạ, thanks