Requires Windows Media Encoders and FLAC.
foreach ( $file in dir *.flac ) { # Prep input and output filenames $shortName = $file.Name.Substring(0, $file.Name.Length - $file.Extension.Length); $wav = $shortName + ".wav"; $wma = $shortName + ".wma"; # Decode FLAC to WAV & 'C:\Program Files (x86)\FLAC\flac.exe' -d $file.Name # Encode WAV to WMA Lossless cscript "C:\Program Files\Windows Media Components\Encoder\WMCmd.vbs" -input $wav -output $wma -a_codec WMA9LSL -a_mode 2 # Cleanup del $wav; }
No comments:
Post a Comment