diff --git a/SOUNDS/en/cmode.wav b/SOUNDS/en/cmode.wav new file mode 100644 index 00000000..c6f01e55 Binary files /dev/null and b/SOUNDS/en/cmode.wav differ diff --git a/SOUNDS/en/cpower.wav b/SOUNDS/en/cpower.wav new file mode 100644 index 00000000..8708997f Binary files /dev/null and b/SOUNDS/en/cpower.wav differ diff --git a/SOUNDS/en/cstart.wav b/SOUNDS/en/cstart.wav new file mode 100644 index 00000000..5387de4b Binary files /dev/null and b/SOUNDS/en/cstart.wav differ diff --git a/SOUNDS/en/cstop.wav b/SOUNDS/en/cstop.wav new file mode 100644 index 00000000..1ec85903 Binary files /dev/null and b/SOUNDS/en/cstop.wav differ diff --git a/SOUNDS/en/cwifi.wav b/SOUNDS/en/cwifi.wav new file mode 100644 index 00000000..18aee510 Binary files /dev/null and b/SOUNDS/en/cwifi.wav differ diff --git a/SOUNDS/en/recsrt.wav b/SOUNDS/en/recsrt.wav new file mode 100644 index 00000000..c1ee8a95 Binary files /dev/null and b/SOUNDS/en/recsrt.wav differ diff --git a/SOUNDS/en/recstp.wav b/SOUNDS/en/recstp.wav new file mode 100644 index 00000000..5a60e3a1 Binary files /dev/null and b/SOUNDS/en/recstp.wav differ diff --git a/SOUNDS/en/stoprc.wav b/SOUNDS/en/stoprc.wav new file mode 100644 index 00000000..b7d82ecd Binary files /dev/null and b/SOUNDS/en/stoprc.wav differ diff --git a/SOUNDS/en/strtrc.wav b/SOUNDS/en/strtrc.wav new file mode 100644 index 00000000..bbdabe0a Binary files /dev/null and b/SOUNDS/en/strtrc.wav differ diff --git a/SOUNDS/en_gb-libby/cmode.wav b/SOUNDS/en_gb-libby/cmode.wav new file mode 100644 index 00000000..e30d61d8 Binary files /dev/null and b/SOUNDS/en_gb-libby/cmode.wav differ diff --git a/SOUNDS/en_gb-libby/cpower.wav b/SOUNDS/en_gb-libby/cpower.wav new file mode 100644 index 00000000..4d43e241 Binary files /dev/null and b/SOUNDS/en_gb-libby/cpower.wav differ diff --git a/SOUNDS/en_gb-libby/cstart.wav b/SOUNDS/en_gb-libby/cstart.wav new file mode 100644 index 00000000..9b5edf2d Binary files /dev/null and b/SOUNDS/en_gb-libby/cstart.wav differ diff --git a/SOUNDS/en_gb-libby/cstop.wav b/SOUNDS/en_gb-libby/cstop.wav new file mode 100644 index 00000000..8615c35c Binary files /dev/null and b/SOUNDS/en_gb-libby/cstop.wav differ diff --git a/SOUNDS/en_gb-libby/cwifi.wav b/SOUNDS/en_gb-libby/cwifi.wav new file mode 100644 index 00000000..b1743487 Binary files /dev/null and b/SOUNDS/en_gb-libby/cwifi.wav differ diff --git a/SOUNDS/en_gb-libby/recsrt.wav b/SOUNDS/en_gb-libby/recsrt.wav new file mode 100644 index 00000000..41d79933 Binary files /dev/null and b/SOUNDS/en_gb-libby/recsrt.wav differ diff --git a/SOUNDS/en_gb-libby/recstp.wav b/SOUNDS/en_gb-libby/recstp.wav new file mode 100644 index 00000000..d6903210 Binary files /dev/null and b/SOUNDS/en_gb-libby/recstp.wav differ diff --git a/SOUNDS/en_gb-libby/stoprc.wav b/SOUNDS/en_gb-libby/stoprc.wav new file mode 100644 index 00000000..41efb2e0 Binary files /dev/null and b/SOUNDS/en_gb-libby/stoprc.wav differ diff --git a/SOUNDS/en_gb-libby/strtrc.wav b/SOUNDS/en_gb-libby/strtrc.wav new file mode 100644 index 00000000..9bfe86e5 Binary files /dev/null and b/SOUNDS/en_gb-libby/strtrc.wav differ diff --git a/SOUNDS/en_gb-ryan/cmode.wav b/SOUNDS/en_gb-ryan/cmode.wav new file mode 100644 index 00000000..d4324186 Binary files /dev/null and b/SOUNDS/en_gb-ryan/cmode.wav differ diff --git a/SOUNDS/en_gb-ryan/cpower.wav b/SOUNDS/en_gb-ryan/cpower.wav new file mode 100644 index 00000000..50e2a0ba Binary files /dev/null and b/SOUNDS/en_gb-ryan/cpower.wav differ diff --git a/SOUNDS/en_gb-ryan/cstart.wav b/SOUNDS/en_gb-ryan/cstart.wav new file mode 100644 index 00000000..7d07d004 Binary files /dev/null and b/SOUNDS/en_gb-ryan/cstart.wav differ diff --git a/SOUNDS/en_gb-ryan/cstop.wav b/SOUNDS/en_gb-ryan/cstop.wav new file mode 100644 index 00000000..f6d5500c Binary files /dev/null and b/SOUNDS/en_gb-ryan/cstop.wav differ diff --git a/SOUNDS/en_gb-ryan/cwifi.wav b/SOUNDS/en_gb-ryan/cwifi.wav new file mode 100644 index 00000000..a51d8027 Binary files /dev/null and b/SOUNDS/en_gb-ryan/cwifi.wav differ diff --git a/SOUNDS/en_gb-ryan/recsrt.wav b/SOUNDS/en_gb-ryan/recsrt.wav new file mode 100644 index 00000000..6d5a8f59 Binary files /dev/null and b/SOUNDS/en_gb-ryan/recsrt.wav differ diff --git a/SOUNDS/en_gb-ryan/recstp.wav b/SOUNDS/en_gb-ryan/recstp.wav new file mode 100644 index 00000000..78551980 Binary files /dev/null and b/SOUNDS/en_gb-ryan/recstp.wav differ diff --git a/SOUNDS/en_gb-ryan/stoprc.wav b/SOUNDS/en_gb-ryan/stoprc.wav new file mode 100644 index 00000000..5d92e619 Binary files /dev/null and b/SOUNDS/en_gb-ryan/stoprc.wav differ diff --git a/SOUNDS/en_gb-ryan/strtrc.wav b/SOUNDS/en_gb-ryan/strtrc.wav new file mode 100644 index 00000000..b483ad22 Binary files /dev/null and b/SOUNDS/en_gb-ryan/strtrc.wav differ diff --git a/SOUNDS/en_us-guy/cmode.wav b/SOUNDS/en_us-guy/cmode.wav new file mode 100644 index 00000000..8f2888ba Binary files /dev/null and b/SOUNDS/en_us-guy/cmode.wav differ diff --git a/SOUNDS/en_us-guy/cpower.wav b/SOUNDS/en_us-guy/cpower.wav new file mode 100644 index 00000000..de5a2eff Binary files /dev/null and b/SOUNDS/en_us-guy/cpower.wav differ diff --git a/SOUNDS/en_us-guy/cstart.wav b/SOUNDS/en_us-guy/cstart.wav new file mode 100644 index 00000000..2dd914c1 Binary files /dev/null and b/SOUNDS/en_us-guy/cstart.wav differ diff --git a/SOUNDS/en_us-guy/cstop.wav b/SOUNDS/en_us-guy/cstop.wav new file mode 100644 index 00000000..96c35c5e Binary files /dev/null and b/SOUNDS/en_us-guy/cstop.wav differ diff --git a/SOUNDS/en_us-guy/cwifi.wav b/SOUNDS/en_us-guy/cwifi.wav new file mode 100644 index 00000000..d6178096 Binary files /dev/null and b/SOUNDS/en_us-guy/cwifi.wav differ diff --git a/SOUNDS/en_us-guy/recsrt.wav b/SOUNDS/en_us-guy/recsrt.wav new file mode 100644 index 00000000..ccd0e0ab Binary files /dev/null and b/SOUNDS/en_us-guy/recsrt.wav differ diff --git a/SOUNDS/en_us-guy/recstp.wav b/SOUNDS/en_us-guy/recstp.wav new file mode 100644 index 00000000..d46f8df5 Binary files /dev/null and b/SOUNDS/en_us-guy/recstp.wav differ diff --git a/SOUNDS/en_us-guy/stoprc.wav b/SOUNDS/en_us-guy/stoprc.wav new file mode 100644 index 00000000..0605af62 Binary files /dev/null and b/SOUNDS/en_us-guy/stoprc.wav differ diff --git a/SOUNDS/en_us-guy/strtrc.wav b/SOUNDS/en_us-guy/strtrc.wav new file mode 100644 index 00000000..eee71c7f Binary files /dev/null and b/SOUNDS/en_us-guy/strtrc.wav differ diff --git a/SOUNDS/en_us-michelle/cmode.wav b/SOUNDS/en_us-michelle/cmode.wav new file mode 100644 index 00000000..90bde699 Binary files /dev/null and b/SOUNDS/en_us-michelle/cmode.wav differ diff --git a/SOUNDS/en_us-michelle/cpower.wav b/SOUNDS/en_us-michelle/cpower.wav new file mode 100644 index 00000000..b2b9c367 Binary files /dev/null and b/SOUNDS/en_us-michelle/cpower.wav differ diff --git a/SOUNDS/en_us-michelle/cstart.wav b/SOUNDS/en_us-michelle/cstart.wav new file mode 100644 index 00000000..cbaa71ee Binary files /dev/null and b/SOUNDS/en_us-michelle/cstart.wav differ diff --git a/SOUNDS/en_us-michelle/cstop.wav b/SOUNDS/en_us-michelle/cstop.wav new file mode 100644 index 00000000..0535fa82 Binary files /dev/null and b/SOUNDS/en_us-michelle/cstop.wav differ diff --git a/SOUNDS/en_us-michelle/cwifi.wav b/SOUNDS/en_us-michelle/cwifi.wav new file mode 100644 index 00000000..92dc0297 Binary files /dev/null and b/SOUNDS/en_us-michelle/cwifi.wav differ diff --git a/SOUNDS/en_us-michelle/recsrt.wav b/SOUNDS/en_us-michelle/recsrt.wav new file mode 100644 index 00000000..4149c24a Binary files /dev/null and b/SOUNDS/en_us-michelle/recsrt.wav differ diff --git a/SOUNDS/en_us-michelle/recstp.wav b/SOUNDS/en_us-michelle/recstp.wav new file mode 100644 index 00000000..8f5f52ec Binary files /dev/null and b/SOUNDS/en_us-michelle/recstp.wav differ diff --git a/SOUNDS/en_us-michelle/stoprc.wav b/SOUNDS/en_us-michelle/stoprc.wav new file mode 100644 index 00000000..13ea4265 Binary files /dev/null and b/SOUNDS/en_us-michelle/stoprc.wav differ diff --git a/SOUNDS/en_us-michelle/strtrc.wav b/SOUNDS/en_us-michelle/strtrc.wav new file mode 100644 index 00000000..98d6a94e Binary files /dev/null and b/SOUNDS/en_us-michelle/strtrc.wav differ diff --git a/SOUNDS/en_us-sara/cmode.wav b/SOUNDS/en_us-sara/cmode.wav new file mode 100644 index 00000000..bcb3b0fa Binary files /dev/null and b/SOUNDS/en_us-sara/cmode.wav differ diff --git a/SOUNDS/en_us-sara/cpower.wav b/SOUNDS/en_us-sara/cpower.wav new file mode 100644 index 00000000..472105e9 Binary files /dev/null and b/SOUNDS/en_us-sara/cpower.wav differ diff --git a/SOUNDS/en_us-sara/cstart.wav b/SOUNDS/en_us-sara/cstart.wav new file mode 100644 index 00000000..fff63493 Binary files /dev/null and b/SOUNDS/en_us-sara/cstart.wav differ diff --git a/SOUNDS/en_us-sara/cstop.wav b/SOUNDS/en_us-sara/cstop.wav new file mode 100644 index 00000000..aeec9b72 Binary files /dev/null and b/SOUNDS/en_us-sara/cstop.wav differ diff --git a/SOUNDS/en_us-sara/cwifi.wav b/SOUNDS/en_us-sara/cwifi.wav new file mode 100644 index 00000000..e49e3285 Binary files /dev/null and b/SOUNDS/en_us-sara/cwifi.wav differ diff --git a/SOUNDS/en_us-sara/recsrt.wav b/SOUNDS/en_us-sara/recsrt.wav new file mode 100644 index 00000000..5231852f Binary files /dev/null and b/SOUNDS/en_us-sara/recsrt.wav differ diff --git a/SOUNDS/en_us-sara/recstp.wav b/SOUNDS/en_us-sara/recstp.wav new file mode 100644 index 00000000..13de069b Binary files /dev/null and b/SOUNDS/en_us-sara/recstp.wav differ diff --git a/SOUNDS/en_us-sara/stoprc.wav b/SOUNDS/en_us-sara/stoprc.wav new file mode 100644 index 00000000..4398b1cc Binary files /dev/null and b/SOUNDS/en_us-sara/stoprc.wav differ diff --git a/SOUNDS/en_us-sara/strtrc.wav b/SOUNDS/en_us-sara/strtrc.wav new file mode 100644 index 00000000..c7c79752 Binary files /dev/null and b/SOUNDS/en_us-sara/strtrc.wav differ diff --git a/build-checks.py b/build-checks.py index 7ee3a856..dcfb8fb7 100755 --- a/build-checks.py +++ b/build-checks.py @@ -10,11 +10,11 @@ # TODO: Check for duplicate filenames in CSV files # TODO: Check for files in SOUNDS that are not in CSV files -# TODO: Check CSV for correct row indexes def checkCSVcolumnCount(): print("VOICES: Checking CSV files for missing fields ...") + missing_csv_field = False for filename in os.listdir(csv_directory): f = os.path.join(csv_directory, filename) if os.path.isfile(f) and filename.endswith('.csv'): @@ -22,45 +22,116 @@ def checkCSVcolumnCount(): for row in reader: if not len(row) == 6: print("{}: Insufficient columns of data - {}".format(filename, row)) + missing_csv_field = True continue + if missing_csv_field: + return 1 + else: + return 0 def checkFilenameLengths(): print("SOUNDS: Checking file name lengths ...") + invalid_filename_found = False for dirpath, dirnames, filenames in os.walk(sound_directory): for fn in filenames: path = os.path.join(dirpath, fn) if path.split(os.path.sep)[2] == "SYSTEM": if len(os.path.splitext(fn)[0]) > 8: print("Filename too long for a SYSTEM file: {}".format(path)) + invalid_filename_found = True elif path.split(os.path.sep)[2] == "SCRIPTS": continue elif len(os.path.splitext(fn)[0]) > 6: print("Filename too long for a non-SYSTEM file: {}".format(path)) + invalid_filename_found = True + + if invalid_filename_found: + return 1 + else: + return 0 def checkNoZeroByteFiles(): print("SOUNDS: Checking for zero byte sound files ...") + zero_byte_file_found = False for root, dirs, files in os.walk(sound_directory): path = root.split(os.sep) for fn in files: path = os.path.join(root, fn) if os.stat(path).st_size == 0: print("Zero byte file: {}".format(path)) + zero_byte_file_found = True + + if zero_byte_file_found: + return 1 + else: + return 0 def validateSoundsJson(): print("SOUNDS: Validating sounds.json ...") + invalid_json_found = False f = open("sounds.json") try: json.load(f) except ValueError as err: print("JSON not valid: {}".format(str(err))) - return True + invalid_json_found = True + + if invalid_json_found: + return 1 + else: + return 0 + +def checkForDuplicateStringID(): + print("VOICES: Check for duplicate StringIDs ...") + duplicate_found = False + pathName = os.path.join(os.getcwd(), csv_directory) + + voiceFiles = [] + # scan for voice CSV files + fileNames = os.listdir(pathName) + for fileNames in fileNames: + if fileNames.endswith(".csv"): + voiceFiles.append(fileNames) + + # iterate over files found + for filename in voiceFiles: + f = os.path.join(csv_directory, filename) + if os.path.isfile(f): + with open(f, 'rt') as csvfile: + reader = csv.reader(csvfile, delimiter=',', quotechar='"') + line_count = 0 + StringID_count = {} + for row in reader: + if line_count == 0: + # absorb header row + line_count += 1 + else: + StringID = row[0] + if StringID in StringID_count.keys(): + print('{}: {} is duplicated'.format(f, StringID)) + StringID_count[StringID] = StringID_count[StringID] + 1 + duplicate_found = True + else: + StringID_count[StringID] = 1 + + if duplicate_found: + return 1 + else: + return 0 if __name__ == "__main__": - checkCSVcolumnCount() - checkFilenameLengths() - checkNoZeroByteFiles() - validateSoundsJson() + error_count = 0 + error_count += checkCSVcolumnCount() + error_count += checkFilenameLengths() + error_count += checkNoZeroByteFiles() + error_count += validateSoundsJson() + error_count += checkForDuplicateStringID() + + if error_count > 0: + sys.exit(os.EX_DATAERR) + else: + sys.exit(os.EX_OK) diff --git a/voices/en-GB.csv b/voices/en-GB.csv index fefb92a0..29923d94 100644 --- a/voices/en-GB.csv +++ b/voices/en-GB.csv @@ -441,3 +441,12 @@ "440","VTX Maximum Power","VTX Maximum Power","video","","vtxmax.wav" "441","blackbox erase","blackbox erase","","","blkers.wav" "442","acro trainer mode","acro trainer mode","","","actnmd.wav" +"443","Camera wifi button","Camera wifi button","camera","","cwifi.wav" +"444","Camera power button","Camera power button","camera","","cpower.wav" +"445","Camera change mode","Camera change mode","camera","","cmode.wav" +"446","Camera start","Camera start","camera","","cstart.wav" +"447","Camera stop","Camera stop","camera","","cstop.wav" +"448","Recording start","Recording start","","","recsrt.wav" +"449","Recording stop","Recording stop","","","recstp.wav" +"450","Start recording","Start recording","","","strtrc.wav" +"451","Stop recording","Stop recording","","","stoprc.wav" diff --git a/voices/en-US.csv b/voices/en-US.csv index 39d93444..91e16c93 100644 --- a/voices/en-US.csv +++ b/voices/en-US.csv @@ -441,3 +441,12 @@ "440","VTX Maximum Power","VTX Maximum Power","video","","vtxmax.wav" "441","blackbox erase","blackbox erase","","","blkers.wav" "442","acro trainer mode","acro trainer mode","","","actnmd.wav" +"443","Camera wifi button","Camera wifi button","camera","","cwifi.wav" +"444","Camera power button","Camera power button","camera","","cpower.wav" +"445","Camera change mode","Camera change mode","camera","","cmode.wav" +"446","Camera start","Camera start","camera","","cstart.wav" +"447","Camera stop","Camera stop","camera","","cstop.wav" +"448","Recording start","Recording start","","","recsrt.wav" +"449","Recording stop","Recording stop","","","recstp.wav" +"450","Start recording","Start recording","","","strtrc.wav" +"451","Stop recording","Stop recording","","","stoprc.wav"