Appendix 3. Notes on OpenTx Sound pack generation - athertop/MavLink_FrSkySPort GitHub Wiki

The OpenTx firmware provides voice output/alerts on the Taranis radio, but in order for this to work, we must first install an OpenTx sound pack onto the Taranis SD card into the /VOICES/[language]/ folder. A sound pack is basically a collection of many different wav files. Those which reside directly in the root of /VOICES/[language]/ are custom files provided for our use in manual configurations - such as in custom functions for a model to play these files when a certain condition is met. In addition to these custom files, the sound pack also includes SYSTEM sounds (located under /VOICES/[language]/SYSTEM) which are automatically used by various functions programmed within OpenTx. The [language] folder mentioned in the paths here refers to the selected language in the radio setup screen of the Taranis. Examples of [language] include 'en' (English), 'de' (German/Deutsch), 'pt' (Portugese).

In any cases though we may want to create our own custom sounds for use in our own model configuration - for example where the standard sound pack does not offer all of the voice phrases we want to assign, or where the voice used in a soundpack does not meet our personal preference or language/accent requirement. In these cases we can generate our own voice pack which includes all required system voices/phrases, plus all the customised ones we need to our own ends, in a voice/accent we see as best fitting our personal requirements.

The project includes a script called opentx_soundfile_generator.sh located in the repo path /Support_scripts/soundgen which can be used on an Apple Mac to generate custom OpenTx sound packs using any of the voices made available in the Apple OS X operating system. To use the script, we first require a data (csv) file containing the details of filenames and the phrases which will be spoken by each voice file generated.

The easiest way to create the csv file, is to initially download a compatible sound pack CSV file from the OpenTx website - one is provided for each language/radio/Firmware combination in the downloads section of the OpenTx website.

For example:

  • For OpenTx 2.1, browsing to the download section here: http://voices-21.open-tx.org/opentx-taranisplus/en allows the download of a csv file called english-taranis.csv

  • For OpenTx 2.2, the csv file is most often located within the SYSTEM folder within the downloaded zip file.

These downloaded files need to be manipulated in a text editor to fit the layout requirements of this script, for which details follow.

Script csv file requirements

The CSV file required by the opentx_soundfile_generator.sh script, is actually a semi-colon (rather than comma) seperated variable file, containing one line per voice-file/phrase in the format:

    path;filename;EN_phrase;DE_phrase;PT_phrase

path - this relates to the path name under the /SOUNDS/[language]/ folder, so for SYSTEM located voice files, this will be SYSTEM, and for voice files located directly under /SOUNDS/[language]/ this will be blank.

filename - this is the filename which will be generated - this should not include the .wav extension as the script will assume this - so filename only here.

EN_phrase_to_be_generated - This is the phrase which will be used by the script if within the script you have chosen the English language - by setting LANG="en" in the script.

DE_phrase_to_be_generated - This is the phrase which will be used by the script if within the script you have chosen the German language - by setting LANG="de" in the script.

PT_phrase_to_be_generated - This is the phrase which will be used by the script if within the script you have chosen the Portugese language - by setting LANG="pt" in the script.

A line starting with '//' is considered a comment line as is one starting with the word 'Path'.

Some example lines from the csv file:

;flapfll;flaps, full;Klappen ausgefahren

  • The first field is blank, so the generated wav file will be placed in the root language folder
  • the second field dictates that this will generate a file called flapsfll.wav
  • the third field provides the English phrase which will be spoken in the generated voice file if LANG="en" is specified in the script, this will place the generated wav file into the folder /SOUNDS/en/ (as no folder is specified as the first argument this root language folder will be used). The voice file generated in this case will play out the phrase "flaps, full" in the English language, and in the voice specified in the script by the line VOICE="voice_name" - it is suggested for the English language one of the English accent voices is chosen (the project provides voices in English American voices 'Ava' and 'Samantha').
  • the fourth field provides the German phrase which will be spoken by the generated voice file if LANG="de" is specified in the script, this will place the generated wav file into the folder /SOUNDS/de/ (as no folder is specified as the first argument, this root language folder will be used). The voice file generated in this case will play out the phrase "Klappen ausgefahren" in the German language, and in the voice specified in the script by the line VOICE="voice_name" - it is suggested for the German language one of the German accent voices is chosen (such as 'Anna').

/SYSTEM;hour0;hour;Stunde

  • The first field is /SYSTEM, so the generated wav file will be placed in a folder called SYSTEM under the root language folder.
  • the second field dictates that this will generate a file called hour0.wav
  • the third field provides the English phrase which will be spoken in the generated voice file if LANG="en" is specified in the script, this will place the generated wav file into the folder /SOUNDS/en/SYSTEM/. The voice file generated in this case will play out the phrase "hour" in the English language, and in the voice specified in the script by the line VOICE="voice_name".
  • the fourth field provides the German phrase which will be spoken by the generated voice file if LANG="de" is specified in the script, this will place the generated wav file into the folder /SOUNDS/de/SYSTEM/. The voice file generated in this case will play out the phrase "Stunde" in the German language, and in the voice specified in the script by the line VOICE="voice_name".

For SYSTEM voice files, the file names are known by the OpenTx firmware and called directly based on its integrated functionality.