Last active
May 4, 2022 17:34
-
-
Save peaeater/6689b5c50111b4f438e253c33aee52e1 to your computer and use it in GitHub Desktop.
Powershell script that uses VLC to rip a CD audio track.
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
<# | |
Rip Audio CD to mp3 files with VLC. | |
#> | |
param ( | |
[string]$vlc = "c:\program files\videolan\vlc\vlc.exe", | |
[string]$cddrive = "E:", | |
[int]$track = 0 | |
) | |
# rip one track | |
if ($track -gt 0) { | |
& $vlc -I dummy cdda:///$cddrive/ --cdda-track=$track :sout="#transcode{acodec=mp3}:std{access=file,mux=raw,dst=Track$track.mp3}" vlc://quit | |
exit 0 | |
} | |
# rip all tracks | |
$tracks = get-childitem $cddrive -Filter *.cda | |
$i = 1 | |
foreach ($item in $tracks) { | |
& $vlc -I dummy cdda:///$cddrive/ --cdda-track=$i :sout="#transcode{acodec=mp3}:std{access=file,mux=raw,dst=Track$i.mp3}" vlc://quit | |
$i = $i + 1 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment