Speech to Text in Python

Updated: Mar 15

I built an application based on AI to ask the user to state a question and will listen to the Answer that the user replies. The application understands what the user said and prints what they said on the screen

What does this program do?

This program will ask the user to state a question and will listen to the Answer that the user replies. Then it will understand what the user said and print what they said.


Steps to Understanding Speech to Text

Some people think that it is very difficult and time consuming to convert speech to text. However, truth be told, converting speech to text is simple and a straight forward process.


On a high level, below are the list of steps to convert speech to text:


i. Ask the user a question


ii. Give them a turn to talk and record the sounds


iii. Use a function to make out what they are saying


iv. print what we think they are saying



Step #1: Install Packages

These instructions are meant for python 3.8, if you have an older version you can upgrade or try to follow along, but the code won’t be exactly the same.


Before you start writing python codes, let’s install some packages.


Go to the terminal and type “pip install” with the package name. An example is, “pip install pyaudio” and press “enter” key.


Similarly, install all the packages listed in the table below, in different lines in the terminal: