Merge from 2.3
This commit is contained in:
@@ -1,27 +0,0 @@
|
||||
# An Debian image for compiling OpenTX 2.2
|
||||
|
||||
FROM debian:stretch
|
||||
|
||||
RUN DEBIAN_FRONTEND=noninteractive apt-get -y update
|
||||
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install build-essential cmake gcc git lib32ncurses5 lib32z1 libfox-1.6-dev libsdl1.2-dev \
|
||||
qt5-default qtmultimedia5-dev qttools5-dev qttools5-dev-tools libqt5svg5-dev \
|
||||
software-properties-common wget zip python-pip python-pil libgtest-dev
|
||||
|
||||
RUN python -m pip install filelock
|
||||
|
||||
RUN wget -q https://launchpad.net/gcc-arm-embedded/4.7/4.7-2013-q3-update/+download/gcc-arm-none-eabi-4_7-2013q3-20130916-linux.tar.bz2 && \
|
||||
tar xjf gcc-arm-none-eabi-4_7-2013q3-20130916-linux.tar.bz2 && \
|
||||
mv gcc-arm-none-eabi-4_7-2013q3 /opt/gcc-arm-none-eabi
|
||||
|
||||
|
||||
#RUN wget -q http://ftp.de.debian.org/debian/pool/main/m/mpclib/libmpc2_0.9-4_amd64.deb && \
|
||||
# dpkg -i libmpc2_0.9-4_amd64.deb
|
||||
|
||||
VOLUME ["/opentx"]
|
||||
|
||||
ENV PATH $PATH:/opt/gcc-arm-none-eabi/bin:/opentx/code/radio/util
|
||||
|
||||
ARG OPENTX_VERSION_SUFFIX=
|
||||
ENV OPENTX_VERSION_SUFFIX ${OPENTX_VERSION_SUFFIX}
|
||||
|
||||
WORKDIR /build
|
||||
@@ -1,47 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
import sys
|
||||
import re
|
||||
|
||||
|
||||
if len(sys.argv) > 1:
|
||||
inputFile = sys.argv[1]
|
||||
inp = open(inputFile, "r")
|
||||
else:
|
||||
inp = sys.stdin
|
||||
|
||||
pattern = re.compile("#\d+")
|
||||
while True:
|
||||
skip = False
|
||||
line = inp.readline()
|
||||
if len(line) == 0:
|
||||
break
|
||||
line = line.strip('\r\n')
|
||||
|
||||
if len(line) == 0:
|
||||
skip = True
|
||||
if line.startswith("<"):
|
||||
skip = True
|
||||
if line.startswith("["):
|
||||
skip = True
|
||||
|
||||
if not skip:
|
||||
# line = line.strip()
|
||||
# print("line: %s" % line)
|
||||
found = re.findall(pattern, line)
|
||||
if len(found) > 0:
|
||||
for issue in found:
|
||||
line = line.replace(issue, '')
|
||||
# add issues
|
||||
issue_links = ["<a href=https://github.com/opentx/opentx/issues/%d>#%d</a>" % (int(issue[1:]), int(issue[1:])) for issue in found]
|
||||
links = "(" + ", ".join(issue_links) + ")"
|
||||
line = "<li>" + line + " " + links + "</li>"
|
||||
|
||||
print(line)
|
||||
|
||||
|
||||
inp.close()
|
||||
sys.exit(0)
|
||||
@@ -137,7 +137,7 @@ def main():
|
||||
elif board_name == "t12":
|
||||
cmake_options["PCB"] = "X7"
|
||||
cmake_options["PCBREV"] = "T12"
|
||||
firmware_options = options_taranis_x9dp
|
||||
firmware_options = options_jumper_t12
|
||||
maxsize = 65536 * 8
|
||||
elif board_name == "t16":
|
||||
cmake_options["PCB"] = "X10"
|
||||
|
||||
+12
-1
@@ -199,6 +199,18 @@ options_horus_x10express = {
|
||||
"flexr9m": ("MODULE_PROTOCOL_FLEX", "YES", None)
|
||||
}
|
||||
|
||||
options_jumper_t12 = {
|
||||
"noheli": ("HELI", "NO", "YES"),
|
||||
"ppmus": ("PPM_UNIT", "US", "PERCENT_PREC1"),
|
||||
"lua": ("LUA", "YES", "NO_MODEL_SCRIPTS"),
|
||||
"nogvars": ("GVARS", "NO", "YES"),
|
||||
"faimode": ("FAI", "YES", None),
|
||||
"faichoice": ("FAI", "CHOICE", None),
|
||||
"nooverridech": ("OVERRIDE_CHANNEL_FUNCTION", "NO", "YES"),
|
||||
"flexr9m": ("MODULE_PROTOCOL_FLEX", "YES", None),
|
||||
"internalmulti": ("INTERNAL_MODULE_MULTI", "YES", "NO"),
|
||||
}
|
||||
|
||||
options_jumper_t16 = {
|
||||
"noheli": ("HELI", "NO", "YES"),
|
||||
"ppmus": ("PPM_UNIT", "US", "PERCENT_PREC1"),
|
||||
@@ -207,7 +219,6 @@ options_jumper_t16 = {
|
||||
"faimode": ("FAI", "YES", None),
|
||||
"faichoice": ("FAI", "CHOICE", None),
|
||||
"nooverridech": ("OVERRIDE_CHANNEL_FUNCTION", "NO", "YES"),
|
||||
"eu": ("MODULE_PROTOCOL_D8", "NO", "YES"),
|
||||
"flexr9m": ("MODULE_PROTOCOL_FLEX", "YES", None),
|
||||
"internalmulti": ("INTERNAL_MODULE_MULTI", "YES", "NO"),
|
||||
"bluetooth": ("BLUETOOTH", "YES", "NO"),
|
||||
|
||||
@@ -14,14 +14,17 @@ if sys.platform == "darwin":
|
||||
clang.cindex.Config.set_library_file('/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libclang.dylib')
|
||||
elif os.path.exists('/Library/Developer/CommandLineTools/usr/lib/libclang.dylib'):
|
||||
clang.cindex.Config.set_library_file('/Library/Developer/CommandLineTools/usr/lib/libclang.dylib')
|
||||
|
||||
if sys.platform == "linux2":
|
||||
if os.path.exists('/usr/lib/x86_64-linux-gnu/libclang-3.8.so.1'):
|
||||
clang.cindex.Config.set_library_file('/usr/lib/x86_64-linux-gnu/libclang-3.8.so.1')
|
||||
elif sys.platform.startswith("linux"):
|
||||
for version in ("7", "6.0", "3.8"):
|
||||
libclang = "/usr/lib/x86_64-linux-gnu/libclang-%s.so.1" % version
|
||||
if os.path.exists(libclang):
|
||||
clang.cindex.Config.set_library_file(libclang)
|
||||
break
|
||||
|
||||
structs = []
|
||||
extrastructs = []
|
||||
|
||||
|
||||
def build_struct(cursor, anonymousUnion=False):
|
||||
if not anonymousUnion:
|
||||
structs.append(cursor.spelling)
|
||||
@@ -30,9 +33,9 @@ def build_struct(cursor, anonymousUnion=False):
|
||||
for c in cursor.get_children():
|
||||
if c.kind == clang.cindex.CursorKind.UNION_DECL:
|
||||
if c.spelling:
|
||||
raise "Cannot handle non anonymous unions"
|
||||
raise Exception("Cannot handle non anonymous unions")
|
||||
|
||||
copiedUnionMember = False
|
||||
copied_union_member = False
|
||||
for uc in c.get_children():
|
||||
if not uc.spelling or uc.kind == clang.cindex.CursorKind.PACKED_ATTR:
|
||||
# Ignore
|
||||
@@ -40,11 +43,11 @@ def build_struct(cursor, anonymousUnion=False):
|
||||
else:
|
||||
# per default we copy only the first member of a union and warn if there are more
|
||||
# members (declare the other members NOBACKUP)
|
||||
if copiedUnionMember:
|
||||
print ("Warning more than one union member (%s) in anynomous union inside struct %s, consider NOBACKUP statements" % (uc.spelling, cursor.spelling), file=sys.stderr)
|
||||
if copied_union_member:
|
||||
print("Warning more than one union member (%s) in anynomous union inside struct %s, consider NOBACKUP statements" % (uc.spelling, cursor.spelling), file=sys.stderr)
|
||||
else:
|
||||
copy_decl(uc, uc.spelling)
|
||||
copiedUnionMember = True
|
||||
copied_union_member = True
|
||||
|
||||
elif c.kind == clang.cindex.CursorKind.FIELD_DECL:
|
||||
copy_decl(c, c.spelling)
|
||||
@@ -52,6 +55,7 @@ def build_struct(cursor, anonymousUnion=False):
|
||||
if not anonymousUnion:
|
||||
print("}\n")
|
||||
|
||||
|
||||
def build(cursor):
|
||||
result = []
|
||||
for c in cursor.get_children():
|
||||
@@ -61,13 +65,13 @@ def build(cursor):
|
||||
for c, spelling in extrastructs:
|
||||
print("template <class A, class B>\nvoid copy%s(A * dest, B * src)\n{" % spelling)
|
||||
build_struct(c, True)
|
||||
print ("}\n")
|
||||
print("}\n")
|
||||
|
||||
return result
|
||||
|
||||
|
||||
def copy_decl(c, spelling):
|
||||
childs = [ch for ch in c.get_children()]
|
||||
children = [ch for ch in c.get_children()]
|
||||
if c.type.get_array_size() > 0:
|
||||
if c.type.get_array_element_type().spelling in structs:
|
||||
print(" for (int i=0; i<%d; i++) {" % c.type.get_array_size())
|
||||
@@ -75,16 +79,15 @@ def copy_decl(c, spelling):
|
||||
print(" }")
|
||||
else:
|
||||
print(" memcpy(dest->%s, src->%s, sizeof(dest->%s));" % (spelling, spelling, spelling))
|
||||
elif len(childs)==1 and childs[0].kind == clang.cindex.CursorKind.STRUCT_DECL and not childs[0].spelling:
|
||||
elif len(children) == 1 and children[0].kind == clang.cindex.CursorKind.STRUCT_DECL and not children[0].spelling:
|
||||
# inline declared structs
|
||||
if c.semantic_parent.spelling:
|
||||
spellingFunc = c.semantic_parent.spelling + "_" + spelling
|
||||
spelling_func = c.semantic_parent.spelling + "_" + spelling
|
||||
else:
|
||||
spellingFunc = c.semantic_parent.semantic_parent.spelling + "_" + spelling
|
||||
|
||||
extrastructs.append((childs[0], spellingFunc))
|
||||
print(" copy%s(&dest->%s, &src->%s);" % (spellingFunc, spelling, spelling))
|
||||
spelling_func = c.semantic_parent.semantic_parent.spelling + "_" + spelling
|
||||
|
||||
extrastructs.append((children[0], spelling_func))
|
||||
print(" copy%s(&dest->%s, &src->%s);" % (spelling_func, spelling, spelling))
|
||||
elif c.type.get_declaration().spelling in structs:
|
||||
print(" copy%s(&dest->%s, &src->%s);" % (c.type.get_declaration().spelling, spelling, spelling))
|
||||
else:
|
||||
@@ -92,7 +95,8 @@ def copy_decl(c, spelling):
|
||||
|
||||
|
||||
def header():
|
||||
print("//This file was auto-generated by %s script on %s. Do not edit this file!\n\n\n" % (os.path.basename(sys.argv[0]), time.asctime()))
|
||||
print("// This file was auto-generated by %s script on %s. Do not edit this file!\n\n\n" % (os.path.basename(sys.argv[0]), time.asctime()))
|
||||
|
||||
|
||||
index = clang.cindex.Index.create()
|
||||
translation_unit = index.parse(sys.argv[1], ['-x', 'c++', '-std=c++11'] + sys.argv[2:])
|
||||
|
||||
@@ -1,74 +0,0 @@
|
||||
local toolName = "TNS|LUA event tests|TNE"
|
||||
---- #########################################################################
|
||||
---- # #
|
||||
---- # Copyright (C) OpenTX #
|
||||
-----# #
|
||||
---- # License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html #
|
||||
---- # #
|
||||
---- # This program is free software; you can redistribute it and/or modify #
|
||||
---- # it under the terms of the GNU General Public License version 2 as #
|
||||
---- # published by the Free Software Foundation. #
|
||||
---- # #
|
||||
---- # This program is distributed in the hope that it will be useful #
|
||||
---- # but WITHOUT ANY WARRANTY; without even the implied warranty of #
|
||||
---- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
|
||||
---- # GNU General Public License for more details. #
|
||||
---- # #
|
||||
---- #########################################################################
|
||||
|
||||
local virtual_next = 0
|
||||
local virtual_previous = 0
|
||||
local virtual_next_rept = 0
|
||||
local virtual_previous_rept = 0
|
||||
local virtual_page_next = 0
|
||||
local virtual_page_previous = 0
|
||||
local virtual_enter = 0
|
||||
local virtual_enter_long = 0
|
||||
local virtual_menu = 0
|
||||
local virtual_menu_long = 0
|
||||
|
||||
-- Init
|
||||
local function init()
|
||||
|
||||
end
|
||||
|
||||
-- Main
|
||||
local function run(event)
|
||||
if event == nil then
|
||||
error("Cannot be run as a model script!")
|
||||
return 2
|
||||
elseif event == EVT_VIRTUAL_EXIT then
|
||||
return 2
|
||||
elseif event == EVT_PLUS_FIRST then
|
||||
virtual_next = virtual_next + 1
|
||||
elseif event == EVT_MINUS_FIRST then
|
||||
virtual_previous = virtual_previous + 1
|
||||
elseif event == EVT_PLUS_REPT then
|
||||
virtual_next_rept = virtual_next_rept + 1
|
||||
elseif event == EVT_MINUS_REPT then
|
||||
virtual_previous_rept = virtual_previous_rept + 1
|
||||
elseif event == EVT_PAGE_BREAK then
|
||||
virtual_page_next = virtual_page_next +1
|
||||
elseif event == EVT_PAGE_LONG then
|
||||
virtual_page_previous = virtual_page_previous + 1
|
||||
killEvents(event);
|
||||
elseif event == EVT_ENTER_BREAK then
|
||||
virtual_enter = virtual_enter + 1
|
||||
elseif event == EVT_MENU_BREAK then
|
||||
virtual_menu = virtual_menu + 1
|
||||
end
|
||||
|
||||
lcd.clear()
|
||||
lcd.drawScreenTitle("LUA EVENT TEST", 0, 0)
|
||||
lcd.drawText(1, 10, "PLUS: "..virtual_next)
|
||||
lcd.drawText(1, 20, "MINUS: "..virtual_previous)
|
||||
lcd.drawText(1, 40, "PLUS_REPT: "..virtual_next_rept)
|
||||
lcd.drawText(1, 50, "MINUS_REPT: "..virtual_previous_rept)
|
||||
lcd.drawText(LCD_W/2, 10, "ENTER: "..virtual_enter)
|
||||
lcd.drawText(LCD_W/2, 20, "MENU: "..virtual_menu)
|
||||
lcd.drawText(LCD_W/2, 40, "NEXT_PAGE: "..virtual_page_next)
|
||||
lcd.drawText(LCD_W/2, 50, "PREVIOUS_PAGE: "..virtual_page_previous)
|
||||
return 0
|
||||
end
|
||||
|
||||
return { init=init, run=run }
|
||||
@@ -10,7 +10,7 @@ import struct
|
||||
|
||||
|
||||
START_STOP = '\x7e'
|
||||
BYTESTUFF = '\x7d'
|
||||
BYTE_STUFF = '\x7d'
|
||||
STUFF_MASK = '\x20'
|
||||
|
||||
DATA_FRAME = 0x10
|
||||
@@ -110,7 +110,7 @@ def ParsePacket(packet):
|
||||
global lineNumber
|
||||
# unstuff packet
|
||||
while True:
|
||||
pos = packet.find(BYTESTUFF)
|
||||
pos = packet.find(BYTE_STUFF)
|
||||
if pos == -1:
|
||||
break
|
||||
# print "found stuff at %d in %s" % (pos, dump(packet, 20))
|
||||
|
||||
@@ -1,298 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
|
||||
# To use this script you need the following installed within python
|
||||
# Python 2.5 http://www.python.org/download/releases/2.5.4/
|
||||
# Python 2.7 http://www.python.org/download/releases/2.7.3/
|
||||
# PyTTS http://pypi.python.org/pypi/pyTTS
|
||||
# PyWin32 http://sourceforge.net/projects/pywin32/files/pywin32/
|
||||
#
|
||||
# Note
|
||||
# At the moment, pyTTS is only available for Python 2.3, 2.4 and 2.5. To use it for later versions without having to
|
||||
# recompile it, a quick and dirty solution is to:
|
||||
# copy the entire pyTTS directory from Python25\Lib\site-packages to Python26 or Python27
|
||||
# replace TTSFast.py with an empty file. This way the version-dependent pyd file isn't loaded.
|
||||
|
||||
# in addition you will need some tools.
|
||||
# ffmpeg, sox, adconvertor ttscmd (2cnd speach centre)
|
||||
# have fun!
|
||||
# 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 tts_common import *
|
||||
|
||||
try:
|
||||
# Python 3
|
||||
from http.client import HTTPConnection
|
||||
from urllib.parse import urlencode
|
||||
except ImportError:
|
||||
# Python 2
|
||||
from httplib import HTTPConnection
|
||||
from urllib import urlencode
|
||||
|
||||
|
||||
def wavstrip(filename):
|
||||
output = "_" + filename
|
||||
subprocess.Popen(["sox", filename, output, "silence", "1", "0.1", "0.1%", "reverse", "silence", "1", "0.1", "0.1%", "reverse"], stdout=subprocess.PIPE, stderr=subprocess.PIPE).wait()
|
||||
os.remove(filename)
|
||||
os.rename(output, filename)
|
||||
|
||||
|
||||
def generate(str, filename):
|
||||
print(filename, str)
|
||||
|
||||
if not str:
|
||||
str = " !" # this is so blank wav files never exist!
|
||||
|
||||
if "speak" in sys.argv:
|
||||
if "sapi" in sys.argv:
|
||||
tts.Speak(str)
|
||||
elif "espeak" in sys.argv:
|
||||
subprocess.Popen(["espeak", "-v", espeakVoice, "-s", espeakspeed, "-z", str.encode("utf-8")], stdout=subprocess.PIPE, stderr=subprocess.PIPE).wait()
|
||||
elif "google" in sys.argv:
|
||||
"speak not implemented with google tts engine"
|
||||
exit()
|
||||
else:
|
||||
print("which speach engine?")
|
||||
exit()
|
||||
else:
|
||||
if "sapi" in sys.argv:
|
||||
ttsfilename = "ttsfile.wav"
|
||||
tts.SpeakToWave(ttsfilename, str)
|
||||
elif "sapi2" in sys.argv:
|
||||
ttsfilename = "ttsfile.wav"
|
||||
subprocess.Popen(["ttscmd", "/ttw", str.encode("utf-8"), ttsfilename, "-v", voiceID, "-b", "32", "-s", "\"-3\"", "-w", "32", "-f", "47"], stdout=subprocess.PIPE, stderr=subprocess.PIPE).wait()
|
||||
elif "espeak" in sys.argv:
|
||||
ttsfilename = "ttsfile.wav"
|
||||
subprocess.Popen(["espeak", "-v", espeakVoice, "-s", espeakspeed, "-z", "-w", ttsfilename, str.encode("utf-8")], stdout=subprocess.PIPE, stderr=subprocess.PIPE).wait()
|
||||
elif "google" in sys.argv:
|
||||
ttsmp3 = "ttsfile.mp3"
|
||||
ttsfilename = "ttsfile.wav"
|
||||
conn = HTTPConnection("translate.google.com")
|
||||
params = urlencode({'ie': "UTF-8", 'tl': directory, 'q': str.encode("utf-8")})
|
||||
headers = {"User-Agent": "Mozilla"}
|
||||
conn.request("GET", u"/translate_tts?%s" % params, headers=headers)
|
||||
# conn.request("GET", "/translate_tts?ie=UTF-8&tl=%s&q=%s" % (directory, urllib.urlencode(str)), headers={"User-Agent": "Mozilla"})
|
||||
resp = conn.getresponse()
|
||||
with open(ttsmp3, "wb") as f:
|
||||
f.write(resp.read())
|
||||
subprocess.Popen(["ffmpeg", "-y", "-i", ttsmp3, "-acodec", "pcm_s16le", ttsfilename], stdout=subprocess.PIPE, stderr=subprocess.PIPE).wait()
|
||||
conn.close()
|
||||
|
||||
else:
|
||||
print("which speach engine?")
|
||||
exit()
|
||||
|
||||
wavstrip(ttsfilename)
|
||||
|
||||
if board in ('sky9x', 'taranis'):
|
||||
if 'sox' in sys.argv:
|
||||
maxvolume = subprocess.Popen(["sox", ttsfilename, "-n", "stat", "-v"], stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()[1]
|
||||
if "not sound" in maxvolume:
|
||||
subprocess.Popen(["sox", "--show-progress", filename, ttsfilename], stdout=subprocess.PIPE).communicate()[0]
|
||||
else:
|
||||
subprocess.Popen(["sox", "--show-progress", "-v", maxvolume, filename, ttsfilename], stdout=subprocess.PIPE).communicate()[0]
|
||||
if board == 'sky9x':
|
||||
subprocess.Popen(["sox", "-twav", ttsfilename, "-b1600", "-c1", "-e", "a-law", filename], stdout=subprocess.PIPE, stderr=subprocess.PIPE).wait()
|
||||
else:
|
||||
subprocess.Popen(["sox", "-twav", ttsfilename, "-b32000", "-c1", "-e", "a-law", filename], stdout=subprocess.PIPE, stderr=subprocess.PIPE).wait()
|
||||
else:
|
||||
if board == 'sky9x':
|
||||
subprocess.Popen(["ffmpeg", "-y", "-i", ttsfilename, "-acodec", defaultcodec, "-ar", "16000", filename], stdout=subprocess.PIPE, stderr=subprocess.PIPE).wait()
|
||||
else:
|
||||
subprocess.Popen(["ffmpeg", "-y", "-i", ttsfilename, "-acodec", defaultcodec, "-ar", "32000", filename], stdout=subprocess.PIPE, stderr=subprocess.PIPE).wait()
|
||||
elif board == 'gruvin9x':
|
||||
subprocess.Popen(["AD4CONVERTER", "-E4", ttsfilename], stdout=subprocess.PIPE, stderr=subprocess.PIPE).wait()
|
||||
os.rename(ttsfilename.replace(".wav", ".ad4"), filename)
|
||||
else:
|
||||
subprocess.Popen(["ffmpeg", "-y", "-i", ttsfilename, "-acodec", "pcm_u8", "-ar", "16000", filename], stdout=subprocess.PIPE, stderr=subprocess.PIPE).wait()
|
||||
os.remove(ttsfilename)
|
||||
|
||||
################################################################
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
|
||||
|
||||
if "sapi" in sys.argv:
|
||||
import pyTTS
|
||||
tts = pyTTS.Create()
|
||||
# tts.SetOutputFormat(16, 16, 1)
|
||||
# tts.Volume = 40
|
||||
# tts.SetRate(1)
|
||||
if "list" in sys.argv:
|
||||
print(tts.GetVoiceNames())
|
||||
exit()
|
||||
|
||||
if "mulaw" in sys.argv:
|
||||
defaultcodec = "pcm_mulaw"
|
||||
else:
|
||||
defaultcodec = "pcm_alaw"
|
||||
|
||||
if "en" in sys.argv:
|
||||
from tts_en import systemSounds, sounds
|
||||
|
||||
directory = "en"
|
||||
voice = "english"
|
||||
if "sapi" in sys.argv:
|
||||
if "scottish" in sys.argv:
|
||||
tts.SetVoiceByName("ScanSoftFiona_Full_22kHz")
|
||||
voice = "english-scottish"
|
||||
elif "american" in sys.argv:
|
||||
tts.SetVoiceByName("ScanSoftJennifer_Full_22kHz")
|
||||
voice = "english-american"
|
||||
elif "australian" in sys.argv:
|
||||
tts.SetVoiceByName("ScanSoftKaren_Full_22kHz")
|
||||
voice = "english-australian"
|
||||
elif "irish" in sys.argv:
|
||||
tts.SetVoiceByName("ScanSoftMoira_Full_22kHz")
|
||||
voice = "english-irish"
|
||||
else:
|
||||
tts.SetVoiceByName("ScanSoftFiona_Full_22kHz")
|
||||
voice = "english-english"
|
||||
elif "sapi2" in sys.argv:
|
||||
if "scottish" in sys.argv:
|
||||
voiceID = "17"
|
||||
voice = "english-scottish"
|
||||
elif "american" in sys.argv:
|
||||
voiceID = "18"
|
||||
voice = "english-american"
|
||||
elif "australian" in sys.argv:
|
||||
voiceID = "20"
|
||||
voice = "english-australian"
|
||||
elif "irish" in sys.argv:
|
||||
voiceID = "21"
|
||||
voice = "english-irish"
|
||||
elif "french" in sys.argv:
|
||||
voiceID = "19"
|
||||
voice = "english-french"
|
||||
elif "german" in sys.argv:
|
||||
voiceID = "22"
|
||||
voice = "english-german"
|
||||
else:
|
||||
voiceID = "17"
|
||||
voice = "english-english"
|
||||
|
||||
elif "espeak" in sys.argv:
|
||||
espeakVoice = "mb-us1"
|
||||
espeakspeed = "150"
|
||||
|
||||
elif "fr" in sys.argv:
|
||||
from tts_fr import systemSounds, sounds
|
||||
|
||||
directory = "fr"
|
||||
voice = "french"
|
||||
if "sapi" in sys.argv:
|
||||
tts.SetVoiceByName("ScanSoftVirginie_Full_22kHz")
|
||||
elif "espeak" in sys.argv:
|
||||
espeakVoice = "mb-fr4+f4"
|
||||
espeakspeed = "140"
|
||||
|
||||
elif "it" in sys.argv:
|
||||
from tts_it import systemSounds, sounds
|
||||
|
||||
directory = "it"
|
||||
voice = "italian"
|
||||
if "sapi" in sys.argv:
|
||||
tts.SetVoiceByName("ScanSoftVirginie_Full_22kHz")
|
||||
elif "espeak" in sys.argv:
|
||||
espeakVoice = "mb-it4"
|
||||
espeakspeed = "160"
|
||||
|
||||
elif "de" in sys.argv:
|
||||
from tts_de import systemSounds, sounds
|
||||
|
||||
directory = "de"
|
||||
voice = "german"
|
||||
if "sapi" in sys.argv:
|
||||
tts.SetVoiceByName("ScanSoftVirginie_Full_22kHz")
|
||||
elif "espeak" in sys.argv:
|
||||
espeakVoice = "mb-de4"
|
||||
espeakspeed = "160"
|
||||
|
||||
elif "pt" in sys.argv:
|
||||
from tts_pt import systemSounds, sounds
|
||||
|
||||
directory = "pt"
|
||||
voice = "portuguese"
|
||||
if "sapi" in sys.argv:
|
||||
tts.SetVoiceByName("ScanSoftVirginie_Full_22kHz")
|
||||
elif "espeak" in sys.argv:
|
||||
espeakVoice = "mb-pt1+f1"
|
||||
espeakspeed = "160"
|
||||
|
||||
elif "es" in sys.argv:
|
||||
from tts_es import systemSounds, sounds
|
||||
|
||||
directory = "es"
|
||||
voice = "spanish"
|
||||
if "sapi" in sys.argv:
|
||||
tts.SetVoiceByName("ScanSoftVirginie_Full_22kHz")
|
||||
elif "espeak" in sys.argv:
|
||||
espeakVoice = "mb-es1+f1"
|
||||
espeakspeed = "160"
|
||||
|
||||
elif "cz" in sys.argv:
|
||||
from tts_cz import systemSounds, sounds
|
||||
|
||||
directory = "cz"
|
||||
voice = "czech"
|
||||
if "sapi" in sys.argv:
|
||||
tts.SetVoiceByName("ScanSoftZuzana_Full_22kHz")
|
||||
elif "espeak" in sys.argv:
|
||||
espeakVoice = "mb-cz2"
|
||||
espeakspeed = "150"
|
||||
|
||||
else:
|
||||
print("which language?")
|
||||
exit()
|
||||
|
||||
if "csv" in sys.argv:
|
||||
with open("%s-%s.csv" % (voice, board), "w") 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 "zip" in sys.argv:
|
||||
zip_name = "%s-%s.zip" % (voice, board)
|
||||
with zipfile.ZipFile(zip_name, "w", zipfile.ZIP_DEFLATED) as zip:
|
||||
for s, f in systemSounds:
|
||||
if s and f:
|
||||
generate(s, f)
|
||||
if board in ("sky9x", "taranis"):
|
||||
zip.write(f, "SOUNDS/%s/SYSTEM/" % directory + f)
|
||||
else:
|
||||
zip.write(f, f)
|
||||
os.remove(f)
|
||||
for s, f in sounds:
|
||||
if s and f:
|
||||
generate(s, f)
|
||||
if board in ("sky9x", "taranis"):
|
||||
zip.write(f, "SOUNDS/%s/" % directory + f)
|
||||
else:
|
||||
zip.write(f, f)
|
||||
os.remove(f)
|
||||
@@ -1,35 +0,0 @@
|
||||
NO_ALTERNATE = 1024
|
||||
|
||||
import sys
|
||||
|
||||
def filename(idx, alternate=0):
|
||||
if "gruvin9x" in sys.argv:
|
||||
ext = ".ad4"
|
||||
else:
|
||||
ext = ".wav"
|
||||
if isinstance(idx, int):
|
||||
result = "%04d%s" % (idx, ext)
|
||||
elif board in ('sky9x', 'taranis'):
|
||||
result = idx + ext
|
||||
else:
|
||||
if alternate >= NO_ALTERNATE:
|
||||
return None
|
||||
result = "%04d%s" % (alternate, ext)
|
||||
return result
|
||||
|
||||
if "sky9x" in sys.argv:
|
||||
board = "sky9x"
|
||||
PROMPT_CUSTOM_BASE = 256
|
||||
PROMPT_SYSTEM_BASE = 0
|
||||
elif "taranis" in sys.argv or "horus" in sys.argv:
|
||||
board = "taranis"
|
||||
PROMPT_CUSTOM_BASE = 256
|
||||
PROMPT_SYSTEM_BASE = 0
|
||||
elif "gruvin9x" in sys.argv:
|
||||
board = "gruvin9x"
|
||||
PROMPT_CUSTOM_BASE = 0
|
||||
PROMPT_SYSTEM_BASE = 256
|
||||
else:
|
||||
board = "stock"
|
||||
PROMPT_CUSTOM_BASE = 0
|
||||
PROMPT_SYSTEM_BASE = 256
|
||||
@@ -1,7 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -x
|
||||
set -e
|
||||
|
||||
ffmpeg -i $1 -an -vb 1000k -s 960x540 `echo $1 | sed 's/\(.*\.\)mp4/\1mov/'`
|
||||
|
||||
Reference in New Issue
Block a user