summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJonas Häggqvist <rasher@rasher.dk>2007-08-11 22:16:50 +0000
committerJonas Häggqvist <rasher@rasher.dk>2007-08-11 22:16:50 +0000
commitdbeee722db4bb81b6470881a6c6a808910e04d12 (patch)
tree10579a93cbbe0ef17906318be4658b63f11c7c87 /tools
parent9824dac9e5ff2856cb64980f3bddf21d9a6faa26 (diff)
downloadrockbox-dbeee722db4bb81b6470881a6c6a808910e04d12.tar.gz
rockbox-dbeee722db4bb81b6470881a6c6a808910e04d12.zip
Use md5sum of the string for pool clip filenames rather than the string itself. Avoids problems with illegal characters. This should be a proper fix of FS#7575 unless there are other, similar issues.
Also correctly check number of arguments to genvoice.sh. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14285 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'tools')
-rwxr-xr-xtools/genvoice.sh11
1 files changed, 6 insertions, 5 deletions
diff --git a/tools/genvoice.sh b/tools/genvoice.sh
index 15028e3bd1..73b005f697 100755
--- a/tools/genvoice.sh
+++ b/tools/genvoice.sh
@@ -76,16 +76,17 @@ generateclips() {
76 2) 76 2)
77 # String 77 # String
78 STRING=`echo $line |cut -b 8-` 78 STRING=`echo $line |cut -b 8-`
79 STRING_MD5=`echo $STRING |md5sum|cut -b-32`
79 80
80 if [ -n "$POOL" ]; then 81 if [ -n "$POOL" ]; then
81 # we have a common pool of snippets, check that first 82 # we have a common pool of snippets, check that first
82 # for available mp3 sounds, and if it is available copy 83 # for available mp3 sounds, and if it is available copy
83 # (symlink!) it over 84 # (symlink!) it over
84 if [ -f "$POOL/$STRING.mp3" ]; then 85 if [ -f "$POOL/$STRING_MD5.mp3" ]; then
85 echo "Re-using $ID from pool" 86 echo "Re-using $ID from pool"
86 if [ ! -e "$TEMPDIR/$ID".mp3 ]; then 87 if [ ! -e "$TEMPDIR/$ID".mp3 ]; then
87 # only do this if not present 88 # only do this if not present
88 ln -s "$POOL/$STRING.mp3" "$TEMPDIR/$ID".mp3 89 ln -s "$POOL/$STRING_MD5.mp3" "$TEMPDIR/$ID".mp3
89 fi 90 fi
90 fi 91 fi
91 fi 92 fi
@@ -96,8 +97,8 @@ generateclips() {
96 voice "$STRING" "$TEMPDIR/$ID".wav 97 voice "$STRING" "$TEMPDIR/$ID".wav
97 if [ -n "$POOL" ]; then 98 if [ -n "$POOL" ]; then
98 # create it in the pool, symlink it back 99 # create it in the pool, symlink it back
99 encode "$TEMPDIR/$ID".wav "$POOL/$STRING".mp3 100 encode "$TEMPDIR/$ID".wav "$POOL/$STRING_MD5".mp3
100 ln -s "$POOL/$STRING.mp3" "$TEMPDIR/$ID".mp3 101 ln -s "$POOL/$STRING_MD5.mp3" "$TEMPDIR/$ID".mp3
101 else 102 else
102 encode "$TEMPDIR/$ID".wav "$TEMPDIR/$ID".mp3 103 encode "$TEMPDIR/$ID".wav "$TEMPDIR/$ID".mp3
103 fi 104 fi
@@ -109,7 +110,7 @@ generateclips() {
109 ) 110 )
110} 111}
111 112
112if [ -z "$3" ]; then 113if [ -z "$4" ]; then
113 echo "Usage: $0 rockboxdirectory language target targetid [settingsfile]"; 114 echo "Usage: $0 rockboxdirectory language target targetid [settingsfile]";
114 exit 32 115 exit 32
115else 116else