Skip to content
Kaldi API for Android, Python and Node
C++ Java Shell Python CMake Makefile JavaScript
Branch: master
Clone or download

Build Status

Language bindings for Vosk and Kaldi to access speech recognition from various languages and on various platforms

  • Python on Linux, Windows and RPi
  • Node
  • Android
  • iOS

Android build

cd android
gradle build

Please note that medium blog post about 64-bit is not relevant anymore, the script builds x86, arm64 and armv7 libraries automatically without any modifications.

Python installation from Pypi

Make sure you have pip:

  • Python version >= 3.4
  • pip version >= 19.0

Uprade python and pip if needed. Then install vosk on Linux with a simple command

pip install vosk

Kaldi compilation for local python, node and java modules

git clone -b lookahead --single-branch
cd kaldi/tools

install all dependencies and repeat make if needed

cd ../src
./configure --mathlib=OPENBLAS --shared --use-cuda=no
make -j 10

Java example API build

cd java && KALDI_ROOT=<KALDI_ROOT> make
tar xf alphacep-model-android-en-us-0.3.tar.gz 
mv alphacep-model-android-en-us-0.3 model
make run

Python module build

Then build the python module

cd python
python3 install

Running the example code with python

Run like this:

cd vosk-api/python/example
tar xf alphacep-model-android-en-us-0.3.tar.gz 
mv alphacep-model-android-en-us-0.3 model
python3 ./ test.wav

There are models for other languages available too.

To run with your audio file make sure it has proper format - PCM 16khz 16bit mono, otherwise decoding will not work.

Microphone example will come soon.

You can’t perform that action at this time.