Saturday, May 23, 2020

PowerShell Script for batch WAV/APE to FLAC

This is a script I use for converting any WAV/APE files in a folder to FLAC.

$files = Get-ChildItem -Recurse -path . -filter *.ape
foreach ($file in $files) {
    $path = Split-Path -Path $file.FullName
    $new_name = [IO.Path]::GetFileNameWithoutExtension($file) + ".wav"
  
    $new_name = Join-Path $path $new_name
  
    mac $file.FullName $new_name -d
}

$files = Get-ChildItem -Recurse -path . -filter *.wav
foreach ($file in $files) {
    flac --best $file.FullName
}

No comments: