The Switch command-line tool allows you to use Switch to convert files from the Windows command line. This can be used to let other software convert files with Switch or to automate batch conversion.

The Switch executable is usually located at "C:\Program Files\NCH Software\Switch\switch.exe"

Usage: switch.exe [options] [files to add]

"Options" is where you can issue a series of commands to Switch. The options are:

-convert - convert all files loaded into Switch.

-clear - remove all files loaded into Switch.

-addfolder [FOLDER_NAME] - add a folder of files into Switch.

-format [FORMAT_NAME] - specify the output file format for which to convert the loaded files. The format names are the file extensions for each format (e.g. .wav, .mp3).

-outfolder [FOLDER_NAME] - specify the output folder to store the converted files. Do NOT end the folder path with a backslash '\' character.

-settempfolder [FOLDER_NAME] - specify the temporary folder that Switch will store files in when playing or converting files. If the specified folder is not valid then no action will take place.

-overwrite [OVERWRITE_FLAG] - specifies what to do when the converted file already exists. The flags are "PROMPT" (Prompt for What to Do), "ALWAYS" (Overwrite the File), "NEVER" (Don't Convert the Original File), "CANCEL" (Abort All Conversions), "APPENDNUMBER [format]" (Append number to filename - [format] is optional, if blank it will use the format already specified in Switch).

-settings [FORMAT_NAME] [SETTINGS_OPTIONS] - specifies the settings configuration to use for the specified format. For more detail on what parameters to use, see further down the page.

-insettings [FORMAT_NAME] [SETTINGS_OPTIONS] - specifies the settings configuration to use for formats requiring decoding prior to conversion (e.g. .vox, .raw) For more detail on what parameters to use, see further down the page.

-hide - hide the Switch window.

-show - show the Switch window.

-exit - exit Switch.

"Files to Add" is where you type in the files you want to load into Switch. All typed filenames must use the full filepath of the name, and circumfixed with inverted commas.

Examples:

switch.exe -format MP3

switch.exe -outfolder "C:\My Music";

switch.exe -hide

switch.exe "C:\My Documents\sound.mp3"

switch.exe -convert "C:\My Music\music.mp3" -format .wav -overwrite ALWAYS

switch.exe -convert "C:\My Music\music.ogg" -format .mp3 -overwrite APPENDNUMBER "%filename%-%number%"

Unless you are in the Switch folder you will need to replace "switch.exe" from above with the full path "C:\Program Files\NCH Software\Switch\switch.exe" like this:


"C:\Program Files\NCH Software\Switch\switch.exe" -convert "C:\My Music\music.mp3" -format WAV


Settings Options:

The following details what parameters to enter when using the "-settings" and "-insettings" options. Note the order in which the parameters are written is the order in which they must be typed. Additionally, all parameters must be entered otherwise the command will not take effect.

WAV [CODEC] [SAMPLE_RATE] [CHANNELS]
To set WAV default settings, type -settings .wav default

Note the possible combination of values that can be entered depend largely on the codec, so you would have to open Switch and determine beforehand what values you can use for the codec in question.

Examples:

MP3 ENCODER_TYPE CBR[BITRATE] [HIGH_QUALITY] VBR[MIN_BITRATE] [MAX_BITRATE] [QUALITY] [CHANNEL_MODE] [ERROR_PROTECT]

ENCODER_TYPE - either "CBR" or "VBR"

CBR OPTIONS:

VBR OPTIONS:

Examples:

OGG ENCODER_TYPE Quality[QUALITY] VBR[MIN_BITRATE] [MAX_BITRATE] [CHANNELS] [STRIP_COMMENTS]

ENCODER_TYPE - either "Quality" or "VBR"

Quality OPTIONS:

VBR OPTIONS:

Examples:

WMA [CODEC_INDEX] [SAMPLE_RATE] [BITRATE] [CHANNELS]

CODEC_INDEX - this value should be an integer of 0 or greater. The maximum value will depend on which wma codecs you have installed on your computer. The value you specify corresponds directly to the index of the WMA codec pulldown list in the WMA settings dialog. For example, if you prefer to use the first value listed in the pulldown list, specify 0 here. If you prefer to use the second specify 1.

SAMPLE_RATE - Specify the target sample rate of the conversion in Hz. eg. 44100.

BITRATE - Specify the target bitrate of the conversion in bps. eg. 128000.

CHANNELS - Specify 1 for Mono or 2 for Stereo.

Examples:

SPX [MODE] [VALUE] ([AGC] [DENOISE])

MODE - Defines what mode of encoding to perform. Must be one of the following values:

VALUE - This parameter depends on the MODE you specified in the first parameter:

AGC - this is an optional parameter which will turn the Speex encoder's Adaptive Gain Control on.

Denoise - this is an optional parameter which instructs the Speex encoder to denoise the input before encoding.

Examples:

MPC [QUALITY_PRESET]

Example: -settings .mpc Standard

APE [QUALITY_PRESET]

Example: -settings .ape Normal

AIFF [SAMPLE_RATE] [CHANNELS]

Example: -settings .aiff 44100 1

AAC/M4A ENCODER_TYPE ABR[BITRATE] VBR[QUALITY] [FORCE_MPEG2] [TNS]

ENCODER_TYPE - either "ABR" or "VBR"

ABR OPTIONS:

VBR OPTIONS:

Examples:

FLAC [COMPRESSION_LEVEL] [SAMPLE_RATE] [CHANNELS]

Example: -settings .flac 6 44100 2

VOX/RAW [CODEC] [SAMPLE_RATE] [CHANNELS]

(Note: applies to both "-settings" and "-insettings" commands)

Examples:

AMR [BITRATE]

Examples:

DCT [SAMPLE_RATE] [CHANNELS]

Example: -settings .dct 11025 1

M3U/PLS/WPL/RSS [URL]

To configure the settings for the generated MP3 file, use the standard MP3 settings syntax to configure it (i.e. -settings .mp3 etc. etc.)

Examples:


Volume and Audio Cleanup:

The following are used to set the options for amplify, normalize, pop reduction, and noise reduction. Note the order in which the parameters are written is the order in which they must be typed. All parameters must be entered, otherwise the command will use default values. Any value entered out of range will automatically be adjusted to the nearest valid value

-amplify [VALUE] - increase / decrease the loudness or volume (more info). You can disable the feature by -amplify off.

Examples:

-normalize [TYPE] [VALUE] - adjust the volume so that the loudest peak is equal to (or a percentage of) the maximum signal that can be used in digital audio (more info). You can disable the feature by -normalize off.

Examples:

-popreduction [CLICK_SENSITIVITY] [CLICK_LENGTH] - remove click and pop sounds from recordings (more info). You can disable the feature by -popreduction off.

Examples:

-noisereduction [THRESHOLD] [NOISE_GATE] - reduce noise in audio (more info). You can disable the feature by -noisereduction off.

Examples:

-compressor [PRESET] - A dynamic range compressor limits the volume levels of a sound recording so that it stays within a certain loudness range. (more info). You can disable the feature by -compressor off.

Examples:

-equalizer - An equalizer changes the frequency response of a signal so it has different tonal qualities. (more info). This command just turns on / off the equalizer. Use -equalizer off to turn off. Equalizer values needs to be set in the Switch window.

Examples: