[Windows] Help needed! Flac to ogg converter script
Posted: September 2nd, 2015, 1:40 pm
I've written a little converter script, but have no idea why it's not working.
Process is as follows: when a flac download finishes, "call.bat" is called which in return calls "flacogg.ps1".
call.bat looks like this:
flacogg.ps1 looks like this:
Problem might be a path issue, but I'm not sure. Any help is highly appreciated!
Thanks in advance
Process is as follows: when a flac download finishes, "call.bat" is called which in return calls "flacogg.ps1".
call.bat looks like this:
Code: Select all
PowerShell -ExecutionPolicy Bypass "C:\Progra~2\SABnzbd\scripts\flacogg.ps1" -PathName "%1"
Code: Select all
param(
[string]$PathName
)
# Move flac files from sub dir to processing dir
Get-ChildItem -Path $PathName -Recurse -File -Filter *.flac | Move-Item -Destination $PathName
# get all files for encoding
$files = Get-ChildItem -Path $PathName -File -Filter *.flac
for($i=0; $i -lt $files.count; $i++) {
$outfile = $files[$i].Name + ".ogg"
oggenc2 -q 10 -S 0 -o $outfile $files[$i]
}
exit 0
Thanks in advance