how to setup julius voice control / speech engine on linux

View previous topic View next topic Go down

how to setup julius voice control / speech engine on linux

Post by jamied_uk on 28th November 2013, 15:48

Code:
New Version

http://sourceforge.jp/projects/julius/downloads/59049/julius-4.2.3-linuxbin.tar.gz

you will also need one of these...

http://voxforge.org/home/docs/faq/faq/what-is-a-dialog-manager


More info found at
found this at http://julius.sourceforge.jp/en_index.php#latest_version

goto directory and extract the zip file and type sh run_install.sh on the cli from the directory where the files were extracted to

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Older version

sudo apt-get install -y julius julius-voxforge
this can be setup to authenticate linux users with voice commands.



Now navigate to the installed directory and type


Code:
padsp julius -input mic -C julian.conf
Other methods to install and configure.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Step 1

1. Download the newest source tarbal from Julius official site – link
2. Unpack the archive for example to your user home directory
3. Configure and install julius by following commands:
cd ~/julius-4.2.2/
sudo ./configure
sudo make
sudo make install
4. Try it by typing in command line:
julius
 
//output
Julius rev.4.2.2 - based on
JuliusLib rev.4.2.2 (fast) built for i686-pc-linux
 
Copyright (c) 1991-2012 Kawahara Lab., Kyoto University
Copyright (c) 1997-2000 Information-technology Promotion Agency, Japan
Copyright (c) 2000-2005 Shikano Lab., Nara Institute of Science and Technology
Copyright (c) 2005-2012 Julius project team, Nagoya Institute of Technology
 
