Voice Recognition in Python

2019-02-14 08:17发布

问题:

I'm currently working on a virtual assistant program in Python 3.3, and I'd like to incorporate voice recognition in it. Does anyone know of any python modules or tools to do this with? Any help would be greatly appreciated!

回答1:

I've spent a lot of time working on this subject.

Currently I'm developing a Python 3 open-source cross-platform virtual assistant program called Athena Voice: https://github.com/athena-voice/athena-voice-client

Users can use it much like Siri, Cortana, or Amazon Echo.

It also uses a very simple "module" system where users can easily write their own modules to enhance it's functionality. Let me know if that could be of use.

Otherwise, I recommend looking into Google's Python speech-to-text and text-to-speech packages.

Both packages can be installed by using the command:

pip install SpeechRecognition gTTS

Google STT: https://pypi.python.org/pypi/SpeechRecognition/

Google TTS: https://pypi.python.org/pypi/gTTS/1.0.2

I believe the STT has PyAudio as a dependency which can be found here (unofficial): http://www.lfd.uci.edu/~gohlke/pythonlibs/#pyaudio

However, if you intend to do passive/offline listening, I highly recommend reconsidering pocketsphinx. On Python 3.4 it can be installed just by typing "pip install pocketsphinx"