1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-24 00:35:18 +03:00
opentx/util/tts.py
bsongis 5dd7c105b6 Current consumption may depend on 3 different sources
Flash saving in FrSky code
SD card wav player (still read as raw 12000Hz 16bit samples)
2012-06-26 10:09:31 +00:00

24 lines
No EOL
1 KiB
Python

#!/usr/bin/env python
import os, sys, shutil, platform, subprocess
def generate(str, idx):
if platform.system() == "Windows":
subprocess.Popen(["C:\Program Files\eSpeak\command_line\espeak.exe", "-w", "%04d.wav" % idx, str], stdout=subprocess.PIPE, stderr=subprocess.PIPE).wait()
if 'ad4' in sys.argv:
subprocess.Popen(["D:\Perso\workspace\companion9x\AD4CONVERTER.EXE", "-E4", "%04d.WAV" % idx], stdout=subprocess.PIPE, stderr=subprocess.PIPE).wait()
if __name__ == "__main__":
if "en" in sys.argv:
for i in range(20):
generate(str(i), i)
for i in range(20, 100, 10):
generate(str(i), 20+(i-20)/10)
generate("hundred", 28)
generate("thousand", 29)
for i, s in enumerate(["hour", "hours", "minute", "minutes", "second", "seconds", "", "and", "minus"]):
generate(s, 40+i)
for i, s in enumerate(["volts", "amps", "meters per second", "", "km per hour", "meters", "degrees", "percent", "milliamps"]):
generate(s, 50+i)