Try '-setting' for built-in engine configuration.
Try '-help' for run time options.
5. Last additional thing needed to run Julius smoothly is a julius-voxforge package which can be installed via apt-get by typing in command line:
sudo apt-get install julius-voxforge
That’s all now you can start to configure it, because it’s not coming configured just out of the box. I’ll write a post in next few days about basic configuration to which link will be added here.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Step 2
Firstly we need to get back to Julius directory that we unpacked inside our user’s home directory
cd ~/julius-4.2.2/
Now to run Julius we could possibly provide all needed params through the command line but that would be very difficult to remember and simply not very handy, because of that Julius can be configured using jconf file which example of is provided inside julius directory(file Sample.jconf). It one massive file but you should notice that all the lines are commented out(# char mean start of comment until end of line). To begin our adventure with Julius we need only 7 lines from the whole file. Let’s create a new directory and copy configuration file there:
mkdir test
cp Sample.jconf my.jconf
Now we need to set few important configuration options to make it work so let’s start editing the file:
-nolog # disable all logs
-quiet # output less log
-input mic # live microphone
-v sample.dict # word dictionary
-dfa sample.dfa # specify DFA and dictionary separately
-h /usr/share/julius-voxforge/acoustic/hmmdefs # acoustic HMM (ascii or Julius binary)
-hlist /usr/share/julius-voxforge/acoustic/tiedlist # HMMList to map logical phone to physical
I’ve packed the whole test directory with jconf, voca and grammar files(and compiled dfa, term and dict files as well) – just to make it easier to start – you can download it from here. Just unpack it to main julius directory inside your home folder. Then you can run it by:
cd ~/julius-4.2.2/test
padsp julius -C my.jconf
That’s all you should see something like that:
padsp julius -C my.jconf
STAT: include config: my.jconf
 
<<< please speak >>>
Now you can start to speak to your computer via Julius, but it will recognize only commands which are mentioned in sample.voca file. In next article I’ll try to describe a little bit more about creating your own grammar and compiling it to dict and dfa files. Have a fun with Julius!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Part 3

Today short and sweet explanation about how to start control Rhythmbox music player via Julius. Almost everything you need is already on your hard drive(if you’ve followed previous 2 steps).
Let’s start with a little bit of organising files around. We will create new directory where we will put our new files.
cd ~/julius-4.2.2/
mkdir test-python
Now we need to collect below elements which are in our system:
1. jconf configuration file
2. .grammar and .voca files
3. script that will grab the output of Julius and it will control Rhythmbox
julius-voxforge package installed in the first step contains(beside HMM file that we have used in previous step) few docs file, example script in Python programming language and .voca and .grammar files. Let’s copy them:
cd ~/julius-4.2.2/test-python
cp /usr/share/doc/julius-voxforge/examples/julian.jconf.gz ./
gunzip julian.jconf.gz
cp /usr/share/doc/julius-voxforge/examples/controlapp/command.py ./
cp /usr/share/doc/julius-voxforge/examples/controlapp/mediaplayer* ./
ls -la
We should see listing of 4 files:
command.py – script to grab output and run whatever we like to
julian.jconf – basic configuration script
mediaplayer.grammar – grammar file
mediaplayer.voca – vocabulary file
Ok, we have this file but we need to have compiled version of .grammar and .voca files as well to be able to provide them for usage to Julius. To compile them we will simply run mkdfa command passing file name(WITHOUT extension – without part after . (dot)). Both .grammar and .voca file needs to have the same name. We are running command only one time for both files.
mkdfa mediaplayer
Output
mediaplayer.grammar has 1 rules
mediaplayer.voca has 4 categories and 9 words
---
Now parsing grammar file
Now modifying grammar to minimize states[-1]
Now parsing vocabulary file
Now making nondeterministic finite automaton[5/5]
Now making deterministic finite automaton[5/5]
Now making triplet list[5/5]
4 categories, 5 nodes, 4 arcs
-> minimized: 5 nodes, 4 arcs
---
generated: mediaplayer.dfa mediaplayer.term mediaplayer.dict
List of files in our test-python directory should now looks like the list below:
command.py
julian.jconf
mediaplayer.dfa
mediaplayer.dict
mediaplayer.grammar
mediaplayer.term
mediaplayer.voca
Next step will be setting up configuration file that Julius will look after mediaplayer.dict and mediaplayer.dfa files. To make changes in it just open it with text editor and find 2 lines(line number 36 and 37):
-dfa sample.dfa
-v sample.dict
and change them to our file names:
-dfa mediaplayer.dfa
-v mediaplayer.dict
You should also uncomment line 162 and line 242 which contains ‘#-input mic’ and ‘#-quiet’ respectively(uncommented line should be exactly the same without leading ‘#’ character). This will save you writing all the time ‘-input mic’ and ‘-quiet’ options in the command line when you will be starting Julius.
Now the very last step is simply to run Julius(before that I had problem with privileges – so I have added below first line to fix any possible issues):
sudo chmod 777 -R ./
padsp julius -C julian.jconf | ./command.py
Output should look like that:
Taking control of Rhythmbox media player.
<<< please speak >>>
Script will run constantly until you won’t quite it(for example by pressing: Ctrl+C).
List of commands can be found in command.py file – just as a quick reference I’m giving the list below:
COMPUTER PLAY
COMPUTER NEXT
COMPUTER PREV
COMPUTER SHOW — this probably won’t work because rhythmbox-client was modified and doesn’t contain this option any more
COMPUTER PAUSE
COMPUTER SILENCE
Enjoy it!



Other links to this program help...

https://www.google.com/search?q=linux+Juliu#q=how+to+setup+linux+Juliu&safe=off

http://kamilskowron.pl/en/linux/julius-step-by-step-step-3-taking-control-over-rhythmbox-music-player/
avatar
jamied_uk
Admin

Posts : 2195
Join date : 2010-05-09
Age : 34
Location : UK

http://address-shortner.co.uk

Back to top Go down

Re: how to setup julius voice control / speech engine on linux

Post by jamied_uk on 23rd July 2015, 20:19

Google search for speech assistance


https://www.google.co.uk/search?q=most+common+asked+in+an+ai&gws_rd=cr,ssl&ei=3iKxVYLdNKS27ga0qLiQDw#safe=off&q=linux+speech+assistance
avatar
jamied_uk
Admin

Posts : 2195
Join date : 2010-05-09
Age : 34
Location : UK

http://address-shortner.co.uk

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum