summaryrefslogtreecommitdiffstats
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() {
2)
# String
STRING=`echo $line |cut -b 8-`
+ STRING_MD5=`echo $STRING |md5sum|cut -b-32`
if [ -n "$POOL" ]; then
# we have a common pool of snippets, check that first
# for available mp3 sounds, and if it is available copy
# (symlink!) it over
- if [ -f "$POOL/$STRING.mp3" ]; then
+ if [ -f "$POOL/$STRING_MD5.mp3" ]; then
echo "Re-using $ID from pool"
if [ ! -e "$TEMPDIR/$ID".mp3 ]; then
# only do this if not present
- ln -s "$POOL/$STRING.mp3" "$TEMPDIR/$ID".mp3
+ ln -s "$POOL/$STRING_MD5.mp3" "$TEMPDIR/$ID".mp3
fi
fi
fi
@@ -96,8 +97,8 @@ generateclips() {
voice "$STRING" "$TEMPDIR/$ID".wav
if [ -n "$POOL" ]; then
# create it in the pool, symlink it back
- encode "$TEMPDIR/$ID".wav "$POOL/$STRING".mp3
- ln -s "$POOL/$STRING.mp3" "$TEMPDIR/$ID".mp3
+ encode "$TEMPDIR/$ID".wav "$POOL/$STRING_MD5".mp3
+ ln -s "$POOL/$STRING_MD5.mp3" "$TEMPDIR/$ID".mp3
else
encode "$TEMPDIR/$ID".wav "$TEMPDIR/$ID".mp3
fi
@@ -109,7 +110,7 @@ generateclips() {
)
}
-if [ -z "$3" ]; then
+if [ -z "$4" ]; then
echo "Usage: $0 rockboxdirectory language target targetid [settingsfile]";
exit 32
else