--- /dev/null
+#!/bin/bash
+
+VERBOSITY=${VERBOSITY:--vvv}
+PLUGINDIR=${PLUGINDIR:-$(pwd)/src/.libs}
+CONFIGFILE=${CONFIGFILE:-$(pwd)/speech-recognition.conf}
+
+plugins="simple-disambiguator sphinx-speech simple-voice"
+clients="search-client mpris2-client bluetooth-client"
+PULSESRC=""
+
+select_input_device () {
+ local _pcidev _usbdev _dev _cnt _i _def _choice=""
+
+ _pcidev=`pactl list sources | grep Name: | tr -s '\t' ' ' |
+ sed 's/^ *Name: //g' | grep -v monitor | grep pci`
+ _usbdev=`pactl list sources | grep Name: | tr -s '\t' ' ' |
+ sed 's/^ *Name: //g' | grep -v monitor | grep usb`
+
+ _cnt=$((`echo $_pcidev | wc -l` + `echo $_usbdev | wc -l`))
+
+ while [ -z "$_choice" ]; do
+ echo "Please select an available input device:"
+ _i=1
+
+ if [ -n "$_usbdev" ]; then
+ echo " * USB devices:"
+ for _dev in $_usbdev; do
+ [ "$_i" = "1" ] && _def="(default)" || _def=""
+ echo " $_i: $_dev $_def"
+ _i=$(($_i + 1))
+ done
+ fi
+
+ if [ -n "$_pcidev" ]; then
+ echo " * PCI devices:"
+ for _dev in $_pcidev; do
+ [ "$_i" = "1" ] && _def="(default)" || _def=""
+ echo " $_i: $_dev $_def"
+ _i=$(($_i + 1))
+ done
+ fi
+
+ echo " * Preconfigured device:"
+ echo " $_i: from the config file"
+
+ read -p "Please select 1 - $_cnt (default: 1): " _choice
+ [ -z "$_choice" ] && _choice=1
+
+ if [ "$_choice" -lt 1 -o "$_choice" -gt $(($_cnt + 1)) ]; then
+ _choice=""
+ fi
+ done
+
+ if [ "$_choice" = "$(($_cnt + 1))" ]; then
+ _dev=""
+ else
+ [ -n "$_usbdev" ] && _t=" " || _t=""
+ _dev=`echo "$_usbdev${_t}$_pcidev" | tr ' ' '\n' |
+ head -$_choice | tail -1`
+ fi
+
+ PULSESRC="$_dev"
+}
+
+select_input_device
+if [ -n "$PULSESRC" ]; then
+ PULSESRC="-s sphinx.pulsesrc=$PULSESRC"
+fi
+
+LOAD_OPTIONS=""
+for i in $plugins $clients; do
+ LOAD_OPTIONS="$LOAD_OPTIONS -L $i"
+done
+
+EXTRA_OPTIONS=""
+while [ -n "$1" ]; do
+ case $1 in
+ --valgrind)
+ export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$PUGINDIR"
+ opts="${1#--valgrind}"
+ case $opts in
+ =*) xeq="valgrind ${opts#=}";;
+ *) xeq="valgrind --leak-check=full";;
+ esac
+ ;;
+ *)
+ EXTRA_OPTIONS="$EXTRA_OPTIONS $1"
+ ;;
+ esac
+ shift
+done
+
+$xeq ./src/srs-daemon -f $VERBOSITY -P $PLUGINDIR -c $CONFIGFILE \
+ $LOAD_OPTIONS $PULSESRC $EXTRA_OPTIONS
--- /dev/null
+sphinx.record = foo.wav
+sphinx.pulsesrc = alsa_input.usb-Logitech_Logitech_USB_Microphone-00-Microphone.analog-mono
+sphinx.hmm = /usr/share/pocketsphinx/model/hmm/en_US/hub4wsj_sc_8k
+sphinx.lm = dictionaries/demo/demo.DMP
+sphinx.dict = dictionaries/demo/demo.dic
+sphinx.fsg = dictionaries/demo/demo.fsg
+sphinx.decoder = general
+sphinx.general.lm = /usr/share/pocketsphinx/model/lm/en_US/wsj0vp.5000.DMP
+sphinx.general.dict = /usr/share/pocketsphinx/model/lm/en_US/cmu07a.dic
+mpris2.player1 = rhythmbox
+mpris2.rhythmbox.service = org.gnome.Rhythmbox3
+mpris2.rhythmbox.object = /org/gnome/Rhythmbox3
+mpris2.player2 = Anssi_Kostiainen__Intel____s_iPhone_Music
+# search.command = chromium-browser "http://google.com/search?q=__url__"
+# feedback effects for unrecognized commands
+feedback.tts.sorry1 = Sorry, I did not understand that.
+feedback.tts.sorry2 = Sorry, I did not get that.
+feedback.sound.taxi0 = ./effects/effect-youtalkingtome-0.wav
+feedback.sound.taxi1 = ./effects/effect-youtalkingtome-1.wav
+feedback.sound.repeat = ./effects/effect-repeat.wav
+feedback.sound.taxi2 = ./effects/effect-youtalkingtome-2.wav
+feedback.sound.what = ./effects/effect-what-0.wav