--- /usr/bin/vvsetenv.orig	Thu Nov 23 12:42:43 2000
+++ /usr/bin/vvsetenv	Mon Sep 10 13:03:19 2001
@@ -1,3 +1,6 @@
+#!/bin/bash
+# Dear IBM: it's not very useful to have this line displaced from the top
+# of the file by a big copyright statement.
 #///////////////////////////////////////////////////////////////////////////////
 #//===========================================================================//
 #// COPYRIGHT:                                                                //
@@ -20,7 +23,6 @@
 #//     vvstartuserwizard: To start ViaVoice Userwizard
 #//
 #///////////////////////////////////////////////////////////////////////////////
-#!/bin/bash
 #-------------------------------------------------------------------------
 # Script to set all of the environment variables that the speech engine
 # is going to be using
@@ -47,11 +49,16 @@
   export SPCH_DIR=${HOME}/viavoice/temp/tmp
   export SPCH_UWIZ_LOC=/usr/lib/ViaVoice/UWiz
 
-
 #------------------------------------------
 # Setup Class Paths for Java
-# 
-#
+#------------------------------------------
 export CLASSPATH=/usr/lib/ViaVoice/bin/classes/userwizardApp.zip:/usr/lib/ViaVoice/bin/classes/userwizardComponents.zip:/usr/lib/ViaVoice/bin/classes/userwizardCtrls.zip:$CLASSPATH
 
-export LD_LIBRARY_PATH=/usr/lib:$LD_LIBRARY_PATH
+#------------------------------------------
+# Setup location of java used for ViaVoice
+#------------------------------------------
+export SPCH_JAVA=/usr/lib/jdk1.3/jre
+
+# This diddling with LD_LIBRARY_PATH is completely unnecessary.
+# /usr/lib does not contain any ViaVoice-related libraries.
+#export LD_LIBRARY_PATH=/usr/lib:$LD_LIBRARY_PATH
--- /usr/bin/vvstartaudiosetup.orig	Thu Nov 23 12:42:44 2000
+++ /usr/bin/vvstartaudiosetup	Mon Sep 10 13:03:19 2001
@@ -1,3 +1,4 @@
+#!/bin/sh
 #///////////////////////////////////////////////////////////////////////////////
 #//===========================================================================//
 #// COPYRIGHT:                                                                //
--- /usr/bin/vvstartdictation.orig	Fri Dec  1 11:03:09 2000
+++ /usr/bin/vvstartdictation	Mon Sep 10 13:03:19 2001
@@ -72,6 +72,6 @@
 #
 # USE IBM JAVA =)
 #
-export PATH=/usr/lib/ViaVoice/IBMJava2-13/jre/bin:$PATH
+export PATH=$SPCH_JAVA/bin:$PATH
 java -jar speakpad.jar -gl $1
 exit 0
--- /usr/bin/vvstartenrollment.orig	Thu Nov 23 12:42:44 2000
+++ /usr/bin/vvstartenrollment	Mon Sep 10 13:03:19 2001
@@ -1,3 +1,4 @@
+#!/bin/sh
 #///////////////////////////////////////////////////////////////////////////////
 #//===========================================================================//
 #// COPYRIGHT:                                                                //
--- /usr/bin/vvstartuserguru.orig	Thu Nov 23 12:42:44 2000
+++ /usr/bin/vvstartuserguru	Mon Sep 10 13:03:19 2001
@@ -1,3 +1,4 @@
+#!/bin/sh
 #///////////////////////////////////////////////////////////////////////////////
 #//===========================================================================//
 #// COPYRIGHT:                                                                //
@@ -123,7 +124,7 @@
 #
 # USE IBM JAVA =)
 #
-export PATH=/opt/IBMJava2-13/jre/bin:$PATH
+export PATH=$SPCH_JAVA/bin:$PATH
 java com.ibm.speechapps.userwizard.UWiz $1
 fi
 sleep 4
--- /dev/null	Sat Jul 14 17:00:37 2001
+++ /usr/bin/viavoice	Mon Sep 10 13:03:19 2001
@@ -0,0 +1,28 @@
+#!/bin/sh
+#
+# /usr/bin/viavoice
+# Restore alsa mixer settings for ViaVoice and start dictation
+#
+# Volker Kuhlmann
+#   9, 10 Sep 2001
+#
+
+f=
+if alsactl 2>/dev/null; then
+    if [ -r /etc/asound.conf.viavoice ]; then
+	echo "Restoring mixer settings from /etc/asound.conf.viavoice"
+	alsactl -f /etc/asound.conf.viavoice restore "$@"
+	f=1
+    fi
+    if [ -r $HOME/viavoice/alsa.conf ]; then
+	echo "Restoring mixer settings from $HOME/viavoice/alsa.conf"
+	alsactl -f $HOME/viavoice/alsa.conf restore "$@"
+	f=1
+    fi
+else
+    echo "Can't execute alsactl - unable to restore mixer settings."
+fi
+test -z "$f" && echo \
+"Can't find any mixer settings to restore, ViaVoice might not run too well."
+echo ""
+exec /usr/bin/vvstartdictation
--- /dev/null	Sat Jul 14 17:00:37 2001
+++ /usr/bin/vvuser	Mon Sep 10 13:03:19 2001
@@ -0,0 +1,7 @@
+#!/bin/sh
+# Run the program of ViaVoice which deals with creating/deleteing ViaVoice
+# users and voice models. Make this a stand-alone prgram.
+# Volker Kuhlmann
+#   9 Sep 2001
+source vvsetenv
+exec /usr/lib/ViaVoice/bin/vvuser "$@"
