LosslessSwitcher is a free, open-source app designed to address this issue. It runs in the menu bar and checks the sample rate of music being played, then adjusts the output device’s sample rate in the Audio MIDI Setup app.
Automatic sample rate switching for your Mac
Normally, you would have to select a preferred audio format setting from the MIDI Setup utility, and songs played in the Music app would either play normally or be upsampled or downsampled to the specified sample rate. This can lead to data loss in both scenarios, which is why it is better avoided.
LosslessSwitcher gets around this by checking the sample rate of songs being played in the Music app at all times, and then changing the audio output format in the Audio MIDI Setup app automatically. The current sample rate will also be displayed in the menu bar for you to check.
It’s worth remembering that you need to enable lossless audio from the macOS Music app’s preferences in order to take advantage of this feature.
Brief audio interruption when switching sample rate
At the moment, there is an issue that may be a dealbreaker for a lot of users. When a new song starts playing, and it has a different sample rate than the previously played track, there will be a small interruption a couple of seconds after playback starts, when the app switches to the required sample rate.
The interruption is very brief, barely noticeable for some, but audiophiles are nothing if not perceptive. If your music library uses several different sample rates, these small interruptions will likely become annoying.
There may also be a non-negligible impact on your device’s battery life, since the app needs to query the current sample rate very frequently in order to make the switch when necessary.
Great idea, but may need more work
LosslessSwitcher is an interesting app for audiophiles who want to get the best possible quality out of Apple Music on macOS. It’s great in theory, but the brief interruptions experienced when switching sample rates may make it unusable for some. Best to try it out for yourself to see if it’s a worthwhile tradeoff.
Mac cracked apps screenshot: