Skip to content
Sign upLog in
← Back to Community

Speech to text (Python)

Profile icon
edgyneer

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.

Voters
Profile icon
mfreedkin
Profile icon
Progamer092
Profile icon
Anyks
Profile icon
19leparr
Profile icon
Allanlinkon
Profile icon
bonniepeng
Profile icon
edgyneer
Comments
hotnewtop
Profile icon
19leparr

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

Profile icon
edgyneer

@19leparr
You've probably found an answer I'm just gonna answer it anyway for future cases, I don't think that's possible, like repl.it just doesn't allow that

Profile icon
mfreedkin

Are there any other alternatives available for converting speech through the system microphone to text that can be parsed to create a "voice encyclopedia"?

Profile icon
yaro3D67

PyAudio does not work in my replit

Profile icon
edgyneer

@yaro3D67
Unfortunately, repl.it doesn't support PyAudio.

Profile icon
gatorade322

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

Profile icon
edgyneer

@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.

Profile icon
gatorade322

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!

Profile icon
edgyneer

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

Profile icon
gatorade322

@edgyneer087x
yes, yes you did

Profile icon
edgyneer

@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:
https://stackoverflow.com/questions/13270877/how-to-manually-install-a-pypi-module-without-pip-easy-install

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

Profile icon
gatorade322

um . . . it doesn't work

Profile icon
edgyneer

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

Profile icon
gatorade322

@edgyneer087x
up there