http://volker.orcon.net.nz/linux/vvfiles/viavoice-3.1-SuSE7.3-020104.patch

Patch to fix ViaVoice 3.1 from Mandrake 8.0 running on SuSE 7.3.

Volker Kuhlmann    04 Jan 2002


--- /usr/bin/vvsetenv.orig	Thu Nov 23 12:42:43 2000
+++ /usr/bin/vvsetenv	Thu Jan  3 19:47:24 2002
@@ -1,3 +1,9 @@
+#!/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.
+# As this file must be sourced, the shell specification is irrelevant anyway,
+# however it is useful to have it because it helps editors detect the file type
+# for syntax highlighting.
 #///////////////////////////////////////////////////////////////////////////////
 #//===========================================================================//
 #// COPYRIGHT:                                                                //
@@ -20,7 +26,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 +52,29 @@
   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
+
+#------------------------------------------
+# Set length of wait when exiting
+#------------------------------------------
+# This seems very silly - what's its use? IBM has 4, we'll try waiting much
+# shorter for nothing.
+export SPCH_WAITEXIT=1
+
+#------------------------------------------
+# Set length of wait when starting java
+#------------------------------------------
+# IBM uses 2. Useless - axe it.
+export SPCH_WAITJAVA=0
--- /usr/bin/vvstartaudiosetup.orig	Thu Nov 23 12:42:44 2000
+++ /usr/bin/vvstartaudiosetup	Thu Jan  3 19:45:06 2002
@@ -1,3 +1,4 @@
+#!/bin/sh
 #///////////////////////////////////////////////////////////////////////////////
 #//===========================================================================//
 #// COPYRIGHT:                                                                //
@@ -123,8 +124,7 @@
 #
 # USE IBM JAVA =)
 #
-export PATH=/opt/IBMJava2-13/jre/bin:$PATH
+export PATH=$SPCH_JAVA/bin:$PATH
 java com.ibm.speechapps.userwizard.UWizAudSet $1
 fi
-sleep 4
-
+sleep $SPCH_WAITEXIT
--- /usr/bin/vvstartdictation.orig	Fri Dec  1 11:03:09 2000
+++ /usr/bin/vvstartdictation	Thu Jan  3 20:04:14 2002
@@ -63,8 +63,8 @@
 echo $STARTING $VVDICTATION
 echo $JAVANEEDED
 echo $JAVAWAIT
-sleep 2
 . vvsetenv $VVENGINELANG
+sleep $SPCH_WAITJAVA
 /usr/lib/ViaVoice/bin/vvsetuser $1
 export SPCH_PATH=$SPCH_PATH:/usr/lib/ViaVoice/javaspeakpad/data/$1/pools
 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/ViaVoice/javaspeakpad/bin
@@ -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	Thu Jan  3 19:44:49 2002
@@ -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.UWizJustEnr $1
 fi
-sleep 4
+sleep $SPCH_WAITEXIT
--- /usr/bin/vvstartuserguru.orig	Thu Nov 23 12:42:44 2000
+++ /usr/bin/vvstartuserguru	Thu Jan  3 19:44:36 2002
@@ -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
+sleep $SPCH_WAITEXIT
--- /dev/null	Sun Nov  4 16:03:49 2001
+++ /usr/bin/viavoice	Thu Jan  3 20:06:07 2002
@@ -0,0 +1,34 @@
+#!/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.conf
+#   /etc/asound.conf.viavoice
+#
+# Volker Kuhlmann
+#   9, 10 Sep; 10 Dec 2001; 3 Jan 2002
+#
+
+mixerloaded=
+if alsactl 2>/dev/null; then
+    for f in \
+	$HOME/viavoice/alsa.conf \
+    	/etc/asound.conf.viavoice \
+	; 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."
+echo ""
+exec /usr/bin/vvstartdictation "$@"
--- /dev/null	Sun Nov  4 16:03:49 2001
+++ /usr/bin/vvuser	Mon Nov  5 16:37:16 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 "$@"
