I thought it would be cool to create a personal assistant in Python. If you are into movies you may have heard of Jarvis, an A.I. based character in the Iron Man films. In this tutorial we will create a robot.
The features I want to have are:
- Recognize spoken voice (Speech recognition)
- Answer in spoken voice (Text to speech)
- Answer simple commands
For this tutorial you will need (Ubuntu) Linux, Python and a working microphone.
- Python for Computer Vision with OpenCV and Deep Learning
- Master Computer Vision OpenCV3 in Python & Machine Learning
This is what you’ll create (watch the whole video, demo at the end):
Recognize spoken voice
Speech recognition can by done using the Python SpeechRecognition module. We make use of the Google Speech API because of it’s great quality.
Answer in spoken voice (Text To Speech)
Various APIs and programs are available for text to speech applications. Espeak and pyttsx work out of the box but sound very robotic. We decided to go with the Google Text To Speech API, gTTS.
Using it is as simple as:
The program below will answer spoken questions.