Skip to content
Related Articles

Related Articles

Improve Article
Introduction and Installation of Uberi/Speechrecognition in Python
  • Last Updated : 10 May, 2020

One of the best library for speech recognition in Python and uses various engines and API to perform speech recognition online as well as offline.

Installation

Use this command in cmd or terminal make sure Python is installed and Python path is also stored in pc.

pip install speechrecognition

OR
Download resources from PyPI and extract it in a folder and then run following command in cmd or terminal.

python setup.py install

Prerequisites

  • Python
    Make sure python is installed and path of Python is stored in system too.

  • 2. PyAudio
    PyAudio is need only whe the input is from microphone. Make sure PyAudio version is PyAudio version 0.2.11 or above. If not installed, everything in the library will still work, except attempting to instantiate a Microphone object will raise an AttributeError.



    Installation :
    1) Windows: Execute the below command in the cmd.

    pip install pyaudio

    2) Debian Linux: Execute the below command in the terminal.

    sudo apt-get install python-pyaudio python3-pyaudio

  • Google API Client Library for Python
    Google API Client library is only needed when one want to use Google Cloud speech api.
    Installation :
    1) Windows: Execute
    pip install virtualenv
    virtualenv 
    \Scripts\activate
    \Scripts\pip.exe install google-api-python-client

    in CMD.

    2) Debian Linux: Execute

    pip install virtualenv
    virtualenv 
    \Scripts\activate
    \Scripts\pip.exe install google-api-python-client

    in a terminal

  • Flac Encoder
    A FLAC encoder is required to encode the audio data to send to the API. If using Windows (x86 or x86-64), OS X (Intel Macs only, OS X 10.6 or higher), or Linux (x86 or x86-64), this is already bundled with this library – you do not need to install anything.



  • PocketSphinx
    PocketSphinx-Python is required if and only if you want to use the Sphinx recognizer
    Installation :
    1) Windows: Download the full PocketSphinx-Python source code by running

    git clone –recursive –depth 1 https://github.com/cmusphinx/pocketsphinx-python

    Note: Downloading the ZIP archive from GitHub will not work.

    Run the below command in the PocketSphinx-Python source code folder to compile and install PocketSphinx.

    python setup.py install

    2) Linux: Run

    for Python 2,

    pip install pocketsphinx 
    

    for Python 3.

    pip3 install pocketsphinx

 Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.  

To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course

My Personal Notes arrow_drop_up
Recommended Articles
Page :