gTTS (#4899)
* Release prep work * Add CZ support * Prep for release * No more need to prefix unicode strings (we use python3) Some fixes Italian fixes
This commit is contained in:
@@ -33,6 +33,8 @@ else
|
||||
python3 -B ${workdir}/code/tools/nightly22/tts.py es csv files
|
||||
python3 -B ${workdir}/code/tools/nightly22/tts.py it csv files
|
||||
python3 -B ${workdir}/code/tools/nightly22/tts.py de csv files
|
||||
python3 -B ${workdir}/code/tools/nightly22/tts.py cz csv files
|
||||
python3 -B ${workdir}/code/tools/nightly22/tts.py pt csv files
|
||||
|
||||
# Create sdcards.zips for supported platforms
|
||||
mv /tmp/SOUNDS ${workdir}/sdcard/horus/
|
||||
|
||||
+19
-4
@@ -27,15 +27,18 @@ lib_path = os.path.abspath(os.path.join(SOURCE_DIRECTORY, '..', '..', 'radio', '
|
||||
sys.path.append(lib_path)
|
||||
|
||||
def generate(str, filename):
|
||||
if 1:
|
||||
if 0:
|
||||
output = "output.wav"
|
||||
command = 'pico2wave -l=%s -w=%s "%s"' % (voice, output, str)
|
||||
os.system(command.encode('utf-8'))
|
||||
command = "sox %s -r 32000 %s reverse silence 1 0.1 0.1%% reverse" % (output, filename)
|
||||
os.system(command.encode('utf-8'))
|
||||
else:
|
||||
output = "output.mp3"
|
||||
command = 'gtts-cli -l %s -o %s "%s"' % (voice[:2], output, str)
|
||||
os.system(command.encode('utf-8'))
|
||||
command = "sox %s -r 32000 %s reverse silence 1 0.1 0.1%% reverse" % (output, filename)
|
||||
os.system(command.encode('utf-8'))
|
||||
os.system(command.encode('utf-8'))
|
||||
command = "sox %s -r 32000 %s" % (output, filename)
|
||||
os.system(command.encode('utf-8'))
|
||||
|
||||
################################################################
|
||||
|
||||
@@ -70,6 +73,18 @@ if __name__ == "__main__":
|
||||
directory = "es"
|
||||
voice = "es-ES"
|
||||
|
||||
elif "cz" in sys.argv:
|
||||
from tts_cz import systemSounds, sounds
|
||||
|
||||
directory = "cz"
|
||||
voice = "cs-CZ"
|
||||
|
||||
elif "pt" in sys.argv:
|
||||
from tts_pt import systemSounds, sounds
|
||||
|
||||
directory = "pt"
|
||||
voice = "pt-PT"
|
||||
|
||||
else:
|
||||
print("which language?")
|
||||
exit()
|
||||
|
||||
+26
-6
@@ -22,19 +22,27 @@ import zipfile
|
||||
from tts_common import *
|
||||
board = "taranis"
|
||||
|
||||
lib_path = os.path.abspath(os.path.join('code', 'radio', 'util'))
|
||||
SOURCE_DIRECTORY = os.path.dirname(os.path.realpath(__file__))
|
||||
lib_path = os.path.abspath(os.path.join(SOURCE_DIRECTORY, '..', '..', 'radio', 'util'))
|
||||
sys.path.append(lib_path)
|
||||
|
||||
def generate(str, filename):
|
||||
|
||||
command = "pico2wave -l=" + voice + " -w=" + filename + " \"" + str + "\""
|
||||
os.system(command.encode('utf-8'))
|
||||
if 0:
|
||||
output = "output.wav"
|
||||
command = 'pico2wave -l=%s -w=%s "%s"' % (voice, output, str)
|
||||
os.system(command.encode('utf-8'))
|
||||
command = "sox %s -r 32000 %s reverse silence 1 0.1 0.1%% reverse" % (output, filename)
|
||||
os.system(command.encode('utf-8'))
|
||||
else:
|
||||
output = "output.mp3"
|
||||
command = 'gtts-cli -l %s -o %s "%s"' % (voice[:2], output, str)
|
||||
os.system(command.encode('utf-8'))
|
||||
command = "sox %s -r 32000 %s" % (output, filename)
|
||||
os.system(command.encode('utf-8'))
|
||||
|
||||
################################################################
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
|
||||
if "en" in sys.argv:
|
||||
from tts_en import systemSounds, sounds
|
||||
|
||||
@@ -65,6 +73,18 @@ if __name__ == "__main__":
|
||||
directory = "es"
|
||||
voice = "es-ES"
|
||||
|
||||
elif "cz" in sys.argv:
|
||||
from tts_cz import systemSounds, sounds
|
||||
|
||||
directory = "cz"
|
||||
voice = "cs-CZ"
|
||||
|
||||
elif "pt" in sys.argv:
|
||||
from tts_pt import systemSounds, sounds
|
||||
|
||||
directory = "pt"
|
||||
voice = "pt-PT"
|
||||
|
||||
else:
|
||||
print("which language?")
|
||||
exit()
|
||||
|
||||
Reference in New Issue
Block a user