Last active
September 21, 2017 09:13
-
-
Save fljdin/e89ceede996d00799da0f82a8e03ee22 to your computer and use it in GitHub Desktop.
Bulk convert m4a and aac to mp3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| foreach($inputFile in get-childitem -recurse | Where-Object { @('.m4a','.aac') -contains $_.extension }) | |
| { | |
| $outputFileName = [System.IO.Path]::GetFileNameWithoutExtension($inputFile.FullName) + ".mp3"; | |
| $outputFileName = [System.IO.Path]::Combine($inputFile.DirectoryName, $outputFileName); | |
| $programFiles = ${env:ProgramFiles(x86)}; | |
| if($programFiles -eq $null) { $programFiles = $env:ProgramFiles; } | |
| $processName = $programFiles + "\VideoLAN\VLC\vlc.exe" | |
| $processArgs = "-I dummy -vvv `"$($inputFile.FullName)`" --sout=#transcode{acodec=`"mp3`",ab=`"128`",channels=`"2`",samplerate=`"44100`"}:standard{access=`"file`",mux=`"mp3`",dst=`"$outputFileName`"} vlc://quit" | |
| start-process $processName $processArgs -wait | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment