forked from jpawlowski/freeswitch-sounds-tts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate_dummy_from_callie.sh
executable file
·33 lines (28 loc) · 1.02 KB
/
create_dummy_from_callie.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env bash
#
# FreeSwitch
# TTS Voice Prompt Generator
# - Create dummies for missing textfiles which are enclosed in callie voice files -
#
# Copyright (c) 2013, Julian Pawlowski <jp@jps-networks.eu>
# See LICENSE file for details.
#
if [ ! -d ./import/en/us/callie ]; then
echo "ERROR: Callie 8kHz files must be in ./import/en/us/callie/*/8000. Aborting ..."
exit 1
fi
CALLIE_LIST="`find ./import/en/us/callie -type f -name "*.wav"`"
for FILE in $CALLIE_LIST; do
BASENAME="${FILE#.*/}"
FILENAME="${BASENAME%%.*}"
FILENAME_FLAT="${FILENAME#*/}"
FILENAME_FLAT="${FILENAME_FLAT#*/}"
FILENAME_FLAT="${FILENAME_FLAT#*/}"
FILENAME_FLAT="${FILENAME_FLAT#*/}"
FILENAME_STATELESS="`echo $FILENAME_FLAT | sed -e "s/8000\///g"`"
if [ ! -e input/en/${FILENAME_STATELESS}.txt ]; then
echo "$FILENAME_STATELESS not found in input files, creating dummy ..."
mkdir -p input.new/en/${FILENAME_STATELESS%/*}
echo -e "Empty file, please enter text in $FILENAME_STATELESS\n#TODO" > input.new/en/${FILENAME_STATELESS}.txt
fi
done