mirror of
https://github.com/opentx/opentx.git
synced 2025-07-13 11:29:51 +03:00
Clean up uneeded
This commit is contained in:
parent
08d07d5005
commit
df21713d90
9 changed files with 0 additions and 724 deletions
|
@ -1,148 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
|
||||
# This script is a modified version to support Linux TTS file generation using PicoTTS
|
||||
|
||||
# Sound pack maintainers (incomplete list) by language alphabetical order
|
||||
# Czech : Martin Hotar
|
||||
# French : Bertrand Songis & André Bernet
|
||||
# English : Rob Thompson & Martin Hotar
|
||||
# German : Romolo Manfredini (Some corrections by Peer)
|
||||
# Italian : Romolo Manfredini
|
||||
# Portuguese : Romolo Manfredini
|
||||
# Spanish : Romolo Manfredini (With the help of Jose Moreno)
|
||||
|
||||
import os
|
||||
import sys
|
||||
import subprocess
|
||||
import zipfile
|
||||
from gtts import gTTS
|
||||
from tts_common import *
|
||||
|
||||
|
||||
board = "taranis"
|
||||
|
||||
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):
|
||||
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"
|
||||
tts = gTTS(text=str, lang=voice[:2])
|
||||
tts.save(output)
|
||||
command = "sox --norm %s -r 32000 %s tempo 1.2" % (output, filename)
|
||||
os.system(command.encode('utf-8'))
|
||||
command = "rm -f output.mp3"
|
||||
os.system(command.encode('utf-8'))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
if "en" in sys.argv:
|
||||
from tts_en import systemSounds, sounds
|
||||
|
||||
directory = "en"
|
||||
voice = "en-US"
|
||||
|
||||
elif "fr" in sys.argv:
|
||||
from tts_fr import systemSounds, sounds
|
||||
|
||||
directory = "fr"
|
||||
voice = "fr-FR"
|
||||
|
||||
elif "it" in sys.argv:
|
||||
from tts_it import systemSounds, sounds
|
||||
|
||||
directory = "it"
|
||||
voice = "it-IT"
|
||||
|
||||
elif "de" in sys.argv:
|
||||
from tts_de import systemSounds, sounds
|
||||
|
||||
directory = "de"
|
||||
voice = "de-DE"
|
||||
|
||||
elif "es" in sys.argv:
|
||||
from tts_es import systemSounds, sounds
|
||||
|
||||
directory = "es"
|
||||
voice = "es-ES"
|
||||
|
||||
elif "cz" in sys.argv:
|
||||
from tts_cz import systemSounds, sounds
|
||||
|
||||
directory = "cz"
|
||||
voice = "cs-CZ"
|
||||
|
||||
elif "ru" in sys.argv:
|
||||
from tts_ru import systemSounds, sounds
|
||||
|
||||
directory = "ru"
|
||||
voice = "ru-RU"
|
||||
|
||||
elif "pt" in sys.argv:
|
||||
from tts_pt import systemSounds, sounds
|
||||
|
||||
directory = "pt"
|
||||
voice = "pt-PT"
|
||||
|
||||
else:
|
||||
print("which language?")
|
||||
exit()
|
||||
|
||||
if "csv" in sys.argv:
|
||||
path = "/tmp/SOUNDS/" + directory + "/SYSTEM/"
|
||||
if not os.path.exists(path):
|
||||
os.makedirs(path)
|
||||
os.chdir(path)
|
||||
with open("%s-%s.csv" % (voice, board), "wb") as csvFile:
|
||||
for s, f in systemSounds:
|
||||
if s and f:
|
||||
l = u""
|
||||
if board in ("sky9x", "taranis"):
|
||||
l += u"SOUNDS/%s/SYSTEM;" % directory
|
||||
l += f + u";" + s + u"\n"
|
||||
csvFile.write(l.encode("utf-8"))
|
||||
for s, f in sounds:
|
||||
if s and f:
|
||||
l = u""
|
||||
if board in ("sky9x", "taranis"):
|
||||
l += u"SOUNDS/%s;" % directory
|
||||
l += f + u";" + s + u"\n"
|
||||
csvFile.write(l.encode("utf-8"))
|
||||
|
||||
if "psv" in sys.argv:
|
||||
path = "/tmp/SOUNDS/" + directory + "/"
|
||||
if not os.path.exists(path):
|
||||
os.makedirs(path)
|
||||
os.chdir(path)
|
||||
with open("%s-%s.psv" % (voice, board), "wb") as csvFile:
|
||||
for s, f in systemSounds:
|
||||
if s and f:
|
||||
l = u"SYSTEM|" + f.replace(".wav", "") + u"|" + s + u"\r\n"
|
||||
csvFile.write(l.encode("windows-1251"))
|
||||
for s, f in sounds:
|
||||
if s and f:
|
||||
l = u"|" + f.replace(".wav", "") + u"|" + s + u"\r\n"
|
||||
csvFile.write(l.encode("windows-1251"))
|
||||
|
||||
if "files" in sys.argv:
|
||||
path = "/tmp/SOUNDS/" + directory + "/SYSTEM/"
|
||||
if not os.path.exists(path):
|
||||
os.makedirs(path)
|
||||
os.chdir(path)
|
||||
for s, f in systemSounds:
|
||||
if s and f:
|
||||
generate(s, f)
|
||||
os.chdir("..")
|
||||
for s, f in sounds:
|
||||
if s and f:
|
||||
generate(s, f)
|
|
@ -1,19 +0,0 @@
|
|||
NO_ALTERNATE = 1024
|
||||
PROMPT_CUSTOM_BASE = 256
|
||||
PROMPT_SYSTEM_BASE = 0
|
||||
board = "taranis"
|
||||
|
||||
import sys
|
||||
|
||||
def filename(idx, alternate=0):
|
||||
ext = ".wav"
|
||||
if isinstance(idx, int):
|
||||
result = "%04d%s" % (idx, ext)
|
||||
elif board in ('sky9x', 'taranis'):
|
||||
result = idx + ext
|
||||
return result
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,71 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
branch=2.3.0
|
||||
docker=rc23
|
||||
workdir=/home/opentx/rc23
|
||||
output=/var/www/html/2.3/rc
|
||||
version=2.3.0
|
||||
|
||||
# Increment RC index
|
||||
index=`cat index.txt`
|
||||
index=`expr $index + 1`
|
||||
suffix="RC$index"
|
||||
|
||||
cd ${workdir}
|
||||
|
||||
# Create on-demand build environment
|
||||
cp code/radio/util/Dockerfile .
|
||||
docker build -t new-${docker} --build-arg OPENTX_VERSION_SUFFIX=${suffix} .
|
||||
set +e
|
||||
docker rmi -f ${docker}
|
||||
set -e
|
||||
docker tag new-${docker} ${docker}
|
||||
docker rmi -f new-${docker}
|
||||
|
||||
# Call sdcard generation
|
||||
code/tools/rc23/build-sdcard.sh
|
||||
|
||||
# Build Linux companion
|
||||
docker run -dit --name companion -v /home/opentx/${docker}:/opentx ${docker}
|
||||
docker exec companion sh -c "mkdir -p build && cd build && cmake /opentx/code && cp radio/src/stamp.h /opentx/binaries/stamp-opentx.txt"
|
||||
docker exec companion rm -rf build
|
||||
if [ ! -f ${output}/companion/linux/companion23_${version}${suffix}_amd64.deb ]; then
|
||||
docker exec companion /opentx/code/tools/build-companion-release.sh /opentx/code /opentx/binaries/
|
||||
docker exec companion sh -c "cp /build/radio/src/lua/*.txt /opentx/binaries"
|
||||
cp -f binaries/*.deb ${output}/companion/linux/companion23_${version}${suffix}_amd64.deb
|
||||
cp -f binaries/lua_fields_*.txt ${output}/firmware
|
||||
fi
|
||||
docker stop companion
|
||||
docker rm companion
|
||||
|
||||
# Request companion compilation on Windows
|
||||
if [ ! -f ${output}/companion/windows/companion-windows-${version}${suffix}.exe ]; then
|
||||
cd ${output}/companion/windows
|
||||
wget -qO- http://winbox.open-tx.org/companion-builds/compile23.php?branch=$branch\&suffix=${suffix}
|
||||
wget -O companion-windows-${version}${suffix}.exe http://winbox.open-tx.org/companion-builds/companion-windows-${version}${suffix}.exe
|
||||
chmod -Rf g+w companion-windows-${version}${suffix}.exe
|
||||
fi
|
||||
|
||||
# Request companion compilation on Mac OS X
|
||||
if [ ! -f ${output}/companion/macosx/opentx-companion-${version}${suffix}.dmg ]; then
|
||||
cd ${output}/companion/macosx
|
||||
wget -qO- http://opentx.blinkt.de:8080/~opentx/build-opentx.py?branch=${branch}\&suffix=${suffix}
|
||||
wget -O opentx-companion-${version}${suffix}.dmg http://opentx.blinkt.de:8080/~opentx/builds/opentx-companion-${version}${suffix}.dmg
|
||||
chmod -Rf g+w opentx-companion-${version}${suffix}.dmg
|
||||
fi
|
||||
|
||||
# Update stamps
|
||||
cp -f $workdir/binaries/stamp-opentx.txt ${output}/firmware
|
||||
echo "#define VERSION \"${version}${suffix}\"" > ${output}/companion/companion-windows.stamp
|
||||
cp -f ${output}/companion/companion-windows.stamp ${output}/companion/companion-macosx.stamp
|
||||
cp -f ${output}/companion/companion-windows.stamp ${output}/companion/companion-linux.stamp
|
||||
|
||||
|
||||
# Clean binaries It will be hosting built on demand firmware
|
||||
rm -rf $workdir/binaries/*
|
||||
rm -rf $workdir/binaries/.lock
|
||||
|
||||
# RC is considered as valid ony if we get to that point
|
||||
echo $index > ${workdir}/index.txt
|
|
@ -1,77 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
set -x
|
||||
|
||||
workdir=/home/opentx/rc23
|
||||
output=/var/www/html/2.3/rc
|
||||
|
||||
# Handle opentx.sdcard.version
|
||||
sdcard_version="2.3V"$(grep 'set(SDCARD_REVISION' ${workdir}/code/CMakeLists.txt | grep -o '".*"' | sed 's/"//g')
|
||||
echo ${sdcard_version} > ${workdir}/code/radio/sdcard/horus/opentx.sdcard.version
|
||||
echo ${sdcard_version} > ${workdir}/code/radio/sdcard/taranis-x9/opentx.sdcard.version
|
||||
echo ${sdcard_version} > ${workdir}/code/radio/sdcard/taranis-x7/opentx.sdcard.version
|
||||
|
||||
|
||||
if cmp --silent ${workdir}/code/radio/sdcard/horus/opentx.sdcard.version ${workdir}/opentx.sdcard.version
|
||||
then
|
||||
exit
|
||||
else
|
||||
cd ${workdir}
|
||||
|
||||
# Copy git sdcard data
|
||||
rm -Rf ${workdir}/sdcard
|
||||
cp -r ${workdir}/code/radio/sdcard .
|
||||
|
||||
# Get images for Horus
|
||||
mkdir -p ${workdir}/sdcard/horus/IMAGES
|
||||
cp /home/opentx/horus-bitmaps/* ${workdir}/sdcard/horus/IMAGES/
|
||||
|
||||
|
||||
# Request sound pack generation
|
||||
if [[ ! -d /tmp/SOUNDS/fr ]];then
|
||||
${workdir}/code/tools/rc23/tts.py en csv files
|
||||
fi
|
||||
if [[ ! -d /tmp/SOUNDS/es ]];then
|
||||
${workdir}/code/tools/rc23/tts.py fr csv files
|
||||
fi
|
||||
if [[ ! -d /tmp/SOUNDS/it ]];then
|
||||
${workdir}/code/tools/rc23/tts.py es csv files
|
||||
fi
|
||||
if [[ ! -d /tmp/SOUNDS/de ]];then
|
||||
${workdir}/code/tools/rc23/tts.py it csv files
|
||||
fi
|
||||
if [[ ! -d /tmp/SOUNDS/cz ]];then
|
||||
${workdir}/code/tools/rc23/tts.py de csv files
|
||||
fi
|
||||
if [[ ! -d /tmp/SOUNDS/pl ]];then
|
||||
${workdir}/code/tools/rc23/tts.py cz csv files
|
||||
fi
|
||||
if [[ ! -d /tmp/SOUNDS/ru ]];then
|
||||
${workdir}/code/tools/rc23/tts.py pt csv files
|
||||
fi
|
||||
${workdir}/code/tools/rc23/tts.py ru csv psv files
|
||||
|
||||
# Create sdcards.zips for supported platforms
|
||||
mv /tmp/SOUNDS ${workdir}/sdcard/horus/
|
||||
mkdir ${workdir}/sdcard/taranis-x9/SOUNDS
|
||||
mkdir ${workdir}/sdcard/taranis-x7/SOUNDS
|
||||
cp -r ${workdir}/sdcard/horus/SOUNDS ${workdir}/sdcard/taranis-x9/
|
||||
cp -r ${workdir}/sdcard/horus/SOUNDS ${workdir}/sdcard/taranis-x7/
|
||||
cd ${workdir}/sdcard/horus && zip -r ${output}/sdcard/sdcard-horus-${sdcard_version}.zip *
|
||||
cd ${workdir}/sdcard/taranis-x9 && zip -r ${output}/sdcard/sdcard-taranis-x9-${sdcard_version}.zip *
|
||||
cd ${workdir}/sdcard/taranis-x7 && zip -r ${output}/sdcard/sdcard-taranis-x7-${sdcard_version}.zip *
|
||||
|
||||
# Create symlinks for other radios
|
||||
ln -s ${output}/sdcard/sdcard-taranis-x7-${sdcard_version}.zip ${output}/sdcard/sdcard-taranis-xlite-${sdcard_version}.zip
|
||||
ln -s ${output}/sdcard/sdcard-taranis-x7-${sdcard_version}.zip ${output}/sdcard/sdcard-taranis-x9lite-${sdcard_version}.zip
|
||||
ln -s ${output}/sdcard/sdcard-taranis-x7-${sdcard_version}.zip ${output}/sdcard/sdcard-jumper-t12-${sdcard_version}.zip
|
||||
|
||||
# remove LUA stuff for 9x platform
|
||||
rm -Rf ${workdir}/sdcard/taranis-x7/SCRIPTS
|
||||
rm -Rf ${workdir}/sdcard/taranis-x7/FrSky-utilities
|
||||
cd ${workdir}/sdcard/taranis-x7 && zip -r ${output}/sdcard/sdcard-9xarm-${sdcard_version}.zip *
|
||||
|
||||
rm -Rf ${workdir}/sdcard
|
||||
cp -r ${workdir}/code/radio/sdcard/horus/opentx.sdcard.version ${workdir}
|
||||
fi
|
|
@ -1,152 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
|
||||
# This script is a modified version to support Linux TTS fiel genration using PicoTTS
|
||||
|
||||
# Sound pack maintainers (incomplete list) by language alphabetical order
|
||||
# Czech : Martin Hotar
|
||||
# French : Bertrand Songis & André Bernet
|
||||
# English : Rob Thompson & Martin Hotar
|
||||
# German : Romolo Manfredini (Some corrections by Peer)
|
||||
# Italian : Romolo Manfredini
|
||||
# Portuguese : Romolo Manfredini
|
||||
# Spanish : Romolo Manfredini (With the help of Jose Moreno)
|
||||
|
||||
# from __future__ import print_function
|
||||
|
||||
import os
|
||||
import sys
|
||||
import subprocess
|
||||
import zipfile
|
||||
from gtts import gTTS
|
||||
from tts_common import *
|
||||
board = "taranis"
|
||||
|
||||
reload(sys)
|
||||
sys.setdefaultencoding('utf8')
|
||||
|
||||
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):
|
||||
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 = u"output.mp3"
|
||||
tts = gTTS(text=str, lang=voice[:2])
|
||||
tts.save(output)
|
||||
command = "sox --norm %s -r 32000 %s tempo 1.2" % (output, filename)
|
||||
os.system(command.encode('utf-8'))
|
||||
command = "rm -f output.mp3"
|
||||
os.system(command.encode('utf-8'))
|
||||
|
||||
################################################################
|
||||
|
||||
if __name__ == "__main__":
|
||||
if "en" in sys.argv:
|
||||
from tts_en import systemSounds, sounds
|
||||
|
||||
directory = "en"
|
||||
voice = "en-US"
|
||||
|
||||
elif "fr" in sys.argv:
|
||||
from tts_fr import systemSounds, sounds
|
||||
|
||||
directory = "fr"
|
||||
voice = "fr-FR"
|
||||
|
||||
elif "it" in sys.argv:
|
||||
from tts_it import systemSounds, sounds
|
||||
|
||||
directory = "it"
|
||||
voice = "it-IT"
|
||||
|
||||
elif "de" in sys.argv:
|
||||
from tts_de import systemSounds, sounds
|
||||
|
||||
directory = "de"
|
||||
voice = "de-DE"
|
||||
|
||||
elif "es" in sys.argv:
|
||||
from tts_es import systemSounds, sounds
|
||||
|
||||
directory = "es"
|
||||
voice = "es-ES"
|
||||
|
||||
elif "cz" in sys.argv:
|
||||
from tts_cz import systemSounds, sounds
|
||||
|
||||
directory = "cz"
|
||||
voice = "cs-CZ"
|
||||
|
||||
elif "ru" in sys.argv:
|
||||
from tts_ru import systemSounds, sounds
|
||||
|
||||
directory = "ru"
|
||||
voice = "ru-RU"
|
||||
|
||||
elif "pt" in sys.argv:
|
||||
from tts_pt import systemSounds, sounds
|
||||
|
||||
directory = "pt"
|
||||
voice = "pt-PT"
|
||||
|
||||
else:
|
||||
print("which language?")
|
||||
exit()
|
||||
|
||||
if "csv" in sys.argv:
|
||||
path = "/tmp/SOUNDS/" + directory + "/SYSTEM/"
|
||||
if not os.path.exists(path):
|
||||
os.makedirs(path)
|
||||
os.chdir(path)
|
||||
with open("%s-%s.csv" % (voice, board), "wb") as csvFile:
|
||||
for s, f in systemSounds:
|
||||
if s and f:
|
||||
l = u""
|
||||
if board in ("sky9x", "taranis"):
|
||||
l += u"SOUNDS/%s/SYSTEM;" % directory
|
||||
l += f + u";" + s + u"\n"
|
||||
csvFile.write(l.encode("utf-8"))
|
||||
for s, f in sounds:
|
||||
if s and f:
|
||||
l = u""
|
||||
if board in ("sky9x", "taranis"):
|
||||
l += u"SOUNDS/%s;" % directory
|
||||
l += f + u";" + s + u"\n"
|
||||
csvFile.write(l.encode("utf-8"))
|
||||
|
||||
if "psv" in sys.argv:
|
||||
path = "/tmp/SOUNDS/" + directory + "/"
|
||||
if not os.path.exists(path):
|
||||
os.makedirs(path)
|
||||
os.chdir(path)
|
||||
with open("%s-%s.psv" % (voice, board), "wb") as csvFile:
|
||||
for s, f in systemSounds:
|
||||
if s and f:
|
||||
l = u"SYSTEM|" + f.replace(".wav", "") + u"|" + s + u"\r\n"
|
||||
csvFile.write(l.encode("windows-1251"))
|
||||
for s, f in sounds:
|
||||
if s and f:
|
||||
l = u"|" + f.replace(".wav", "") + u"|" + s + u"\r\n"
|
||||
csvFile.write(l.encode("windows-1251"))
|
||||
|
||||
|
||||
if "files" in sys.argv:
|
||||
path = "/tmp/SOUNDS/" + directory + "/SYSTEM/"
|
||||
if not os.path.exists(path):
|
||||
os.makedirs(path)
|
||||
os.chdir(path)
|
||||
for s, f in systemSounds:
|
||||
if s and f:
|
||||
generate(s, f)
|
||||
os.chdir("..")
|
||||
for s, f in sounds:
|
||||
if s and f:
|
||||
generate(s, f)
|
|
@ -1,14 +0,0 @@
|
|||
NO_ALTERNATE = 1024
|
||||
PROMPT_CUSTOM_BASE = 256
|
||||
PROMPT_SYSTEM_BASE = 0
|
||||
board = "taranis"
|
||||
|
||||
import sys
|
||||
|
||||
def filename(idx, alternate=0):
|
||||
ext = ".wav"
|
||||
if isinstance(idx, int):
|
||||
result = "%04d%s" % (idx, ext)
|
||||
elif board in ('sky9x', 'taranis'):
|
||||
result = idx + ext
|
||||
return result
|
|
@ -1,77 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
set -x
|
||||
|
||||
workdir=/home/opentx/release23
|
||||
output=/var/www/html/2.3/release
|
||||
|
||||
# Handle opentx.sdcard.version
|
||||
sdcard_version="2.3V"$(grep 'set(SDCARD_REVISION' ${workdir}/code/CMakeLists.txt | grep -o '".*"' | sed 's/"//g')
|
||||
echo ${sdcard_version} > ${workdir}/code/radio/sdcard/horus/opentx.sdcard.version
|
||||
echo ${sdcard_version} > ${workdir}/code/radio/sdcard/taranis-x9/opentx.sdcard.version
|
||||
echo ${sdcard_version} > ${workdir}/code/radio/sdcard/taranis-x7/opentx.sdcard.version
|
||||
|
||||
|
||||
if cmp --silent ${workdir}/code/radio/sdcard/horus/opentx.sdcard.version ${workdir}/opentx.sdcard.version
|
||||
then
|
||||
exit
|
||||
else
|
||||
cd ${workdir}
|
||||
|
||||
# Copy git sdcard data
|
||||
rm -Rf ${workdir}/sdcard
|
||||
cp -r ${workdir}/code/radio/sdcard .
|
||||
|
||||
# Get images for Horus
|
||||
mkdir -p ${workdir}/sdcard/horus/IMAGES
|
||||
cp /home/opentx/horus-bitmaps/* ${workdir}/sdcard/horus/IMAGES/
|
||||
|
||||
|
||||
# Request sound pack generation
|
||||
if [[ ! -d /tmp/SOUNDS/fr ]];then
|
||||
${workdir}/code/tools/release23/tts.py en csv files
|
||||
fi
|
||||
if [[ ! -d /tmp/SOUNDS/es ]];then
|
||||
${workdir}/code/tools/release23/tts.py fr csv files
|
||||
fi
|
||||
if [[ ! -d /tmp/SOUNDS/it ]];then
|
||||
${workdir}/code/tools/release23/tts.py es csv files
|
||||
fi
|
||||
if [[ ! -d /tmp/SOUNDS/de ]];then
|
||||
${workdir}/code/tools/release23/tts.py it csv files
|
||||
fi
|
||||
if [[ ! -d /tmp/SOUNDS/cz ]];then
|
||||
${workdir}/code/tools/release23/tts.py de csv files
|
||||
fi
|
||||
if [[ ! -d /tmp/SOUNDS/pl ]];then
|
||||
${workdir}/code/tools/release23/tts.py cz csv files
|
||||
fi
|
||||
if [[ ! -d /tmp/SOUNDS/ru ]];then
|
||||
${workdir}/code/tools/release23/tts.py pt csv files
|
||||
fi
|
||||
${workdir}/code/tools/release23/tts.py ru csv psv files
|
||||
|
||||
# Create sdcards.zips for supported platforms
|
||||
mv /tmp/SOUNDS ${workdir}/sdcard/horus/
|
||||
mkdir ${workdir}/sdcard/taranis-x9/SOUNDS
|
||||
mkdir ${workdir}/sdcard/taranis-x7/SOUNDS
|
||||
cp -r ${workdir}/sdcard/horus/SOUNDS ${workdir}/sdcard/taranis-x9/
|
||||
cp -r ${workdir}/sdcard/horus/SOUNDS ${workdir}/sdcard/taranis-x7/
|
||||
cd ${workdir}/sdcard/horus && zip -r ${output}/sdcard/sdcard-horus-${sdcard_version}.zip *
|
||||
cd ${workdir}/sdcard/taranis-x9 && zip -r ${output}/sdcard/sdcard-taranis-x9-${sdcard_version}.zip *
|
||||
cd ${workdir}/sdcard/taranis-x7 && zip -r ${output}/sdcard/sdcard-taranis-x7-${sdcard_version}.zip *
|
||||
|
||||
# Create symlinks for other radios
|
||||
ln -s ${output}/sdcard/sdcard-taranis-x7-${sdcard_version}.zip ${output}/sdcard/sdcard-taranis-xlite-${sdcard_version}.zip
|
||||
ln -s ${output}/sdcard/sdcard-taranis-x7-${sdcard_version}.zip ${output}/sdcard/sdcard-taranis-x9lite-${sdcard_version}.zip
|
||||
ln -s ${output}/sdcard/sdcard-taranis-x7-${sdcard_version}.zip ${output}/sdcard/sdcard-jumper-t12-${sdcard_version}.zip
|
||||
|
||||
# remove LUA stuff for 9x platform
|
||||
rm -Rf ${workdir}/sdcard/taranis-x7/SCRIPTS
|
||||
rm -Rf ${workdir}/sdcard/taranis-x7/FrSky-utilities
|
||||
cd ${workdir}/sdcard/taranis-x7 && zip -r ${output}/sdcard/sdcard-9xarm-${sdcard_version}.zip *
|
||||
|
||||
rm -Rf ${workdir}/sdcard
|
||||
cp -r ${workdir}/code/radio/sdcard/horus/opentx.sdcard.version ${workdir}
|
||||
fi
|
|
@ -1,152 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
|
||||
# This script is a modified version to support Linux TTS fiel genration using PicoTTS
|
||||
|
||||
# Sound pack maintainers (incomplete list) by language alphabetical order
|
||||
# Czech : Martin Hotar
|
||||
# French : Bertrand Songis & André Bernet
|
||||
# English : Rob Thompson & Martin Hotar
|
||||
# German : Romolo Manfredini (Some corrections by Peer)
|
||||
# Italian : Romolo Manfredini
|
||||
# Portuguese : Romolo Manfredini
|
||||
# Spanish : Romolo Manfredini (With the help of Jose Moreno)
|
||||
|
||||
# from __future__ import print_function
|
||||
|
||||
import os
|
||||
import sys
|
||||
import subprocess
|
||||
import zipfile
|
||||
from gtts import gTTS
|
||||
from tts_common import *
|
||||
board = "taranis"
|
||||
|
||||
reload(sys)
|
||||
sys.setdefaultencoding('utf8')
|
||||
|
||||
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):
|
||||
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 = u"output.mp3"
|
||||
tts = gTTS(text=str, lang=voice[:2])
|
||||
tts.save(output)
|
||||
command = "sox --norm %s -r 32000 %s tempo 1.2" % (output, filename)
|
||||
os.system(command.encode('utf-8'))
|
||||
command = "rm -f output.mp3"
|
||||
os.system(command.encode('utf-8'))
|
||||
|
||||
################################################################
|
||||
|
||||
if __name__ == "__main__":
|
||||
if "en" in sys.argv:
|
||||
from tts_en import systemSounds, sounds
|
||||
|
||||
directory = "en"
|
||||
voice = "en-US"
|
||||
|
||||
elif "fr" in sys.argv:
|
||||
from tts_fr import systemSounds, sounds
|
||||
|
||||
directory = "fr"
|
||||
voice = "fr-FR"
|
||||
|
||||
elif "it" in sys.argv:
|
||||
from tts_it import systemSounds, sounds
|
||||
|
||||
directory = "it"
|
||||
voice = "it-IT"
|
||||
|
||||
elif "de" in sys.argv:
|
||||
from tts_de import systemSounds, sounds
|
||||
|
||||
directory = "de"
|
||||
voice = "de-DE"
|
||||
|
||||
elif "es" in sys.argv:
|
||||
from tts_es import systemSounds, sounds
|
||||
|
||||
directory = "es"
|
||||
voice = "es-ES"
|
||||
|
||||
elif "cz" in sys.argv:
|
||||
from tts_cz import systemSounds, sounds
|
||||
|
||||
directory = "cz"
|
||||
voice = "cs-CZ"
|
||||
|
||||
elif "ru" in sys.argv:
|
||||
from tts_ru import systemSounds, sounds
|
||||
|
||||
directory = "ru"
|
||||
voice = "ru-RU"
|
||||
|
||||
elif "pt" in sys.argv:
|
||||
from tts_pt import systemSounds, sounds
|
||||
|
||||
directory = "pt"
|
||||
voice = "pt-PT"
|
||||
|
||||
else:
|
||||
print("which language?")
|
||||
exit()
|
||||
|
||||
if "csv" in sys.argv:
|
||||
path = "/tmp/SOUNDS/" + directory + "/SYSTEM/"
|
||||
if not os.path.exists(path):
|
||||
os.makedirs(path)
|
||||
os.chdir(path)
|
||||
with open("%s-%s.csv" % (voice, board), "wb") as csvFile:
|
||||
for s, f in systemSounds:
|
||||
if s and f:
|
||||
l = u""
|
||||
if board in ("sky9x", "taranis"):
|
||||
l += u"SOUNDS/%s/SYSTEM;" % directory
|
||||
l += f + u";" + s + u"\n"
|
||||
csvFile.write(l.encode("utf-8"))
|
||||
for s, f in sounds:
|
||||
if s and f:
|
||||
l = u""
|
||||
if board in ("sky9x", "taranis"):
|
||||
l += u"SOUNDS/%s;" % directory
|
||||
l += f + u";" + s + u"\n"
|
||||
csvFile.write(l.encode("utf-8"))
|
||||
|
||||
if "psv" in sys.argv:
|
||||
path = "/tmp/SOUNDS/" + directory + "/"
|
||||
if not os.path.exists(path):
|
||||
os.makedirs(path)
|
||||
os.chdir(path)
|
||||
with open("%s-%s.psv" % (voice, board), "wb") as csvFile:
|
||||
for s, f in systemSounds:
|
||||
if s and f:
|
||||
l = u"SYSTEM|" + f.replace(".wav", "") + u"|" + s + u"\r\n"
|
||||
csvFile.write(l.encode("windows-1251"))
|
||||
for s, f in sounds:
|
||||
if s and f:
|
||||
l = u"|" + f.replace(".wav", "") + u"|" + s + u"\r\n"
|
||||
csvFile.write(l.encode("windows-1251"))
|
||||
|
||||
|
||||
if "files" in sys.argv:
|
||||
path = "/tmp/SOUNDS/" + directory + "/SYSTEM/"
|
||||
if not os.path.exists(path):
|
||||
os.makedirs(path)
|
||||
os.chdir(path)
|
||||
for s, f in systemSounds:
|
||||
if s and f:
|
||||
generate(s, f)
|
||||
os.chdir("..")
|
||||
for s, f in sounds:
|
||||
if s and f:
|
||||
generate(s, f)
|
|
@ -1,14 +0,0 @@
|
|||
NO_ALTERNATE = 1024
|
||||
PROMPT_CUSTOM_BASE = 256
|
||||
PROMPT_SYSTEM_BASE = 0
|
||||
board = "taranis"
|
||||
|
||||
import sys
|
||||
|
||||
def filename(idx, alternate=0):
|
||||
ext = ".wav"
|
||||
if isinstance(idx, int):
|
||||
result = "%04d%s" % (idx, ext)
|
||||
elif board in ('sky9x', 'taranis'):
|
||||
result = idx + ext
|
||||
return result
|
Loading…
Add table
Add a link
Reference in a new issue