I created a little script that should convert my audio files (multiple selected) to mp3 (192kbit CBR) via Sox.
What I'd like to achieve is: Take the first selected audio file, convert it; take the second one, convert it, etc.
Step by step.
What I don't want: Block XYplorer while the files are converted / the script is running.
Using "run" with wait=1 instead of "open" isn't an option, XYplorer will not be accessible as long as the script is running and if I use open it will take all selected files at once and creates a dos window for each (and I want to avoid that^^).
Any hints?
Code: Select all
// 26.06.2011, use sox to convert to .mp3
// Declare variables
$sox_cmd = "<xydrive>\Tools\Sox_CLI\sox.exe";
$items = get("SelectedItemsPathNames", "|");
if ($items>"")
{
$loop = 1;
$count = 0;
$array = "";
while(true)
{
$entries = gettoken($items, $loop, "|");
if ($entries == "") {break;}
$cur_array_element = $entries;
incr $count;
$input_ext = substr("$cur_array_element", -4);
$outputfile = replace("$cur_array_element", "$input_ext", "");
$outputfile = $outputfile . "_192.mp3";
open """$sox_cmd"" -S --multi-threaded ""$cur_array_element"" -C 192.2 ""$outputfile"" rate -v 44100";
incr $loop;
}
}
highend
XYplorer Beta Club