trashtalker/Convert-ToWave.ps1

12 lines
352 B
PowerShell
Raw Normal View History

$basepath="."
$in_put="$basepath/Input"
$output="$basepath/Output"
2019-04-29 14:00:22 +01:00
$ffmpeg=Get-Command -ErrorAction SilentlyContinue ffmpeg
if ($ffmpeg -eq $null) {
2019-04-29 14:00:22 +01:00
$ffmpeg="$basepath/ffmpeg"
}
$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"
}