I have music collection of over 12,000 tracks. I prefer to actually own my music (ie digital files) and being able to play it on any device I choose rather than using a service like Spotify. That said, I also prefer using OGG over MP3, and the majority of my music collection is (currently) in OGG Vorbis format. Over the years, I've been accumulating lossless albums from places like Bandcamp and transcoding them.
Managing my music library comes with it's own set of challenges and mysteries. I've had a recurring issue where audio playback occasionally stutters on my Android phone (and any Android device for that matter, regardless of hardware) when doing OGG Vorbis playback. It's been a multi-year learning process which involved falling down a technical rabbit hole, but I finally figured out what was causing it and what the tedious solution is.
I learned that OGG Vorbis is an older standard and Android Media Framework does not place nice with it. Opus, on the other hand, is a newer, more modern, and much more efficient at encoding audio quality per bit, so despite being a smaller file, it sounds better. Some of the largest websites utilize Opus, including YouTube. OGG Vorbis uses the file extension ".ogg" whereas Opus uses ".opus" (but still technically uses the OGG container).
A few years ago I published a post, and until recently, I used a command that converts FLAC to Vorbis because I hadn't quite understood audio codecs, believing that bigger files must be better quality.
Converting FLACs to Opus is similar, but the prereq is that opus-tools must be installed. I have the following command in a script will recursively convert any FLACs in the directory and sub-directores to Opus.
find . -iname '*.flac' -print0 | while IFS= read -r -d '' f; do
opusenc --bitrate 160 "$f" "${f%.*}.opus"
done
Spending the last few months with my favorite albums using the Opus codec, playback is smooth and functions flawlessly. Now comes the tedious task of going back through my lossless FLAC collection and transcoding them to lossy Opus, making sure the metadata is accurate, and the album artwork is there.
Thanks for reading. Feel free to send comments, questions, or recommendations to [email protected].