Learn to Code via Tutorials on Repl.it!

← Back to all posts
Speech to text (Python)
edgyneer (6)

This python scripts turns your microphone input into plain text.

Step 1:install SpeechRecognition library.
'pip install SpeechRecognition'

Step 2: install PyAudio library.
'pip install PyAudio'

You can install this libraries from Command Prompt or Terminal, if you already have Python installed.

WARNING: Use python 3.6, because Python 3.7 and above doesn't support PyAudio.
Also this script won't run perfectly on repl.it, because the website doesn't support certain libraries.

Also, i got some source for this, if you want to see them as well, hit me up in the comments.

19leparr (0)

what can i do for repl.it to get these codes

gatorade322 (124)

Traceback (most recent call last):
File "main.py" line 1, in <module>
import speech_recognition #Import the library
ModuleNotFoundError: No module named 'speech_recognition' is the error.

edgyneer (6)

@gatorade322 You gotta install a python libraries called SpechRecognition & PyAudio.

You can use "pip" command to do it. And as i said, it does not work on repl.it, because the website doesn't have certain libraries.
If you did installed the libraries, i don't know then.

gatorade322 (124)

when I did that, I got an error in installing it (it was a C++ error, a library imported (#include <something.h>)), and the hole prosses just FAILED. If you have any segjustshons (I'm on a chromebook (and even my dad couldn't figure it out, and he's a developer at GOOGLE, and he knows C++). So if you have any segjustsions, I'd love to here them. THANKS!

edgyneer (6)

@gatorade322 Uh... You are getting C++ errors when you try to install Python libraries, did i get that right?

edgyneer (6)

@gatorade322 C++ errors caused by python libraries, whoa. Sorry mate, i just don't know the solution for that.

Oh hold on- i got an idea.
Maybe try to manually download libraries? You can find a basic tutorial here, on stackoverflow:

If this doesn't works too, i don't know.

gatorade322 (124)

um . . . it doesn't work

edgyneer (6)

@gatorade322 Did you try on repl.it website, or your personal computer? If that so, what kind of an error did you get?