Speech recognition: Difference between revisions

From XPUB & Lens-Based wiki
No edit summary
No edit summary
Line 5: Line 5:
https://pypi.python.org/pypi/SpeechRecognition
https://pypi.python.org/pypi/SpeechRecognition
# SpeechRecognition 3.8.1
# SpeechRecognition 3.8.1
#*<small>pip install SpeechRecognition</small>
#*<small>sudo pip3 install SpeechRecognition</small>
#*To quickly try it out, run <small>python -m speech_recognition</small> after installing.
#*To quickly try it out, run <small>python -m speech_recognition</small> after installing.
# PyAudio (for microphone users):
# PyAudio (for microphone users):
Line 22: Line 22:
##[https://github.com/Uberi/speech_recognition/blob/master/reference/pocketsphinx.rst Install other languages]
##[https://github.com/Uberi/speech_recognition/blob/master/reference/pocketsphinx.rst Install other languages]
# [https://github.com/bambocher/pocketsphinx-python Pocketsphinx Python]:  
# [https://github.com/bambocher/pocketsphinx-python Pocketsphinx Python]:  
#:<small>pip install --upgrade pip setuptools wheel</small>
#:<small>sudo pip3 install --upgrade pip setuptools wheel</small>
#:<small>pip install --upgrade pocketsphinx</small>
#:<small>sudo pip3 install --upgrade pocketsphinx</small>
# Examples:
# Examples:
## Transcribe an audio file: run <small>python3 [https://github.com/Uberi/speech_recognition/blob/master/examples/audio_transcribe.py audio_transcribe.py]</small>
## Transcribe an audio file: run <small>python3 [https://github.com/Uberi/speech_recognition/blob/master/examples/audio_transcribe.py audio_transcribe.py]</small>
## Save audio data to an audio file: run <small>python3 [https://github.com/Uberi/speech_recognition/blob/master/examples/write_audio.py write_audio.py]</small>
## Save audio data to an audio file: run <small>python3 [https://github.com/Uberi/speech_recognition/blob/master/examples/write_audio.py write_audio.py]</small>

Revision as of 16:58, 23 March 2018

For Ubuntu:

Requirements: Python2.6, 2.7, or 3.3+

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

  1. SpeechRecognition 3.8.1
    • sudo pip3 install SpeechRecognition
    • To quickly try it out, run python -m speech_recognition after installing.
  2. PyAudio (for microphone users):
    • Install PyAudio using APT: execute sudo apt-get install python-pyaudio python3-pyaudio in a terminal.
  3. Pocketsphinx:
    1. One way:
    2. Another way (not sure if it is different or supplementary):
      • pip3 install pocketsphinx
    3. Test+Errors:
      • Try this: pocketsphinx_continuous
      • If you find this error error while loading shared libraries: libpocketsphinx.so.3: cannot open shared object file: No such file or directory do this sudo nano /etc/ld.so.conf and add
      include usr/local/lib
      include usr/
    4. Install other languages
  4. Pocketsphinx Python:
    sudo pip3 install --upgrade pip setuptools wheel
    sudo pip3 install --upgrade pocketsphinx
  5. Examples:
    1. Transcribe an audio file: run python3 audio_transcribe.py
    2. Save audio data to an audio file: run python3 write_audio.py