Showing posts with label speech recognition. Show all posts
Showing posts with label speech recognition. Show all posts

Wednesday, January 23, 2019

python text to speech and this is awesome

pip install pyttsx3
pip install pypiwin32

the code:

import pyttsx3;
engine = pyttsx3.init();
engine.say("My wife is Sheryl and my two son's are Kiefer and Jairus");
engine.runAndWait() ;

that's it, eureka!

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/

free online comma separating tool

https://delim.co/#