Using VLC to find out personal audio file quality preferences
I’m getting ready to archive my 2000+ music track library on Spotify (very legit of course) and I wanted to do a test between some popular audio quality/bitrate formats to see what would work best for my current needs and near-future needs. So, I grabbed 3 different audio files for the same track and started playing each individually in VLC. But, this was getting quite cumbersome to orchestrate and I was getting distracted while switching and seeking.
Luckily, VLC can be puppeteered via the CLI. I wanted to do the following:
- Load 3 tracks into current playlist
- Select next track
- Play a specific range (e.g. 00:30 – 00:45)
- Repeat from (2)
With some help from Raycast and o4-mini, I figured that we can launch VLC like so:
vlc \
--no-video \
--loop \
--start-time 30 \
--stop-time 45 \
"a.mp3" "b.ogg" "c.m4a"
--start-time is the time in seconds to seek to before playing, which is the 30-second mark here. --stop-time is the time mark at which to stop the playback and move to the next file from the arguments list at the end, which is the 45th second in this example. I passed 3 files in this example but you can pass more if you want. Keeping it short might be better for this exercise. --loop option loops to the first file from the list of arguments once all files are played.
Instead of --stop-time, --run-time 15 can be used instead to instruct VLC to play the next 15 seconds of the file from --start-time.
Thanks to this, I was able to figure out my sweet spot and settle on 128 Kbps Opus (VBR) as the format for all the music in my local archive.