# Audio

OpenTX makes sounds in two ways: 1. Generating tones/beeps of different frequencies and durations 2. Playing audio files if present on a microSD card

One of the main features of OpenTX is its use of a sound pack placed on a microSD card. This sound pack contains audio files files used for sounds and announcements.

Sounds & Announcements take place in response to

* Model Independent event (events not related to the model loaded)
* Model Dependent events (events related to the model loaded)
* Global & Special Function triggers

## SD Card contents

SD Card contents can be downloaded as described in [Companion Sdcard](https://github.com/opentx/manual-for-opentx-2-2/tree/f979370e594d8dd8ae71861cc48a0af0a7c8234e/advanced/sdcard.md)

### Announcement To File Mapping / Definitions

The sound mapping/definitions file is used to generate audio files with phrases such as telemetry lost/recovered and units.

* SOUNDS/language/SYSTEM/language-country-tx.csv

  E.g. SOUNDS/en/SYSTEM/en-US-taranis.csv

It is a text file with lines of text. One line per sound file. Each line has three parts separated by semicolons.

* directory/;file\_name.wav;Spoken phrase

  E.g. SOUNDS/en/SYSTEM;hello.wav;Welcome to open tea ex!

### Audio File Format

* File Name: 123456.wav (up to 6 characters plus .wav)
* Sample Rate: 32 kHz (or 16 Khz, 8Khz)
* Bits / Sample: 16 (or 8)
* Tracks: 1, mono
* Compression Codec: PCM (or u-law, a-law)

### Audio File Locations & Language Setting

On the Tx SD CARD in the following folders

* SOUNDS/
  * The root, top level
* SOUNDS/language/
  * Files used by Global & Special Functions
  * Different languages are supported
    * E.g. SOUNDS/en/, SOUNDS/de/
  * The language is set on the RADIO SETUP screen

    ![](https://274237988-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MRzpA59TKutI-lAv_5j%2Fsync%2F5a6cfbe54f2cee6a5fce8c16cc9c4621af2ab941.png?generation=1611683712089312\&alt=media)
* SOUNDS/language/SYSTEM/
  * Files used by the system
* SOUNDS/en/model\_name\_folder/
  * Files used for some model events

## Model Independent

These sounds and announcements are not related to which model is loaded. They are configured in one of the following ways:

* Adding  to or removing a sound file from the folder
  * SOUNDS/language/SYSTEM/
* Configuring options on the Radio SETUP screen

  ![](https://274237988-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MRzpA59TKutI-lAv_5j%2Fsync%2F742f0a4e02576aeef9975579b6e9184e4b9ed440.png?generation=1611683720642515\&alt=media)
* Radio GLOBAL FUNCTIONS screen

  ![](https://274237988-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MRzpA59TKutI-lAv_5j%2Fsync%2Faf0a344c5d54d7d994f0ddb3cc69bae31b2a2491.png?generation=1611683712081788\&alt=media)

Events that may generate sounds and announcements are:

* Transmitter turned on and off
  * E.g. SOUNDS/en/SYSTEM/hello.wav and SOUNDS/en/SYSTEM/bye.wav
  * Note: bye.wav is not provided but will be played if present
* Trim up, down, center, ends/limits
* Telemetry lost, recovered
* Tx battery level low
* RF signal level low or critical
* Inactivity period reached (no sticks, switches, buttons or knobs were used)
* Throttle stick not all the way down when model is loaded
* Bad eeprom
* Tx antenna defective
* Trainer signal lost, recovered
* Sensor signal lost
* Servo, Receiver power overload (when using the FrSKY Redundancy Bus)
* Tx button presses and scroll wheel/knob turn
* Binding
* Range check

## Model Dependent

These sounds and announcements are related to which model is loaded. They are configured in one of the following ways:

* Adding  to or removing a sound file from the folder
  * SOUNDS/language/model\_name
* Configuring options on the Radio SETUP screen

  ![](https://274237988-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MRzpA59TKutI-lAv_5j%2Fsync%2Fcd55cfb92a69f13e9f0b03d30a7f2338a62535b7.png?generation=1611683712100048\&alt=media)
* Radio SPECIAL FUNCTIONS screen

  ![](https://274237988-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MRzpA59TKutI-lAv_5j%2Fsync%2F37f4b829e3a681ccdaf39e0e8288468da68bbf19.png?generation=1611683712043982\&alt=media)

Events that may generate sounds and announcements are:

* Timer seconds, count down reaches zero
* Switch, Slider or Pot not in a particular position when model loaded
* Center position beep for sticks, sliders and potentiometers
* Switch position changes
* Flight mode changes

### Model Folder Sound Files

To play sounds specific to a model without configuring them as a Special Function place sound files in the following folder:

* /SOUNDS/language/model\_name/
  * Replace model name spaces with an underscore "\_"
    * E.g. /SOUNDS/en/my\_model/

The file names use the following format:

* Switches
  * switchID-position.wav
    * SA-up.wav
    * SA-mid.wav (if position present)
    * SA-down.wav
    * Note: There is no equivalent for SA not up.
* Logical Switches
  * switchID-condition.wav
    * L1-up.wav (true)
    * L1-down.wav (false)
    * Note: There is no equivalent for L1 not up.
* Multiple Position Switches / Stepped Potentiometers
  * P-switchNumber-position.wav
    * P11.wav
    * P16.wav
    * P24.wav
* Flight Modes
  * modeName-condition.wav
    * No spaces in the flight mode name
    * ABC–off.wav
    * ABC–on.wav

## Global & Special Functions

Configuration details for these functions are covered under [Special Functions](https://opentx.gitbooks.io/manual-for-opentx-2-2/content/special_functions.html)

Play Actions

* Play Track
  * Pick a file from the list.
  * Uses files placed in SOUNDS/language/
* Play Value
  * Say the value of the selected parameter when the switch is active.

Enable options for both of the above are

* Played once, not during start up
  * Play once when triggered but not when model is loaded, don't repeat it
* No repeat
  * Play once when triggered, don't repeat it
* 1s to 60s
  * Play once and then again every interval specified from 1 to 60 seconds

Music Actions

* BgMusic
  * Starts playback of a background sound track picked from a list
  * Uses files placed in SOUNDS/language/
  * The switch must stay on to continue playback
  * If the switch is turned off and then on again playback starts from the beginning
* BgMusic II
  * Pauses the active BgMusic
  * When the switch is turned off playback continues from where it was paused
  * The BgMusic switch must remain on

Other Actions

* Vario
  * Generates the tone/sound of a glider variometer
  * Uses altitude or vertical speed telemetry data
* Volume
  * Adjusts the audio volume for the entire radio
  * Use any input from the list
    * E.g. S1

## Volume

The audio volume may be configured and controlled from three locations: 1. [RADIO SETUP](https://opentx.gitbooks.io/manual-for-opentx-2-2/content/radio_menus.html) screen 2. [GLOBAL FUNCTIONS](https://opentx.gitbooks.io/manual-for-opentx-2-2/content/special_functions.html) screen 3. [SPECIAL FUNCTIONS](https://opentx.gitbooks.io/manual-for-opentx-2-2/content/special_functions.html) screen

Details of each are covered under the relevant sections.
