nshmyrev
Posts: 4
Joined: Sat Jan 09, 2021 8:50 pm

Vosk Speech Recognition Toolkit

Sat Jan 09, 2021 10:33 pm

Hi there. My name is Nickolay, I've been working on speech technology for many years. I've implemented many things in Pocketsphinx, Kaldi and various other speech libraries. These days I develop speech recognition toolkit called Vosk https://github.com/alphacep/vosk-api. There are many speech libraries these days, some have nice features, some hard to use, here are some unique things:
  • Vosk is an offline open source speech recognition toolkit. It enables speech recognition models for 17 languages and dialects - English, Indian English, German, French, Spanish, Portuguese, Chinese, Russian, Turkish, Vietnamese, Italian, Dutch, Catalan, Arabic, Greek, Farsi, Filipino.
  • Vosk models are small (50 Mb) but provide continuous large vocabulary transcription, zero-latency response with streaming API, reconfigurable vocabulary and speaker identification.
  • Speech recognition bindings implemented for various programming languages like Python, Java, Node.JS, C#, C++ and others.
  • Vosk works on Raspberry Pi3 and Pi4 but it also scales from mobile phones to big callcenter cluster. Vosk can also create subtitles for movies, transcription for lectures and interviews.
I personally use Vosk on RPi3B with Respeaker 4-mic Array hat controlling Kodi. We have just released an updated version 0.3.17 with a great speed improvements specifically for small devices.

In this topic I will post some news about Vosk on Raspberry Pi, setup configurations. You are also welcome to ask me anything about Vosk or speech technology in general.

suyashjoshi
Posts: 1
Joined: Sun Jan 24, 2021 7:32 pm

Re: Vosk Speech Recognition Toolkit

Sun Jan 24, 2021 7:37 pm

I tried to follow the instructions and ran into error - No module named 'sounddevice' when I tried to run the microphone example. It seems like one needs to install that module like so pip3 install sounddevice before trying microphone example.

Also it was confusing which release do we need to install on Pi - I thought it would be vosk-0.3.17-cp38-cp38-linux_armv7l.whl as I'm running on Raspberry Pi 3B which as arm7l processor - 32 bit but that gave an error :

pip3 install https://github.com/alphacep/vosk-api/re ... armv7l.whl
vosk-0.3.17-cp38-cp38-linux_armv7l.whl is not a supported wheel on this platform.


So had to install the default one - pip3 install vosk.

@OP - It would help if you have better instructions and demo for Raspberry Pi as I can't wait to try this library for my personal voice assistant project. Thanks!

AllexIn
Posts: 1
Joined: Sun Feb 28, 2021 6:53 am

Re: Vosk Speech Recognition Toolkit

Sun Feb 28, 2021 7:05 am

Hello. I have problems in test_microphone example on RPI 4.
I got "input overflow" very often.
What does it mean? Not enough hardware performance?

nshmyrev
Posts: 4
Joined: Sat Jan 09, 2021 8:50 pm

Re: Vosk Speech Recognition Toolkit

Wed Apr 21, 2021 8:42 am

AllexIn wrote:
Sun Feb 28, 2021 7:05 am
Hello. I have problems in test_microphone example on RPI 4.
I got "input overflow" very often.
What does it mean? Not enough hardware performance?
Hey, sorry, missed the question somehow. It is a problem with pyaudio, long unsupported library. In recent version we moved to sounddevice, a better wrapper for portaudio, it should work much better now, please try here:

https://github.com/alphacep/vosk-api/bl ... rophone.py

nshmyrev
Posts: 4
Joined: Sat Jan 09, 2021 8:50 pm

Re: Vosk Speech Recognition Toolkit

Wed Apr 21, 2021 8:43 am

suyashjoshi wrote:
Sun Jan 24, 2021 7:37 pm
I tried to follow the instructions and ran into error - No module named 'sounddevice' when I tried to run the microphone example. It seems like one needs to install that module like so pip3 install sounddevice before trying microphone example.

Also it was confusing which release do we need to install on Pi - I thought it would be vosk-0.3.17-cp38-cp38-linux_armv7l.whl as I'm running on Raspberry Pi 3B which as arm7l processor - 32 bit but that gave an error :

pip3 install https://github.com/alphacep/vosk-api/re ... armv7l.whl
vosk-0.3.17-cp38-cp38-linux_armv7l.whl is not a supported wheel on this platform.


So had to install the default one - pip3 install vosk.

@OP - It would help if you have better instructions and demo for Raspberry Pi as I can't wait to try this library for my personal voice assistant project. Thanks!
We solved this issue with recent move to CFFI, now we do not depend on Python version. You tried Python 3.8 above but it must be 3.7. Now we do not depend on Python, so the command should work by default. Please try|!

nshmyrev
Posts: 4
Joined: Sat Jan 09, 2021 8:50 pm

Re: Vosk Speech Recognition Toolkit

Wed Apr 21, 2021 8:44 am

Hey, some Vosk recent updates: we have moved to JNA/CFFI framework for all the bindings meaning you can distribute same library for all languages and versions. Now you can install Vosk with Maven/Nuget/NPM/Pypi with a simple commands and it should work independently of Node or Python version. Great progress!

https://www.nuget.org/packages/Vosk/
https://www.npmjs.com/package/vosk
https://alphacephei.com/maven/com/alphacephei/vosk/
https://pypi.org/project/vosk/

Android platform has been redesigned too, now it loads models much faster and follows recent Android practices too.

Return to “Graphics, sound and multimedia”