--- julius-voxforge-0.1.1~daily20130206.orig/debian/changelog +++ julius-voxforge-0.1.1~daily20130206/debian/changelog @@ -0,0 +1,83 @@ +julius-voxforge (0.1.1~daily20130206-0ubuntu1) raring; urgency=low + + * New upstream release (daily build) - see LP: #1118159. + - Repackaged HTK_AcousticModel-2013-02-06_16kHz_16bit_MFCC_O_D.tgz. + * Move the dict file from share/doc into share/voxforge as it is + a useful part of the language model, not simply documentation. + + -- Pete Woods Wed, 06 Feb 2013 15:46:37 +0000 + +julius-voxforge (0.1.1~daily20090826-0ubuntu1) karmic; urgency=low + + * New upstream release (daily build). + - Repackaged HTK_AcousticModel-2009-08-26_16kHz_16bit_MFCC_O_D.tgz. + + -- Siegfried-Angel Gevatter Pujals Wed, 26 Aug 2009 21:32:05 +0200 + +julius-voxforge (0.1.1~daily20090812-0ubuntu1) karmic; urgency=low + + * New upstream release (daily build). + - Repackaged HTK_AcousticModel-2009-08-12_16kHz_16bit_MFCC_O_D.tgz. + + -- Siegfried-Angel Gevatter Pujals Thu, 13 Aug 2009 01:09:02 +0200 + +julius-voxforge (0.1.1~daily20090715-0ubuntu1) karmic; urgency=low + + * New upstream release (daily build). + - Repackaged HTK_AcousticModel-2009-07-15_16kHz_16bit_MFCC_O_D.tgz. + * debian/additional/: + - Little improvements to the sample application. + * debian/control: + - Bump Standards-Version to 3.8.2. + + -- Siegfried-Angel Gevatter Pujals Wed, 15 Jul 2009 15:06:34 +0200 + +julius-voxforge (0.1.1~daily20090611-0ubuntu2) karmic; urgency=low + + * debian/additional/README: + - Mention that changing "-input" to one of alsa/oss/esd may + help in case the detection rate with "mic" is very bad. + * Move command.py into a controlapp/ subdirectory and include all necessary + files to try it. Also add Banshee support to command.py. + + -- Siegfried-Angel Gevatter Pujals Thu, 18 Jun 2009 19:21:51 +0200 + +julius-voxforge (0.1.1~daily20090611-0ubuntu1) karmic; urgency=low + + * New upstream release (daily build). + - Repackaged HTK_AcousticModel-2009-06-11_16kHz_16bit_MFCC_O_D.tgz. + * debian/install: + - Do not install audio_files_used, as it's not present in this + release. + * debian/copyright: + - Change it to the new machine-readable format. + * debian/control: + - Bump Standards-Version to 3.8.1. + - Remove duplicate Homepage field. + * debian/additional/lookup.py, debian/examples: + - Remove lookup.py as it was slow, over-engineered and not really + useful here anyway. + * debian/additional/lookup.py, debian/examples, debian/patches: + - Add our own copy of sample.voca, sample.grammar and julian.jconf, + as they aren't present in the new tarball. + - File julian.jconf can now be directly modified, dropped the + patch. + + -- Siegfried-Angel Gevatter Pujals Thu, 11 Jun 2009 19:13:24 +0200 + +julius-voxforge (0.1.1~build726-0ubuntu2) jaunty; urgency=low + + * debian/control: + - Add Homepage field. + * Delete debian/README.Debian. + + -- Siegfried-Angel Gevatter Pujals Sat, 14 Mar 2009 13:46:17 +0100 + +julius-voxforge (0.1.1~build726-0ubuntu1) intrepid; urgency=low + + * Initial release (LP: #252091). + * debian/additional/*: + - Include a README file which explains how to write grammar for Julius + and some other files. + + -- Siegfried-Angel Gevatter Pujals Sat, 26 Jul 2008 12:05:37 +0200 --- julius-voxforge-0.1.1~daily20130206.orig/debian/compat +++ julius-voxforge-0.1.1~daily20130206/debian/compat @@ -0,0 +1 @@ +5 --- julius-voxforge-0.1.1~daily20130206.orig/debian/copyright +++ julius-voxforge-0.1.1~daily20130206/debian/copyright @@ -0,0 +1,23 @@ +Format-Specification: http://dep.debian.net/deps/dep5/#index4h1 +Name: Voxforge +Maintainer: Ken MacLean +Source: http://www.voxforge.org/home/downloads + +Files: * +Copyright: © 2005-2009 Ken MacLean + © 2005-2009 Free Software Foundation +License: GPL-2+ + +Files: debian/* +Copyright: © 2008-2009, Siegfried-A. Gevatter Pujals +License: GPL-2+ + +Files: debian/additional/julian.jconf +Copyright: © 1991-2005 Kawahara Lab., Kyoto University + © 2000-2005 Shikano Lab., Nara Institute of Science and Technology + © 2005 Julius project team, Nagoya Institute of Technology +License: GPL-2+ + +License: GPL-2+ + On Debian systems, the complete text of the GNU General Public + License can be found in /usr/share/common-licenses/GPL. --- julius-voxforge-0.1.1~daily20130206.orig/debian/install +++ julius-voxforge-0.1.1~daily20130206/debian/install @@ -0,0 +1,4 @@ +hmmdefs usr/share/julius-voxforge/acoustic +macros usr/share/julius-voxforge/acoustic +tiedlist usr/share/julius-voxforge/acoustic +dict usr/share/julius-voxforge/acoustic --- julius-voxforge-0.1.1~daily20130206.orig/debian/control +++ julius-voxforge-0.1.1~daily20130206/debian/control @@ -0,0 +1,23 @@ +Source: julius-voxforge +Section: sound +Priority: optional +Maintainer: Siegfried-Angel Gevatter Pujals +Build-Depends: cdbs (>= 0.4.51~), + debhelper (>= 5) +Standards-Version: 3.8.2 +Homepage: http://voxforge.org/ + +Package: julius-voxforge +Architecture: all +Depends: ${misc:Depends} +Recommends: julius +Description: acoustic models for Julius (English) + VoxForge is a project which collects transcribed speech corpora release under + the GNU General Public License, and uses it to create acoustic models for + speech recognition engines. + . + This package contains 16hHz English acoustic models created for Julius/Julian. + . + Note that the project is still in a rather early stage and the generated + models don't support all possible combinations of phonemes, limiting the + range of words which it is able to recognize. --- julius-voxforge-0.1.1~daily20130206.orig/debian/rules +++ julius-voxforge-0.1.1~daily20130206/debian/rules @@ -0,0 +1,4 @@ +#!/usr/bin/make -f + +include /usr/share/cdbs/1/rules/debhelper.mk +include /usr/share/cdbs/1/rules/simple-patchsys.mk --- julius-voxforge-0.1.1~daily20130206.orig/debian/examples +++ julius-voxforge-0.1.1~daily20130206/debian/examples @@ -0,0 +1 @@ +debian/additional/* --- julius-voxforge-0.1.1~daily20130206.orig/debian/additional/README +++ julius-voxforge-0.1.1~daily20130206/debian/additional/README @@ -0,0 +1,82 @@ +Example Grammar for Julius +--------------------------------- + +In order to use VoxForge's acoustic models with Julius, you have to tell it +what words you want it to recognize and it what context each of those can +be found. You can do this by writting two files, a .grammar and a .term one, +and generating .dfa and .dict files out of those. This file will explain you +briefly how to achieve this. + +== QUICK START == + +First, copy the example files to a directory where you can write, like your +home folder, and uncompress the gziped files: + + mkdir ~/julius-grammar + cp /usr/share/doc/julius-voxforge/examples/* ~/julius-grammar + cd ~/julius-grammar + gunzip * 2>&1 | grep -v ignored + +Now let's run the following command (available from package "julius"): + + mkdfa sample + +This will generate the files "sample.dfa", "sample.dict" and "sample.term" out +of the "sample.grammar" and "sample.voca" files. Once we have those, we can run +Julius with the following command to try the example grammar out: + + julius -input mic -C julian.jconf + +Note that only some sentences are recognized, like for example "DIAL ONE TWO" +or "PHONE STEVE". See the next part to learn how to add more words. + +In case your recognition rate is near zero, try replacing "mic" in the +command above with "oss", "alsa" or "esd". + +== CREATING OUR OWN GRAMMAR == + +Now open up the files "sample.voca" and "sample.grammar" and have a look at +them. The first one defines some categories (lines starting with "%") and lists +some words, together with their phonetic representation. The .grammar file, +which may look a bit more confusing, defines the context in which each word +category can appear. + +Feel free to add new words to the existing categories in sample.voca or even +create new ones (adding at least one rule mentioning them to sample.grammar), +but don't forget to write their phonetic representation next to them. You can +get a list of English words and their corresponding phonetic representation +from ftp://svr-ftp.eng.cam.ac.uk/pub/comp.speech/dictionaries/beep.tar.gz. + +About the .grammar file, you need to understand that the lines starting with +"S :" are those which define the possible sentences and that they are formed +by one or more category or variables names, between "NS_B " and " NS_E" (which +most be defined in sample.voca and represent the silence at the end and at the +start of the sentence). Variables, like we called them previously, are just +another line in the .grammar file which list a sequence of categories or +other variables, and, as you see in the sample file, they can have many +different definitions. + +Once you finish playing with the files, you can generate their equivalents in +Julian's native format again, by running the same command as in the quick start: + + mkdfa sample + +Then, run julius as showed above and if everything is right it should recognize +your new vocabulary now. In the case you get an error about missing phonemes, +you'll have to remove the words about which it complains, as the available +acoustic models don't support them. + +== PRACTICAL UTILITY == + +As you will probably notice, the VoxForge acoustic model is still far away from +being suitable for dictation applications and the like, so its utility right +now is basically restricted to "command and control" applications. For an +example of how to write a simple one in Python, look at the file command.py +in /usr/share/doc/julius-voxforge/examples/controlapp/. + +== CONTRIBUTE == + +If you want to help contributing speech corpora for your language, see the +project's main page at http://www.voxforge.org/. + + -- Siegfried-A. Gevatter . 19/06/2009 --- julius-voxforge-0.1.1~daily20130206.orig/debian/additional/sample.grammar +++ julius-voxforge-0.1.1~daily20130206/debian/additional/sample.grammar @@ -0,0 +1,23 @@ +S : NS_B SENT NS_E +SENT: CALL_V F_NAME_STEVE_YOUNG L_NAME_STEVE_YOUNG +SENT: CALL_V F_NAME_STEVE_YOUNG +SENT: CALL_V L_NAME_STEVE_YOUNG +SENT: CALL_V PRONOUN F_NAME_STEVE_YOUNG L_NAME_STEVE_YOUNG +SENT: CALL_V PRONOUN F_NAME_STEVE_YOUNG +SENT: CALL_V PRONOUN L_NAME_STEVE_YOUNG +SENT: CALL_V F_NAME_KENNETH L_NAME_KENNETH_MACDOUGALL +SENT: CALL_V F_NAME_KENNETH +SENT: CALL_V L_NAME_KENNETH_MACDOUGALL +SENT: CALL_V PRONOUN F_NAME_KENNETH L_NAME_KENNETH_MACDOUGALL +SENT: CALL_V PRONOUN F_NAME_KENNETH +SENT: CALL_V PRONOUN L_NAME_KENNETH_MACDOUGALL +SENT: CALL_V F_NAME_KENNETH L_NAME_KENNETH_MACLEAN +SENT: CALL_V F_NAME_KENNETH +SENT: CALL_V L_NAME_KENNETH_MACLEAN +SENT: CALL_V PRONOUN F_NAME_KENNETH L_NAME_KENNETH_MACLEAN +SENT: CALL_V PRONOUN F_NAME_KENNETH +SENT: CALL_V PRONOUN L_NAME_KENNETH_MACLEAN + +S : NS_B DIAL_V WORD_LOOP NS_E +WORD_LOOP: WORD_LOOP DIGIT +WORD_LOOP: DIGIT --- julius-voxforge-0.1.1~daily20130206.orig/debian/additional/sample.voca +++ julius-voxforge-0.1.1~daily20130206/debian/additional/sample.voca @@ -0,0 +1,46 @@ +% NS_B + sil + +% NS_E + sil + +% CALL_V +PHONE f ow n +CALL k ao l +GET g eh t + +% PRONOUN +ME m iy + +% DIAL_V +DIAL d ay ax l + +% F_NAME_KENNETH +KENNETH k eh n ix th +KEN k eh n + +% L_NAME_KENNETH_MACDOUGALL +MACDOUGALL m ax k d uw g ax l + +% L_NAME_KENNETH_MACLEAN +MACLEAN m ax k l ey n + +% F_NAME_STEVE_YOUNG +STEVEN s t iy v ax n +STEVE s t iy v + +% L_NAME_STEVE_YOUNG +YOUNG y ah ng + +% DIGIT +FIVE f ay v +FOUR f ao r +NINE n ay n +EIGHT ey t +OH ow +ONE w ah n +SEVEN s eh v ax n +SIX s ih k s +THREE th r iy +TWO t uw +ZERO(2) z ih r ow --- julius-voxforge-0.1.1~daily20130206.orig/debian/additional/julian.jconf +++ julius-voxforge-0.1.1~daily20130206/debian/additional/julian.jconf @@ -0,0 +1,262 @@ +# Copyright (c) 1991-2005 Kawahara Lab., Kyoto University +# Copyright (c) 2000-2005 Shikano Lab., Nara Institute of Science and Technology +# Copyright (c) 2005 Julius project team, Nagoya Institute of Technology +# All rights reserved +# +# Example of Runtime Configuration File for Julian rev.3.5 +# +# 1) NOTICE: relative paths must be relative to THIS FILE. +# Current working directory does not affect. +# 2) Blank lines and comments after '#' are ignored. +# Use `\#' to specify `#' in an argument, +# 3) Each line should be shorter than 512 bytes. +# 4) Syntax of each arguments are same as corresponding command options. +# 5) The commented-out values in this file are default values in Julian. +# + +###################################################################### +#### Files +###################################################################### +## +## Grammar definition file (DFA and dictionary) +## + +#### There are three ways to specify the grammar files. +#### (1) and (2) can be used multiple times. + +#### (1) Specify by common prefix of .dfa and .dict files. Comma-separated +#### prefixes can be specified for multiple grammar recognition +#-gram /cdrom/testrun/sample_grammars/vfr/vfr + +#### (2) Or you can give Julian a text file which contains list of grammar +#### prefixes one per line. +#-gramlist file + +#### (3) Classic way to specify a grammar. +-dfa sample.dfa +-v sample.dict + +#### If you want to clear previously specified grammars, use this at the +#### point. +#-nogram + +## +## Acoustic HMM file +## +# support ascii hmmdefs or binary format (converted by "mkbinhmm") +# format (ascii/binary) will be automatically detected +-h /usr/share/julius-voxforge/acoustic/hmmdefs + +## triphone model needs HMMList that maps logical triphone to physical ones. +-hlist /usr/share/julius-voxforge/acoustic/tiedlist + +###################################################################### +#### Multiple grammar recognition +###################################################################### +#-multigramout # Output results for each grammar + +###################################################################### +#### Language Model +###################################################################### +## +## word insertion penalty +## +-penalty1 5.0 # first pass +-penalty2 20.0 # second pass + +###################################################################### +#### Dictionary +###################################################################### +## +## do not giveup startup on error words +## +#-forcedict + +###################################################################### +#### Acoustic Model +###################################################################### +## +## Context-dependency handling will be enabled according to the model type. +## Try below if julius wrongly detect the type of hmmdefs +## +#-no_ccd # disable context-dependency handling +#-force_ccd # enable context-dependency handling + +## +## If julius go wrong with checking parameter type, try below. +## +#-notypecheck +# + +## +## (PTM/triphone) switch computation method of IWCD on 1st pass +## +#-iwcd1 best N # assign average of N-best likelihood of the same context +-iwcd1 max # assign maximum likelihood of the same context +#-iwcd1 avg # assign average likelihood of the same context (default) + +###################################################################### +#### Gaussian Pruning +###################################################################### +## Number of mixtures to select in a mixture pdf. +## This default value is optimized for IPA99's PTM, +## with 64 Gaussians per codebook +#-tmix 2 + +## Select Gaussian pruning algorithm +## defulat: beam (standard setting), safe (others) +-gprune safe # safe pruning, accurate but slow +#-gprune heuristic # heuristic pruning +#-gprune beam # beam pruning, fast but sensitive +#-gprune none # no pruning + +###################################################################### +#### Gaussian Mixture Selection +###################################################################### +#-gshmm hmmdefs # monophone HMM for GMS + # (OFF when not specified) +#-gsnum 24 # number of states to be selected on GMS + +###################################################################### +#### Search Parameters +###################################################################### +#-b 400 # beam width on 1st pass (#nodes) for monophone +#-b 800 # beam width on 1st pass (#nodes) for triphone,PTM +#-b 1000 # beam width on 1st pass (#nodes) for triphone,PTM,engine=v2.1 +-b2 200 # beam width on 2nd pass (#words) +-sb 200.0 # score beam envelope threshold +#-s 500 # hypotheses stack size on 2nd pass (#hypo) +#-m 2000 # hypotheses overflow threshold (#hypo) +#-lookuprange 5 # lookup range for word expansion (#frame) +#-n 1 # num of sentences to find (#sentence) +#-n 10 # (default for 'standard' configuration) +#-output 1 # num of found sentences to output (#sentence) +#-looktrellis # search within only backtrellis words + +###################################################################### +#### Inter-word Short Pause Handling +###################################################################### +## +## Specify short pause model name to be treated as special +## +-spmodel "sp" # HMM model name + +## +## For insertion of context-free short-term inter-word pauses between words +## (multi-path version only) +## +-iwsp # append a skippable sp model at all word ends +-iwsppenalty -70.0 # transition penalty for the appenede sp models + +###################################################################### +#### Speech Input Source +###################################################################### +## select one (default: mfcfile) +#-input mfcfile # MFCC file in HTK parameter file format +#-input rawfile # raw wavefile (auto-detect format) + # WAV(16bit) or + # RAW(16bit(signed short),mono,big-endian) + # AIFF,AU (with libsndfile extension) + # other than 16kHz, sampling rate should be specified + # by "-smpFreq" option +#-input mic # direct microphone input + # device name can be specified via env. val. "AUDIODEV" +#-input netaudio -NA host:0 # direct input from DatLink(NetAudio) host +#-input adinnet -adport portnum # via adinnet network client +#-input stdin # from standard tty input (pipe) + +#-filelist filename # specify file list to be recognized in batch mode + +#-nostrip # switch OFF dropping of invalid input segment. + # (default: strip off invalid segment (0 sequence etc.) +#-zmean # enable DC offset removal (invalid for mfcfile input) + +###################################################################### +#### Recording +###################################################################### +#-record directory # auto-save recognized speech data into the dir + +###################################################################### +#### GMM-based Input Verification and Rejection +###################################################################### +#-gmm gmmdefs # specify GMM definition file in HTK format +#-gmmnum 10 # num of Gaussians to be computed per mixture +#-gmmreject "noise,laugh,cough" # list of GMM names to be rejected + +###################################################################### +#### Too Short Input Rejection +###################################################################### +#-rejectshort 800 # reject input shorter than specified millisecond + +###################################################################### +#### Speech Detection +###################################################################### +#-pausesegment # turn on speech detection by level and zero-cross +#-nopausesegment # turn off speech detection by level and zero-cross + # (default: on for mic or adinnet, off for file) +#-lv 2000 # threshold of input level (0-32767) +#-headmargin 300 # head margin of input segment (msec) +#-tailmargin 400 # tail margin of input segment (msec) +#-zc 60 # threshold of number of zero-cross in a second + +###################################################################### +#### Acoustic Analysis +###################################################################### +-smpFreq 16000 # sampling rate (Hz) +#-smpPeriod 625 # sampling period (ns) (= 10000000 / smpFreq) +#-fsize 400 # window size (samples) +#-fshift 160 # frame shift (samples) +#-delwin 2 # delta window (frames) +#-hifreq -1 # cut-off hi frequency (Hz) (-1: disable) +#-lofreq -1 # cut-off low frequency (Hz) (-1: disable) +#-cmnsave filename # save CMN param to file (update per input) +#-cmnload filename # load initial CMN param from file on startup + +###################################################################### +#### Spectral Subtraction (SS) +###################################################################### +#-sscalc # do SS using head silence (file input only) +#-sscalclen 300 # length of head silence for SS (msec) +#-ssload filename # load constant noise spectrum from file for SS +#-ssalpha 2.0 # alpha coef. for SS +#-ssfloor 0.5 # spectral floor for SS + +###################################################################### +#### Forced alignment +###################################################################### +#-walign # do forced alignment with result per word +#-palign # do forced alignment with result per phoneme +#-salign # do forced alignment with result per HMM state + +###################################################################### +#### Word Confidence Scoring +###################################################################### +#-cmalpha 0.05 # smoothing coef. alpha + +###################################################################### +#### Output +###################################################################### +#-separatescore # output language and acoustic score separately +#-progout # output partial result per a time interval +#-proginterval 300 # time interval for "-progout" (msec) +#-quiet # output minimal result +#-demo # = "-progout -quiet", suitable for dictation demo +#-debug # output full message for debug +#-charconv from to # output character set conversion (see manual for + # available code set name) + +###################################################################### +#### Server module mode +###################################################################### +#-module # Run Julius on "Server module mode" +#-module 5530 # (when using another port number for connection) +#-outcode WLPSC # select output message toward module (WLPSCwlps) + +###################################################################### +#### Misc. +###################################################################### +#-help # output help and exit +#-setting # output engine configuration and exit +#-C jconffile # expand other jconf file in its place + +################################################################# end of file --- julius-voxforge-0.1.1~daily20130206.orig/debian/additional/controlapp/command.py +++ julius-voxforge-0.1.1~daily20130206/debian/additional/controlapp/command.py @@ -0,0 +1,119 @@ +#! /usr/bin/python -u +# (Note: The -u disables buffering, as else we don't get Julius's output.) +# +# Command and Control Application for Julius +# +# How to use it: +# julius -quiet -input mic -C julian.jconf 2>/dev/null | ./command.py +# +# Copyright (C) 2008, 2009 Siegfried-Angel Gevatter Pujals +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Supported commands: +# +# This file is provided as an example, and should be modified to suit +# your needs. As is, it only supports a few commands and executes them on +# either Rhythmbox or Banshee. + +import sys +import os + +class Rhythmbox: + + name = "Rhythmbox" + + commands = { + 'play': 'play', + 'pause': 'pause', + 'next': 'next', + 'prev': 'previous', + 'show': 'notify', + 'pause': 'pause', + 'silence': 'pause', + } + + def parse(self, word): + if word in self.commands: + return 'rhythmbox-client --%s' % self.commands[word] + +class Banshee: + + name = "Banshee" + + commands = { + 'play': 'play', + 'pause': 'pause', + 'stop': 'stop', + 'next': 'next', + 'prev': 'previous', + 'pause': 'pause', + 'silence': 'pause', + } + + def parse(self, word): + if word in self.commands: + return 'banshee --no-present --%s %% ' % self.commands[word] + +class CommandAndControl: + + def __init__(self, file_object): + + # Determine which media player to use + if os.system('ps xa | grep -v grep | grep banshee >/dev/null') == 0: + self.mediaplayer = Banshee() + elif os.system('ps xa | grep -v grep | grep rhythmbox >/dev/null') == 0: + self.mediaplayer = Rhythmbox() + elif os.system('which banshee >/dev/null') == 0: + self.mediaplayer = Banshee() + os.system('bash -c "nohup banshee >/dev/null 2>&1 <&1 & disown %%"') + elif os.system('which rhythmbox >/dev/null') == 0: + self.mediaplayer = Rhythmbox() + else: + print 'Couldn\'t find a supported media player. ' \ + 'Please install Rhythmbox or Banshee.' + sys.exit(1) + print 'Taking control of %s media player.' % self.mediaplayer.name + + startstring = 'sentence1: ' + endstring = ' ' + + while 1: + line = file_object.readline() + if not line: + break + if 'missing phones' in line.lower(): + print 'Error: Missing phonemes for the used grammar file.' + sys.exit(1) + if line.startswith(startstring) and line.strip().endswith(endstring): + self.parse(line.strip('\n')[len(startstring):-len(endstring)]) + + def parse(self, line): + # Parse the input + params = [param.lower() for param in line.split() if param] + if not '-q' in sys.argv and not '--quiet' in sys.argv: + print 'Recognized input:', ' '.join(params).capitalize() + + # Execute the command, if recognized/supported + command = self.mediaplayer.parse(params[1]) + if command: + os.system(command) + elif not '-q' in sys.argv and not '--quiet' in sys.argv: + print 'Command not supported by %s.' % self.mediaplayer.name + +if __name__ == '__main__': + try: + CommandAndControl(sys.stdin) + except KeyboardInterrupt: + sys.exit(1) --- julius-voxforge-0.1.1~daily20130206.orig/debian/additional/controlapp/README.controlapp +++ julius-voxforge-0.1.1~daily20130206/debian/additional/controlapp/README.controlapp @@ -0,0 +1,39 @@ +Example Media Player Control And Command Application +----------------------------------------------------------- + +This directory contains a simple example of how to control a media player +with some simple voice commands, using the Julius voice recognition engine. + +The included sample script works for Rhythmbox and Banshee. + +== QUICK START == + +First, copy the example files to a directory where you can write, like your +home folder, uncompress the gziped files and adapt the configuration file: + + mkdir ~/julius-controlapp; cd ~/julius-controlapp + cp /usr/share/doc/julius-voxforge/examples/controlapp/* . + cp /usr/share/doc/julius-voxforge/examples/*.jconf* . + gunzip * 2>&1 | grep -v ignored + sed -i 's/sample\.dfa/mediaplayer\.dfa/' *.jconf + sed -i 's/sample\.dict/mediaplayer\.dict/' *.jconf + +Now let's compile the grammar (you will need package "julius" to be installed +for this and the next steps to work): + + mkdfa mediaplayer + +Now you can try it out: + + julius -quiet -input mic -C julian.jconf 2>/dev/null | ./command.py + +If this works as expected, you can now proceed customizing this to suit your +needs. Take a look at /usr/share/doc/julius-voxforge/examples/README, try +modifying the included files and read some of the numerous documentation +available at http://voxforge.org/home/dev for this. + +Note that the .dfa, .dict and .term files are automatically generated with the +"mkdfa" command mentioned above, so whenever you change the .grammar or .voca +files you'll need to repeat that command for your changes to take effect. + + -- Siegfried-A. Gevatter . 19/06/2009 --- julius-voxforge-0.1.1~daily20130206.orig/debian/additional/controlapp/mediaplayer.voca +++ julius-voxforge-0.1.1~daily20130206/debian/additional/controlapp/mediaplayer.voca @@ -0,0 +1,16 @@ +% NS_B + sil + +% NS_E + sil + +% ID +COMPUTER k ax m p y uw t ax + +% COMMAND +PLAY p l ey +NEXT n eh k s t +PREV p r iy v +SHOW sh ow +PAUSE p ao z +SILENCE s ay l ax n s --- julius-voxforge-0.1.1~daily20130206.orig/debian/additional/controlapp/mediaplayer.grammar +++ julius-voxforge-0.1.1~daily20130206/debian/additional/controlapp/mediaplayer.grammar @@ -0,0 +1 @@ +S: NS_B ID COMMAND NS_E