First, this one custom file association is better than nothing to me:
Code: Select all
"dBatch Converter GUI|C:\Program Files\dBpoweramp\dBConfig.exe" {:Audio}>::copytext <curpath>; run """C:\Program Files\dBpoweramp\dBConfig.exe""";
But what I primarily use is this:
I was pretty frustrated with the same thing as I'm a long-time dbPowerAmp user. Got tired of trying to make it work so wrote a little script for use with custom file associations. It's not exactly ready for prime time, but it was quick to write, and it works well enough my purposes in its current state. If anyone wants me to finish it up, I'll take the time, but it does what I intended in its current state fairly well. You'll have to make sure the programs called are available and placed in the early variables. If you'd like help with that, feel free to ask. Also, it uses my personal defaults, which are things like converting FLAC to mp3 V0.
Again, I never intended on sharing this script, but I feel your pain.
First, put this in as a custom file association:
Code: Select all
|"dbConvertCLI to Defaults|C:\Program Files\dBpoweramp\MusicConverter.exe" {:Audio}>::load "<xyscripts>\DBConvertCLI.xys", "DBConvertCLI";
Then, here's this, for what it's worth. It meets my personal needs well enough that I haven't polished it. It's also a rather old script for me, and I'm sure I would have written it better if it had been more recent. I've left all my personal comments in.
One concern you may have, is if you're converting a lossless format like APE, which I convert to FLAC, I recycle bin the original files without a prompt as I myself would have no further use for them. You can search for WARNING in the comments, which I added before I shared this. All this script does is convert whatever format is there to what I would generally do were I to use the dbPowerAMP GUI, only via CLI. It converts lossless formats to flac and converts flac to V0 in a subfolder of the original folder. I haven't handled outliers like lossless wma as I've only got a few of those lying around on older hard disks.
I forget whether my initial settings in dbPowerAMP were significant. I don't think so....
I personally use a more powerful program if I'm downsampling, for example, a 24/192 flac to redbook, so I've made no provision for that in this program. (It's an audio editor that does this particularly well.)
Were I doing this again, I might use
http://sox.sourceforge.net/ instead for my conversions - and probably include a graphic of the frequency data, which that can do, as well. But, I'm used to and like dbPowerAMP, so I stuck with that.
Well, here goes. Try not to taunt the programmer for the unpolished share:
Code: Select all
"FOREACH - dbPowerAMP Comvert||| : DBConvertCLI"
//ToDo: As is, just uses my default preferences for each file type. Could make it more robust, but slower to use, or just continue changing preferences here.
//ToDo: I forget how much this depends on my settings within dbPowerAmp.
//This recycles originals of formats I don't care to keep after conversion - lossless to FLAC. Keeps the originals for FLAC to VO.
//ToDo: Put in some sort of confirmation, perhaps an html form showing what's going to happen with some check boxes for behavior, or perhaps preference variables at start of script.
$dbcoreconverter = "C:\Program Files\dBpoweramp\CoreConverter.exe"; //Nothing worked, so I didn't even bother with worrying about bitness.
$mediaInfo = "<xydata>\Programs\MediaInfo.exe"; //I keep any program I frequently call from a script in a Programs folder in my data folder.
//Where appropriate, I generally put the whole folder in, then make a hardlink to the main executable and put it directly in the <xydata>\Programs folder, which I have on my path.
$selitems = "<selitems |>";
$curext = gpc(<curitem>, "ext");
$curext = recase($curext, "lower");
$parentP = gpc(<curitem>, "component",-2,1);
//Could add a warning or other behavior if all the extensions don't match the first one.
//ToDo: This makes an assumption about all the files in the directory concerned being the same. Fiarly reasonable, but could check each. One would think I'd notice, though.
SWITCH ($curext) {
case "flac":
new("(V0", "dir"); //Creates a new target directory giving the quality, VO for the MP3 conversion.
//ToDo: If they're high bitrate/bitdepth files, offer the choice to convert them to redbook rather than mp3.
FOREACH ($i, $selitems, "|", , "Nothing selected. Oops!") {
selectitems $i, "2";
//Location Variables
$childP = <curitem>;
$parentP = gpc($childP, "component",-2,1);
$childB = gpc($childP, "base");
$infile = $childP;
$outfile = "$parentP\(V0\$childB.mp3";
run """$dbcoreconverter"" -infile=""$infile"" -outfile=""$outfile"" -convert_to=""mp3 (Lame)"" -V 0 -q 0""", , "2", "1";
//Wait until each track is finish rather than open a window for every file, Display the cmd window.
}
break;
case "ape":
new("(FLAC", "dir"); //Creates a new target directory giving the quality, FLAC for APE
FOREACH ($i, $selitems, "|", , "Nothing selected. Oops!") {
selectitems $i, "2";
//Location Variables
$childP = <curitem>;
$parentP = gpc($childP, "component",-2,1);
$childB = gpc($childP, "base");
$infile = $childP;
$outfile = "$parentP\(FLAC\$childB.flac";
run """$dbcoreconverter"" -infile=""$infile"" -outfile=""$outfile"" -convert_to=""FLAC"" -q 8""", , "2", "1";
//Wait until each track is finish rather than open a window for every file, Display the cmd window.
}
//Could insert, "Delete Originals and Move FLAC to Current?"
delete "1", "0", $selitems; //Recycle, No Confirm, Itemlist. <--WARNING: For lossless formats, I delte the original files to tthe recycle bin.
goto "<curpath>\(FLAC\", 1; //Reuse existing tab.
sel "a";
#1056; //Move Files Up
goto "<curpath>\.."; //Go to parent.
delete "1", "0", "<curpath>\(FLAC"; //Delete temporary folder.
wait 500;
#485; //Refresh Current List
break;
case "wav":
new("(FLAC", "dir"); //Creates a new target directory giving the quality, FLAC for WAV
FOREACH ($i, $selitems, "|", , "Nothing selected. Oops!") {
selectitems $i, "2";
//Location Variables
$childP = <curitem>;
$parentP = gpc($childP, "component",-2,1);
$childB = gpc($childP, "base");
$infile = $childP;
$outfile = "$parentP\(FLAC\$childB.flac";
run """$dbcoreconverter"" -infile=""$infile"" -outfile=""$outfile"" -convert_to=""FLAC"" -q 8""", , "2", "1"; //Wait until each track is finish rather than open a window for every file, Display the cmd window.
}
//Could insert, "Delete Originals and Move FLAC to Current Directory?"
delete "1", "0", $selitems; //Recycle, No Confirm, Itemlist. <-- WARNING: Again, lossless, so it goes in the bin.
goto "<curpath>\(FLAC\", 1; //Reuse existing tab.
sel "a";
#1056; //Move Up
goto "<curpath>\.."; //Go to parent.
delete "1", "0", "<curpath>\(FLAC";
wait 500;
#485; //Refresh Current List
break;
case "wv":
new("(FLAC", "dir"); //Creates a new target directory giving the quality, FLAC for Wavepack
FOREACH ($i, $selitems, "|", , "Nothing selected. Oops!") {
selectitems $i, "2";
//Location Variables
$childP = <curitem>;
$parentP = gpc($childP, "component",-2,1);
$childB = gpc($childP, "base");
$infile = $childP;
$outfile = "$parentP\(FLAC\$childB.flac";
run """$dbcoreconverter"" -infile=""$infile"" -outfile=""$outfile"" -convert_to=""FLAC"" -q 8""", , "2", "1"; //Wait until each track is finish rather than open a window for every file, Display the cmd window.
//Could insert, "Delete Originals and Move FLAC to Current?"
delete "1", "0", $selitems; //Recycle, No Confirm, Itemlist. <-- WARNING
goto "<curpath>\(FLAC\", 1; //Reuse existing tab.
sel "a";
#1056; //Move Up
goto "<curpath>\.."; //Go to parent.
delete "1", "0", "<curpath>\(FLAC";
wait 500;
#485; //Refresh Current List
}
break;
case "alac":
new("(FLAC", "dir"); //Creates a new target directory giving the quality, FLAC for ALAC
FOREACH ($i, $selitems, "|", , "Nothing selected. Oops!") {
selectitems $i, "2";
//Location Variables
$childP = <curitem>;
$parentP = gpc($childP, "component",-2,1);
$childB = gpc($childP, "base");
$infile = $childP;
$outfile = "$parentP\(FLAC\$childB.flac";
run """$dbcoreconverter"" -infile=""$infile"" -outfile=""$outfile"" -convert_to=""FLAC"" -q 8""", , "2", "1"; //Wait until each track is finish rather than open a window for every file, Display the cmd window.
//Could insert, "Delete Originals and Move FLAC to Current?"
delete "1", "0", $selitems; //Recycle, No Confirm, Itemlist. <--WARNING
goto "<curpath>\(FLAC\", 1; //Reuse existing tab.
sel "a";
#1056; //Move Up
goto "<curpath>\.."; //Go to parent.
delete "1", "0", "<curpath>\(FLAC";
wait 500;
#485; //Refresh Current List
}
break;
case "mp3":
msg "You don't want to re-compress a lossy format.";
break;
case "ogg":
msg "You don't want to re-compress a lossy format.";
break;
case "m4a":
msg "You don't want to re-compress a lossy format.";
break;
case "aac":
msg "You don't want to re-compress a lossy format.";
break;
case "wma":
//Fall through to default.
//ToTo: Add some code to actually run the thing if it is lossless. But this is such an outlier....
case "default":
echo "Check whether it's lossy.";
run """C:\Program Files\MediaInfo\MediaInfo.exe"" ""<curitem>""";
//ToDo: Could do it much cleaner than this. Be able to choose a behavior based on what I read in MI. Probably an html form.
//'Codec Central'. [dBCoreConverter::dBCoreConverter] <--?! what was I thinking when I made this comment?
FOREACH ($i, $selitems, "|", , "Nothing selected. Oops!") {
$codecDescr = runret("$mediaInfo --Output=Audio;%CodecID_Description% ""<curitem>"""); //I'd probably do this differently now.
IF (($codecDescr LikeI "*Lossless*") AND ("flac" UnLikeI gpc(<curitem>, "ext"))) {
selectitems $i, "2";
//Location Variables. P indicates full path, B indicates Base.
$childP = <curitem>;
$parentP = gpc($childP, "component",-2,1);
$childB = gpc($childP, "base");
$infile = $childP;
$outfile = "$parentP\$childB.flac";
run """$dbcoreconverter"" -infile=""$infile"" -outfile=""$outfile"" -convert_to=""FLAC"" -q 8""", , "2", "1";
//Wait until each track is finish rather than open a window for every file, though that actually seems to work adequately, Display the cmd window.
//ToDo: Open 2-4 windows at a time and wait until one's finished, then open another one. But only for an SSD. I prefer single threaded for a spinning disk.
}
}
break;
default:
if ($selitems == "") {Msg "Nothing selected. Oops!";}
else {
run """C:\Program Files\dBpoweramp\dBConfig.exe""", """$parentP""";
}
break;
}