Created
August 12, 2022 14:02
-
-
Save pstakuu/4c5ca7cc81643b72d0d299caa589bed4 to your computer and use it in GitHub Desktop.
converts other sound formats to mp3 - can't remember where I grabbed this from but put it together and requires VLC
This file contains 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
function ConvertToMp3( $file, [string] $vlc = 'C:\Program Files\VideoLAN\VLC\vlc.exe') { | |
PROCESS { | |
$codec = 'mp3'; | |
$oldFile = Get-Item $file; | |
$newFile = $oldFile.FullName.Replace($oldFile.Extension, ".$codec"); | |
&"$vlc" -I dummy "$oldFile" ":sout=#transcode{acodec=$codec,vcodec=dummy}:standard{access=file,mux=raw,dst=$newFile}" vlc://quit | out-null; | |
#Only remove source files when you are sure that the conversion works as you want | |
#Remove-Item $oldFile; | |
} | |
} | |
$vlc = 'C:\Program Files\VideoLAN\VLC\vlc.exe' | |
$codec = 'mp3'; | |
$oldFile = Get-Item 'C:\tmep\Sound recordings\Recording (2).m4a' | |
$newFile = $oldFile.FullName.Replace($oldFile.Extension, ".$codec"); | |
&"$vlc" -I dummy "$oldFile" ":sout=#transcode{acodec=$codec,vcodec=dummy}:standard{access=file,mux=raw,dst=$newFile}" vlc://quit | out-null; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment