#!/bin/sh # # /usr/bin/viavoice # Restore alsa mixer settings for ViaVoice and start dictation. # Mixer settings are restored from the first of these files found: # $HOME/viavoice/alsa.state # /etc/asound.state.viavoice # # Volker Kuhlmann # 9, 10 Sep; 10 Dec 2001; 3 Jan 2002; 24 Feb 2003 # statefiles=" $HOME/viavoice/alsa.state /etc/asound.state.viavoice " mixerloaded= if alsactl 2>/dev/null; then for f in $statefiles; do if [ -r "$f" ]; then echo "Restoring mixer settings from $f" alsactl -f "$f" restore "$@" mixerloaded=1 break fi done else echo "Can't execute alsactl - unable to restore mixer settings." fi test -z "$mixerloaded" && echo "\ Can't find any mixer settings to restore, ensure mixer settings are correct or ViaVoice might not run too well. " exec /usr/bin/vvstartdictation "$@"