mirror of
https://github.com/opentx/opentx.git
synced 2025-07-25 01:05:10 +03:00
TTS scripts were completely broken
This commit is contained in:
parent
e55a84d8b7
commit
77888ae200
9 changed files with 49 additions and 66 deletions
35
radio/util/tts_common.py
Normal file
35
radio/util/tts_common.py
Normal file
|
@ -0,0 +1,35 @@
|
|||
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
|
Loading…
Add table
Add a link
Reference in a new issue