Add PowerShell script to convert files in bulk to correctly-encoded WAV

This commit is contained in:
Maff 2019-04-29 12:58:42 +00:00
parent 66e3d2bfbd
commit a01ae708d6
1 changed files with 12 additions and 0 deletions

12
Convert-ToWave.ps1 Normal file
View File

@ -0,0 +1,12 @@
$basepath="."
$in_put="$basepath/Input"
$output="$basepath/Output"
$ffmpeg=Get-Command ffmpeg
if ($ffmpeg -eq $null) {
$ffmpeg="$basepath/ffmpeg.exe"
}
$toconvert=Get-ChildItem "$in_put/"
$toconvert|%{
$outfn=$_ -replace '\.[a-zA-Z0-9]+$','.wav'
& $ffmpeg -i "$in_put/$_" -acodec pcm_s16le -ac 1 -ar 8000 "$output/$outfn"
}