Skip to content

Free and offline foreign (non-English) speech recognition with timestamps with Python, vosk, SpeechRecognition / Pocketsphinx

Notifications You must be signed in to change notification settings

Winston-503/foreign_speech_recognition

Repository files navigation

Free and Offline Foreign Speech Recognition

Free and offline foreign (non-English) speech recognition with Python, Google API vosk and SpeechRecognition / Pocketsphinx.

For speech recognition with timestamps see timestamps folder.

foreign_speech_recognition_preview.jpg

Setup

Read instructions in this Medium article to know what library you need to set up and how to do it.

  • Online speech recognition with Google API:
    • pip install SpeechRecognition
  • Offline speech recognition with vosk:
    • pip install vosk
    • download vosk model, unzip it and specify path to the model in program
  • Offline Speech Recognition with SpeechRecognition and Pocketsphinx:
    • pip install SpeechRecognition
    • python -m pip install --upgrade pip setuptools wheel
    • pip install --upgrade pocketsphinx
    • download foreign models for pocketsphinx, unzip and setup it

Overview Jupyter Notebook

See overview jupyter notebook, which contains examples of all methods.

Open it with jupyter or see directly in a browser.

Scripts Usage

As any python script any of these tree scripts (.py files) can be run with the following command: python script_name.py parameter1, parameter2 ....

Every script has two parameters:

  • first (required) - name of the .wav file to recognize
  • second (optional) - name of the text file to write recognized text. If not specified, uses first_parameter.txt

Examples:

  • python script_online_sr.py audio.wav (writes text in audio.txt)
  • python script_online_sr.py audio.wav audio_outout.txt
  • python script_vosk.py 'sounds\filename.wav' (recognize current_folder\sounds\filename.wav)
  • python script_offline_sr.py 'D:\sounds\filename.wav'

About

Free and offline foreign (non-English) speech recognition with timestamps with Python, vosk, SpeechRecognition / Pocketsphinx

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published