Speech recognition: Difference between revisions

From XPUB & Lens-Based wiki
Line 34: Line 34:
* Install python3: https://tutorial.djangogirls.org/en/installation/
* Install python3: https://tutorial.djangogirls.org/en/installation/
* Install git: https://git-scm.com/download/win
* Install git: https://git-scm.com/download/win
* Install pocketsphinx: https://cmusphinx.github.io/wiki/tutorialpocketsphinx/#windows
* Install pocketsphinx: https://cmusphinx.github.io/wiki/tutorialpocketsphinx/#windows OR
<br />
pip3 install PocketSphinx
pip3 install SpeechRecognition
pip3 install termcolor
pip3 install pyaudio


== Mac ==
== Mac ==
(haven't tried it)
(haven't tried it)
https://github.com/watsonbox/homebrew-cmu-sphinx
https://github.com/watsonbox/homebrew-cmu-sphinx

Revision as of 07:39, 4 July 2018

Ubuntu/ Mac

Requirements: Python 3.3+

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

  1. SpeechRecognition 3.8.1
    • pip 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:
    pip install --upgrade pip setuptools wheel
    pip 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

Windows


pip3 install PocketSphinx pip3 install SpeechRecognition pip3 install termcolor pip3 install pyaudio

Mac

(haven't tried it) https://github.com/watsonbox/homebrew-cmu-sphinx