User avatar
Zilla707
Posts: 55
Joined: Fri Aug 23, 2019 11:04 pm

Speech to Text Engine

Tue Sep 03, 2019 2:22 pm

Hello, I am trying to program a "Cortana-like" app where I can ask it questions and it will respond and give me answers. I am going to try and use espeek for output but I need a way to get speech to text in python3. I'm pretty sure google has a web service for it, but I want something that lets me have speech to text without wifi. Any suggestions?
Aim for perfect and you'll hit somewhere near pretty good. (maybe...)

mattmiller
Posts: 2116
Joined: Thu Feb 05, 2015 11:25 pm

Re: Speech to Text Engine

Tue Sep 03, 2019 7:05 pm


User avatar
Zilla707
Posts: 55
Joined: Fri Aug 23, 2019 11:04 pm

Re: Speech to Text Engine

Thu Sep 05, 2019 9:38 pm

I will try it. Can I use it from inside python3?
Aim for perfect and you'll hit somewhere near pretty good. (maybe...)

User avatar
peppy.player
Posts: 191
Joined: Mon Mar 07, 2016 6:10 am

Re: Speech to Text Engine

Fri Sep 06, 2019 12:37 am

PocketSphinx is another option:
https://github.com/cmusphinx/pocketsphinx
There are many tutorials on web how to install it on Raspberry Pi.

I believe in general web based systems are more lightweight though they need the Internet connection. Also you need to setup account in order to use the service.

Here is very good article about speech recognition and Python:
https://realpython.com/python-speech-recognition/

User avatar
Zilla707
Posts: 55
Joined: Fri Aug 23, 2019 11:04 pm

Re: Speech to Text Engine

Sun Sep 08, 2019 9:51 pm

I figured some stuff out but I can't get pocketsphinx to install. I ran "pip3 install pocketsphinx" but after running for a min, it gives me a bunch of errors. Any ideas?
Aim for perfect and you'll hit somewhere near pretty good. (maybe...)

User avatar
Zilla707
Posts: 55
Joined: Fri Aug 23, 2019 11:04 pm

Re: Speech to Text Engine

Fri Sep 13, 2019 1:44 am

Never mind. I got it figured out. Thanks for the good ideas.
Aim for perfect and you'll hit somewhere near pretty good. (maybe...)

User avatar
peppy.player
Posts: 191
Joined: Mon Mar 07, 2016 6:10 am

Re: Speech to Text Engine

Fri Sep 13, 2019 8:03 pm

Any chance to know what was the problem?

User avatar
Zilla707
Posts: 55
Joined: Fri Aug 23, 2019 11:04 pm

Re: Speech to Text Engine

Sun Sep 15, 2019 8:19 pm

Yeah, I think that it needed pulse audio installed. Here's what I used:

Code: Select all

sudo apt-get install pulseaudio libpulse-dev
Then:

Code: Select all

sudo pip3 install pocketsphinx
Thing is, pocketsphinx isn't very accurate, so even though its offline, it doesn't really turn the speech to text accurately at all.
Aim for perfect and you'll hit somewhere near pretty good. (maybe...)

User avatar
peppy.player
Posts: 191
Joined: Mon Mar 07, 2016 6:10 am

Re: Speech to Text Engine

Sat Nov 09, 2019 2:07 am

Yeah, I had the same bad experience with PocketSphinx on Windows machine. It's out-of-the-box functionality is not usable. You need to train the model. But if you are making the software which will be used by other people you cannot ask them to do that. In contrast to that any web based solution (e.g. Google Assistant SDK) works immediately and accurately without the need to train the model. Though you cannot use it offline.

User avatar
Zilla707
Posts: 55
Joined: Fri Aug 23, 2019 11:04 pm

Re: Speech to Text Engine

Sat Nov 09, 2019 2:09 am

I know this thread has been asleep for a bit, but I was wondering; how do you train pocketsphinx's model so that it works well with you own voice?
Aim for perfect and you'll hit somewhere near pretty good. (maybe...)

Return to “Python”