From a01ae708d69947dafffd5d002515066b4d6b1d84 Mon Sep 17 00:00:00 2001 From: Maff Date: Mon, 29 Apr 2019 12:58:42 +0000 Subject: [PATCH] Add PowerShell script to convert files in bulk to correctly-encoded WAV --- Convert-ToWave.ps1 | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 Convert-ToWave.ps1 diff --git a/Convert-ToWave.ps1 b/Convert-ToWave.ps1 new file mode 100644 index 0000000..f32d394 --- /dev/null +++ b/Convert-ToWave.ps1 @@ -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" +} \ No newline at end of file