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 /Applications/Switch.app/Contents/MacOS/Switch

Usage: /Applications/Switch.app/Contents/MacOS/Switch [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 -format MP3

./Switch -outfolder ~/Music;

./Switch -hide

./Switch "~/Music/sound.mp3"

./Switch -convert "~/Music/music.mp3" -format .wav -overwrite ALWAYS

./Switch -convert "~/Music/music.ogg" -format .mp3 -overwrite APPENDNUMBER "%filename%-%number%"

Unless you are in the Switch executable's folder you will need to replace ./Switch from above with the full path /Applications/Switch.app/Contents/MacOS/Switch like this:


/Applications/Switch.app/Contents/MacOS/Switch -convert "~/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]

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.

Example: -settings .wav PCM16 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:

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:

MPC [QUALITY_PRESET]

Example: -settings .mpc Standard

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: