How to record Apple Music using BlackHole
It's possible (but not convenient) to record music from streaming services. In many countries (including Sweden) it's also legal, but may still be a breach of terms of service. Apple Music (and others) that have lossless streaming is a decent option (none of them are good).
The solution I've used for albums that cannot be bought in the streaming economy is to record the computer audio while it is still inside the computer, split it to individual tracks, and encode those as FLAC. This is the modern version of recording cassette tapes of your favourite songs off the radio.
The tools I use are BlackHole which provides the software equivalent of an audio cable from Music's audio out to the microphone port, Audacity for recording and editing, and MusicBrainz Picard for tagging. Because I imagine software change a lot, I'm going to describe the general steps.
- Turn off all alert sounds, etc, on the computer.
- Set Apple Music to lossless streaming in the settings. Disable the weird special audio features like spatial audio, Dolby, etc.
- Install the 2-channel version of BlackHole. It's on Homebrew as
blackhole-2ch. - Make a playlist with the songs you want (usually an album), and add a padding song in the beginning and end.
- Set Audacity to record from BlackHole and Music (or possibly the entire system) to play music to BlackHole.
- You can either use a combined audio device of BlackHole and your normal audio output (speakers or headphones) or Audacity's ability to output the recorded audio as it records to hear what's happening.
- Start playing your first padding/sacrificial track from the playlist, ensure it shows up in Audacity, and start recording. Go make coffee or something while the album plays, because there is no way to speed it up.
- Select the entire audio track and use Audacity's Label Sounds feature to split it up at the silecens between tracks. If your music is gapless you have a problem; in that case you more or less have to do it manually. I've found that the default settings have too high a noice ceiling; generally the silences here are very silent so you may want to adjust that. Try it a few times until it gets it right, or go artisan and split it yourself.
- Export to FLAC and enable producing multiple files using the labels you created.
- Use MusicBrainz Picard to tag the outputs. It should recognise the files from their audio footprints. Note that you almost certainly didn't get the silences right, so the tracks will differ in length by a few seconds. That's one of the prices you pay.
I assume most of this method can also be applied when recording a cassette tape or vinyl record.