diff options
Diffstat (limited to 'tools/genvoice.sh')
-rwxr-xr-x | tools/genvoice.sh | 11 |
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 | ||
112 | if [ -z "$3" ]; then | 113 | if [ -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 |
115 | else | 116 | else |