Skip to content

Instantly share code, notes, and snippets.

@peaeater
Last active May 4, 2022 17:34
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peaeater/6689b5c50111b4f438e253c33aee52e1 to your computer and use it in GitHub Desktop.
Save peaeater/6689b5c50111b4f438e253c33aee52e1 to your computer and use it in GitHub Desktop.
Powershell script that uses VLC to rip a CD audio track.
<#
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