Tuesday, January 22, 2019

speech recognition

its 11pm and I found something interesting, this time I tried to implement speech recognition.

actually, its very easy

1. pip install SpeechRecognition
2. conda install -c anaconda pyaudio
3. the code

import speech_recognition as sr

r = sr.Recognizer()

with sr.Microphone() as source:
print('Speak anything:')
audio = r.listen(source)

try:
text = r.recognize_google(audio)
print('you said: {}'.format(text))
except:
print('sorry could not recognize your voice...')


4. run it! so simple. Eureka!


reference:
https://www.youtube.com/watch?v=K_WbsFrPUCk
https://realpython.com/python-speech-recognition/

No comments:

Post a Comment

free online comma separating tool

https://delim.co/#