WAV to MP3 mit Lame und Powershell: Unterschied zwischen den Versionen

Aus MyWiki
Zur Navigation springen Zur Suche springen
Die Seite wurde neu angelegt: „ $localpath = (get-location).path $output = "D:\hdd\mp3converted" get-childitem -filter *.wav -Recurse -Path "d:\hdd\Music\BPh Horn Quartet" | % { $New…“
 
Keine Bearbeitungszusammenfassung
 
Zeile 1: Zeile 1:
  $localpath = (get-location).path  
  $localpath = (get-location).path  
  $output = "D:\hdd\mp3converted"
  $output = "D:\hdd\mp3converted"
  get-childitem -filter *.wav -Recurse -Path "d:\hdd\Music\BPh  Horn Quartet" | % {
  get-childitem -filter *.wav -Recurse | % {
     $NewPath = $_.Directory.Fullname -Replace [regex]::escape($localpath), $output
     $NewPath = $_.Directory.Fullname -Replace [regex]::escape($localpath), $output
     $OutFile = $_.Fullname -Replace [regex]::escape($localpath), $output -Replace "\.wav",".mp3"
     $OutFile = $_.Fullname -Replace [regex]::escape($localpath), $output -Replace "\.wav",".mp3"

Aktuelle Version vom 23. Juli 2019, 20:23 Uhr

$localpath = (get-location).path 
$output = "D:\hdd\mp3converted"
get-childitem -filter *.wav -Recurse | % {
   $NewPath = $_.Directory.Fullname -Replace [regex]::escape($localpath), $output
   $OutFile = $_.Fullname -Replace [regex]::escape($localpath), $output -Replace "\.wav",".mp3"
   if (-not (Test-Path $NewPath)) {New-Item -Path $NewPath -ItemType Directory }
   & D:\hdd\Programme\lame\lame.exe -V 0 -b 128 --priority 3 --tt $_.BaseName  --preset standard $_.Fullname $OutFile
}

Alle WAV Dateien unterhalb vom aktuellen Pfad werden konvertiert.
Der Pfad unterhalb wird dabei mit übernommen und der Teil vom aktuellen Pfad (also Start-Pfad) wird durch $output ersetzt
Bsp: Aktueller Pfad ist D:\HDD\Musik
"D:\HDD\Musik\Brass\Interpret1\Titel1.wav" wird zu "D:\HHD\mp3converted\Brass\Interpret1\Titel1.mp3"