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 - CODEC - valid values are:
- "PCM8" - 8 bit PCM Uncompressed
- "PCM16" - 16 bit PCM Uncompressed
- "PCM24" - 24 bit PCM Uncompressed
- "PCM32" - 32 bit PCM Uncompressed
- "GSM" - GSM 6.10
- "GSMN" - GSM 6.10 Native
- "IMAADPCM" - IMA ADPCM
- "MSADPCM" - Microsoft ADPCM
- "ALAW" - CCITT A-Law
- "ULAW" - CCITT u-Law
- SAMPLE_RATE - entered in Hz (e.g. 8000). To use the same sample rate as input source file, use "auto"
- CHANNELS - valid values are:
- If CODEC is "PCM8" / "PCM16" / "PCM24" / "PCM32", use either of the following: 1 (Mono), 2 (Stereo), 6 (for 5.1 Channels), 8 (for 7.1 Channels), "auto" (To use the same number of channels as input source file)
- If CODEC is "IMAADPCM" / "MSADPCM" / "ALAW" / "ULAW", use either of the following: 1 (Mono), 2 (Stereo)
- If CODEC is "GSM" / "GSMN", you can omit the value because the only option is 1 (Mono)
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: - -settings .wav default
- -settings .wav PCM32 48000 auto
- -settings .wav PCM16 auto auto
- -settings .wav GSM 8000
- -settings .wav ALAW 44100 2
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: - BITRATE - entered in kbps e.g. 128
- HIGH_QUALITY - either "TRUE" or "FALSE"
VBR OPTIONS: - MIN_BITRATE - entered in kbps e.g. 128
- MAX_BITRATE - entered in kbps e.g. 192
- QUALITY - a value from 0 to 9
- CHANNEL_MODE - either "STEREO", "JOINT", "FORCE" or "MONO"
- ERROR_PROTECT - either "TRUE" or "FALSE"
Examples: - -settings .mp3 CBR 128 TRUE STEREO TRUE
- -settings .mp3 VBR 128 192 4 MONO FALSE
OGG ENCODER_TYPE Quality[QUALITY] VBR[MIN_BITRATE] [MAX_BITRATE] [CHANNELS] [STRIP_COMMENTS] ENCODER_TYPE - either "Quality" or "VBR" Quality OPTIONS: - QUALITY - a value between 0 and 10
VBR OPTIONS: - MIN_BITRATE - entered in kbps e.g. 128
- MAX_BITRATE - entered in kbps e.g. 192
- CHANNELS - either 1 or 2
- STRIP_COMMENTS - either "TRUE" or "FALSE"
Examples: - -settings .ogg Quality 5 2 TRUE
- -settings .ogg VBR 96 192 1 FALSE
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: - -settings .wma 1 44100 192000 2
SPX [MODE] [VALUE] ([AGC] [DENOISE]) MODE - Defines what mode of encoding to perform. Must be one of the following values: - Preset
- CBR (Constant Bitrate defined in bps)
- VBR (Variable Bitrate defined in bps)
- ABR (Average Bitrate defined in bps)
VALUE - This parameter depends on the MODE you specified in the first parameter: - Preset - a value between 0 (lowest quality and highest compression) and 10 (highest quality and lowest compression).
- CBR - the bitrate at which the audio will be encoded at.
- VBR - the maximum bitrate at which to encode the audio.
- ABR - the average bitrate at which to encode the audio.
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: - -settings .spx Preset 1 Denoise
- -settings .spx VBR 192000 AGC Denoise
- -settings .spx CBR 128000
MPC [QUALITY_PRESET] - QUALITY_PRESET - one of the following: Thumb, Radio, Standard, Extreme, Insane
Example: -settings .mpc Standard APE [QUALITY_PRESET] - QUALITY_PRESET - one of the following: Fast, Normal, High, Extra High, Insane
Example: -settings .ape Normal AIFF [SAMPLE_RATE] [CHANNELS] - SAMPLE_RATE - one of the following: 6000, 8000, 11025, 16000, 22050, 32000, 44100, 48000, 64000, 88200, 96000, 196000
- CHANNELS - either 1(Mono) or 2(Stereo)
Example: -settings .aiff 44100 1 AAC/M4A ENCODER_TYPE ABR[BITRATE] VBR[QUALITY] [FORCE_MPEG2] [TNS] ENCODER_TYPE - either "ABR" or "VBR" ABR OPTIONS: - BITRATE - entered in kbps e.g. 128
VBR OPTIONS: - QUALITY - a value between 0 and 10
- FORCE_MPEG2 - either "TRUE" or "FALSE"
- TNS - either "TRUE" or "FALSE"
Examples: - -settings .aac ABR 128 FALSE FALSE
- -settings .m4a VBR 100 TRUE TRUE
FLAC [COMPRESSION_LEVEL] [SAMPLE_RATE] [CHANNELS] - COMPRESSION_LEVEL - a value between 0 and 8
- SAMPLE_RATE - entered in Hz e.g. 8000
- CHANNELS - either 1 or 2
Example: -settings .flac 6 44100 2 VOX/RAW [CODEC] [SAMPLE_RATE] [CHANNELS] (Note: applies to both "-settings" and "-insettings" commands) - CODEC - a number between 0 and 8, representing the codec type. The codecs on offer are (in order):
- Dialogic ADPCM
- G.711 uLaw
- G.711 aLaw
- 16 bit PCM (Intel Endian)
- 8 bit unsigned
- 8 bit signed
- 16 bit PCM (Big Endian)
- 32 bit float (Intel Endian)
- 32 bit float (Big Endian)
- SAMPLE_RATE - entered in Hz e.g. 8000
- CHANNELS - either 1 or 2
Examples: - -settings .vox 0 44100 2
- -settings .raw 3 32000 1
- -insettings .vox 2 22050 2
- -insettings .raw 4 8000 1
AMR [BITRATE] - BITRATE - the bitrate at which you want to encode the AMR file (in kbps). The choices are 4.75, 5.15, 5.9, 6.7, 7.4, 7.95, 10.2 and 12.2.
Examples: - -settings .amr 4.75
- -settings .amr 10.2
DCT [SAMPLE_RATE] [CHANNELS] - SAMPLE_RATE - one of the following: 8000, 11025, 16000, 22050
- CHANNELS - one of the following: 0(Same as source channels), 1(Mono), 2(Stereo), 6(5.1 Channels), 8(7.1 Channels)
Example: -settings .dct 11025 1 M3U/PLS/WPL/RSS [URL] - URL - the URL of the site where you will host the playlist file. URLs should start with the http:// or ftp:// protocol string as appropriate.
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: - -settings .rss "http://www.music.com/"
- -settings .m3u "http://livebands.com/rock/"
- -settings .pls "ftp://latinmusic.net/samba/"
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. - VALUE - unit is in dB ranging from -40db to 40db.
Examples: - -amplify -30
- -amplify off
- -amplify (Note: No amplification will be applied)
- -amplify 0 (Note: 0 means no amplification will be applied)
- -amplify 41 (Note: 41 is out of range. 40 will be used instead)
-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. - TYPE - Either "PEAK", "RMS", "PEAKRMS", or "PRESET"
- VALUE -
- If TYPE is either "PEAK", "RMS", or "PEAKRMS", unit is in dB ranging from -40db to 0db.
- If TYPE is "PRESET", the value can be either one of the following:
- 0 - Simple Peak
- 1 - Simple Peak, 3dB Headroom
- 2 - Simple Peak, 6dB Headroom
- 3 - Simple Peak, 9dB Headroom
- 4 - Simple Peak, 12dB Headroom
- 5 - Equal Average Loudness
- 6 - Equal Average Loudness, Extra Headroom
- 7 - Equal Percieved Loudness
- 8 - Equal Percieved Loudness, Extra Headroom
Examples: - -normalize PEAK -20
- -normalize PRESET 4
- -normalize off
- -normalize (Note: If no parameters entered, default values will be used: TYPE: PEAK, VALUE: 0)
- -normalize RMS (Note: If no VALUE entered, default value of 0 will be used)
- -normalize PRESET 9 (Note: 9 is out of range. 8 will be used instead)
-popreduction [CLICK_SENSITIVITY] [CLICK_LENGTH] - remove click and pop sounds from recordings (more info). You can disable the feature by -popreduction off. - CLICK_SENSITIVITY - unit is in % ranging from 1% to 100%.
- CLICK_LENGTH - unit is in milliseconds ranging from 1 to 1000.
Examples: - -popreduction 30 420
- -popreduction off
- -popreduction (Note: If no parameters entered, default values will be used: CLICK_SENSITIVITY: 50, CLICK_LENGTH: 450)
- -popreduction 30 (Note: If no CLICK_LENGTH entered, 450 will be used)
- -popreduction 101 400 (Note: 101 is out of range for CLICK_SENSITIVITY. 100 will be used instead)
- -popreduction 45 0 (Note: 0 is out of range for CLICK_LENGTH. 1 will be used instead)
-noisereduction [THRESHOLD] [NOISE_GATE] - reduce noise in audio (more info). You can disable the feature by -noisereduction off. - THRESHOLD - unit is in % ranging from 1% to 50%.
- NOISE_GATE - unit is in dB ranging from -40dB to 0dB.
Examples: - -noisereduction 30 -10
- -noisereduction off
- -noisereduction (Note: If no parameters entered, default values will be used: THRESHOLD: 30, NOISE_GATE: -30)
- -noisereduction 20 (Note: If no NOISE_GATE entered, -30 will be used)
- -noisereduction 0 -15 (Note: 0 is out of range for THRESHOLD. 1 will be used instead)
- -noisereduction 20 -41 (Note: -41 is out of range for NOISE_GATE. -40 will be used instead)
-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. - PRESET - the value can be either one of the following (See link for description):
- 0 - Default
- 1 - Fast
- 2 - Smooth
- 3 - Heavy
- 4 - Hard Limit
- 5 - Soft Limit
- 6 - Noise Gate
Examples: - -compressor 2
- -compressor off
- -compressor (Note: If no PRESET entered, 0 will be used)
- -compressor 7 (Note: 7 is out of range for PRESET. 6 will be used instead)
-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: |