TK-Talkie Configuration Files (V1 through V3)

The configuration files are used by TK-Talkie in order to provide the ability to highly customize your setup and profiles. They are stored on a micro-SD card that is used by the TK-Talkie.

YOU ARE FREE TO USE THIS CODE IN YOUR OWN PROJECTS, PROVIDED THEY ARE FOR PERSONAL, NON-COMMERCIAL USE.


Editing Configuration Files

There are 3 ways to edit configuration files:

  1. Via the mobile app - If your TK-Talkie has a BLE (Bluetooth Low-Energy), you can use the mobile app to manage your configuration profiles.
  2. Edit via serial interface - With this option, you connect your TK-Talkie to your computer via the USB port and use a serial interface to issue commands and edit configuration settings.
  3. Edit files via text editor - With this option, you can edit the files by putting the SD card in your computer and editing the files with a text editor. Please see the Configuration Values section for a list of available options.
You must power down the TK-Talkie when removing or inserting the SD card in order to avoid damage to the card.

Startup Settings File

The file SETTINGS.TXT is located in the root directory of the SD card and is the main control file. This file holds global configuration settings for your TK-Talkie including the default user profile to load when starting up. It has the following entries:

[profile=SAMPLE.TXT]  - The default profile to load on startup
[access_code=xxxx]    - Alphanumeric access code for the device that is needed to allow mobile app to connect.
[input=MIC/LINE/BOTH] - This tells TK-Talkie which input method (for microphone) you are using.  Set to MIC by default.
[debug=0]             - Turns debugging on (1) or off (0) for the unit. Default is off.  When on, messages
                        during program operation will be displayed to the serial interface.  This can be useful
                        when testing configuration settings.
[echo=0]              - Turns on BLE debugging.  Values are 0 (off) or 1 (on.)

Configuration (Profile) Files

You can have multiple profile configuration files. These are stored in the /profiles folder on the SD card. The SETTINGS.TXT holds the default profile to load at system startup. You can easily swap profiles via the serial interface or mobile app.

Profile files have a .TXT file extension and have the following format for configuration values:

    [setting_key=setting_value]  

Note the use of [ and ] for the settings!

Settings are wrapped in brackets due to the differences in the way editors will use the EOL (End-of-Line) character between operating systems (ex. Windows, Mac.) This method allows the use of any editor for your configuration file. The order of the settings does not matter.

NOTE: Any text OUTSIDE of the brackets will be ignored!

Sound Collections

Each profile specifies the directories where the sound files to be used for that profile are located. This allows you to either separate or share sounds between profiles. By default, the directories are:

Sounds Directory

[sounds_dir=/sounds/]

This directory holds the startup sounds that can be played. It can be shared across profiles since only a single startup sound is played and you can choose which sound to play in your configuration profile.

Loop Directory

[loop_dir=/loops/]

This holds the background loops. Again, this can be shared since only one loop file is played and you can choose which file is used.

Effects Directory

[effects_dir=/effects/]

This directory holds the sounds (mic pops and clicks) that are played whenever you stop talking. Although this directory can be shared, if you are using TKTalkie for other costumes (such as a Clone Trooper, for example, which does not use the mic pops) you can specify a different directory, or leave it blank.


Configuration Values

The current settings and valid values are:

name

[name=This is the default profile]

Name of the profile. This is displayed in the mobile app when loading/saving/managing profiles.

volume

[volume=.50]

Sets the initial volume level (If you have a volume pot soldered to your Audio Adaptor then leave this entry out of your config file and the sketch will read the volume pot instead.) Valid values are decimal values from 0 to 1, although past .7 you may experience distortion.

NOTE: This has no effect on the LINEOUT jack

linein

[linein=5]

Set the level for the line-in input. Valid values are 0 to 15, with 5 being the default. Lower numbers decrease the input level, higher numbers increase it.

lineout

[lineout=29]

Set the level for the line-out signal. Valid values are 13 to 31, with 29 being the default. This works in the **OPPOSITE** direction, since by lowering the value you are lowering the attenuation of the signal making the output louder, and by raising it you are increasing the attenuation, making the signal quieter.

startup

[startup=STARTUP.WAV]

This is the sound that is played each time TKTalkie starts.

loop

[loop=TKLOOP.WAV]

The background (chatter) file. This file starts AFTER the startup file, then will continuously loop while TKTalkie is running.

NOTE: The backgound loop will be silenced while you are speaking (but will continue running)

loop_gain

[loop_gain=.025]

This is the sound level of the loop while it is playing. Valid values are 0 to 10. Anything below 1 lowers the volume and anything above 1 boosts the gain.

silence_time

[silence_time=350]

The amount of time (in milliseconds...or *thousandths* of a second) to wait to make sure you are finished talking before playing an effect (static burst or mic click effect, etc.)

voice_start

[voice_start=0.03]

This is the input level received from the microphone that will trigger the Voice Activation when you begin talking. Valid values are 0 to 1, however .02 to .07 will work for most microphones.

NOTE: You can use the new Calibration Wizard via the serial interface to help set this level

voice_stop

[voice_stop=0.02]

The input level received from the microphone that indicates you are finished talking. Valid values are 0 to 1, however this MUST be less than the voice_start option and 0 will cause the microphone to never shut off.

NOTE: You can use the new Calibration Wizard via the serial interface to help set this level

mic_gain

[mic_gain=6]

The voice input level when using the microphone input. Values are whole numbers from 0 to 63. If you are experiencing feedback and using the microphone input (not line-in), try adjusting the mic_gain setting first. You may also need to increase the value if you have issues with your microphone activating.

NOTE: This setting has no effect if you are using the line-in input for your microphone

effects_gain

[effects_gain=5]

This sets the output level of sound effects. Valid values are any decimal value from 0 to 10.

eq

[eq=1]

Specify whether the equalizer is on (1) or off (0). If set to on, a 5-band graphic equalizer is used.

eq_bands

[eq_bands=-1,0,1,0,-1]

Depending upon they type of equalizer selected, specify the settings for each band. Bands are comma separated and valid decimal values from -1.00 (-11.75dB) to 1.00 (+12dB).

NOTE: Bands (from left to right) are: Low (Bass), Low-Mid, Mid, High-Mid, High (Treble)

voice_gain

[voice_gain=1]

Set the output level of the voice channel on the mixer. Valid values are any decimal value from 0 to 32767, 1 is pass-thru, below 1 attenuates (quiets) the signal.

bitcrushers

# Format = bits1,rate1,bits2,rate2
# Set to 16,41000,16,41000 to just pass-thru (disable)
[bitcrushers=12,16384,10,10240]

There are two bitcrushers to process the voice input and make it sound a little more tinny and robotic as if it is coming through a radio. These are comma separated values that denote bits and sample rate, hence bits1,sample rate1,bits2,sample rate2. Valid values for bits are 1 to 16, and valid values for sample rate are from 1 to 44100.

NOTE: You may need to disable these if using other voice processers such as a voice changer with TKTalkie.

noise_gain

[noise_gain=.15]

While talking, pink noise is played behind your voice to help simulate radio communications. This setting sets the noise level. Valid values are any decimal value from 0 to 32767, 1 is pass-thru, below 1 attenuates signal. Set to 0 to disable.

sound_dir

[sounds_dir=/sounds/]

This directory holds the startup sounds that can be played. It can be shared across profiles since only a single startup sound is played and you can choose which sound to play in your configuration profile.

loop_dir

[loop_dir=/loops/]

This holds the background loops. Again, this can be shared since only one loop file is played and you can choose which file is used.

effects_dir

[effects_dir=/effects/]

This directory holds the effects sounds that are applied when you stop talking.

The following entries are for using the PTT (Push-to-Talk) function

button_pin

[button_pin=2]

This setting tells TKTalkie which pin on the Teensy your PTT button is connected to.

button_click

[button_click=BUTTON.WAV]

The sound to play when the PTT button is pushed (before you start talking.) When the button is released, a random sound will be played.

button_gain

[button_gain=1]

The output level of the button sound. Valid values are 0 to 10. Anything below 1 lowers the volume and anything above 1 boosts the gain.


Serial Interface

As in version 2, this version of the sofware allows you to change configuration settings, save configuration files and load configuration files via a serial interface. The Arduino IDE has a built-in serial monitor that can be used for this, or you can connect via a terminal program at 57600 baud.

When connected, the following commands are available:

help                  Show this help screen.
files                 Show a list of files on SD card.
profiles              Show a list of available profiles on SD card.
effects               Show directory listing of effects folder.
sounds                Show directory listing of sounds folder.
loops                 Show directory listing of sounds folder.
settings              Show current settings.
config                Displays the startup (system) settings
load                  Load settings from default file
save                  Save settings to currently loaded profile
access_code=value     Sets BLE access code for mobile app
debug=(1/0)           Turns debugging on/off
beep=n                Play warning beep sound n times
mute                  Mute all sounds
unmute                Unmute all sounds
reset                 Resets the TKTalkie unit

For the following commands, a file extension of .TXT (for settings files) or
.WAV (for sound files) is assumed and will be added if not specified.

load=filename         Load settings from specified file
save=filename         Save current settings to specified file
default=filename      Set the default settings profile to be loaded
                      when TKTalkie starts
delete=filename       Delete a settings file
play=filename         Plays the specified .WAV file (use full path/filename)
play_effect=filename  Play specified file from effects folder
play_sound=filename   Play specified file from sounds folder
play_loop=filename    Play specified file from loops folder
stop_loop             Stop currently playing loop

backup                Quick backup of settings file to SETTINGS.BAK
restore               Quick restore from SETTINGS.BAK

calibrate             Runs microphone calibration wizard

Using this option, you can simply edit the config file, save your changes, then reinsert the card into the Teensy device and restart. Please see the **Configuration Values** section for a list of available options.

Making Configuration Changes via Serial Interface

You can make live, real-time changes via the serial interface. Changes take effect immediately. They will be LOST when the device restarts unless you save them using one of the '*save*' commands. When making live changes, use the following format:

    setting_key=new_value [ENTER]

The new setting will take effect immediately. This is a great way to allow you to tweak and test settings for your particular application of the TKTalkie system. Please see the **Configuration Values** section for a list of available options.

When done editing settings, you will need to save them:

    save=SAMPLE (where SAMPLE is the name of your profile)

If you have any further questions regarding your TK-Talkie, please Contact Us or Join us on Facebook.