Tuesday Tooling: Nerd-Dictation
This week's fun Python tool comes courtesy of @FXBOY4EVA, and it is a cracker!
@biglesp This looks well worth a try:-https://t.co/slEW0Up7sg
— FXBOY4EVA (@FXBOY4EVA) July 25, 2021
I literally typed most of this tweet with it.
So What is it?
Nerd-Dictation, created by ideasman42 aka Campbell Barton, is a Linux based Python based dictation tool, a tool that listens for voice input and uses it to write text to the screen. This isn't a Siri, Alexa or Google Voice Assistant, rather it is a means to write text using our voice.
Hi reader!
So How Do I Install It?
I installed Nerd-Dictation on my Ubuntu 21.04 machine.
Install the vosk offline open source speech recognition toolkit.
pip3 install vosk
Clone the Nerd-Dictation Github repository.
git clone https://github.com/ideasman42/nerd-dictation.git
Change directory to the Github repo.
cd nerd-dictation
Download a voice model as a ZIP archive, unzip the archive and then change the name of the directory to "model".
wget https://alphacephei.com/kaldi/models/vosk-model-small-en-us-0.15.zip
unzip vosk-model-small-en-us-0.15.zip
mv vosk-model-small-en-us-0.15 model
So How Do I Use It?
Video credt: YouTube covjeceideje42
Open a terminal and enter this command to start Nerd-Dictation using the model that we downloaded.
./nerd-dictation begin --vosk-model-dir=./model &
Open a text document and start speaking.
When you are done, go back to the terminal and type this to turn it off.
./nerd-dictation end
There are a few limitations, namely we cannot enter punctuation, nor delete any content. It simply listens and types, often guessing a few words incorrectly. But 70% of the time it gets it right.
Broken Pipe Error
On my Ubuntu 20.10 machine all was well, but on my news Ubuntu 21.04 machine I encountered a broken pipe error around the xdotool
. It seems that this tool is not installed as standard. To install open a terminal and type.
sudo apt install xdotool