- Spotify
- Shazam
- Migrate Playlists Between Music Platforms
- Shazam Songs while using Headphones on Mac
- MP3 Metadata Editing
- Metadata Tools
- Memes
Popular streaming music service.
See the Spotify page for more Spotify tips.
Listens to a song and matches its name using an online database.
See the Shazam page.
See the Spotify page.
Capture those tunes from your favourite movies or TV shows while you're listening with headphones.
Create an aggregate multi-output audio device with your headphones and a dummy output, and then point Shazam to the dummy output to link it to the audio.
On Mac, you can do this by:
- install Blackhole (choose the 2ch device)
brew install --cask blackhole-2ch-
restart for the new Blackhole 2ch device to be usable
-
Cmd+Spaceto open Spotlight and search forAudio Midi Setup App
or from the command line:
open -a "Audio Midi Setup"- Click
+andCreate Multi-Output Device - Add your headphones and
Blackhole 2chto the multi-output audio device - Switch the sound output to use the new Multi-Output Device, via GUI or on the command line:
brew install switchaudio-osxSwitchAudioSource -t output -s "Multi-Output Device"- The Shazam app settings follows the system sound input device, set it to use the
Blackhole 2chdevice
SwitchAudioSource -t input -s "BlackHole 2ch"- Shazam away!
open -a ShazamIf you want to set the system sound effects, such as moving files,
to go to the multi-output audio device into the headphones too
(to not disturb somebody sleeping next to you) then you may want to go to System Settings ->
Sound -> Sound Effects and set Play sound effects through near the top to the Multi-Output audio device.
When I connect my AirPods they become the sound input and output device, and this needs to be switched back to the blackhole input and multi-output device to be able to Shazam again.
You can automate this by triggering the SwitchAudioSource command upon a system event using Hammerspoon to trigger
whenever AirPods connect to bluetooth.
Install Hammerspoon as a system event handler to trigger your SwitchAudioSource command.
See the Mac page's Hammerspoon - System Event Handler section for setting up Hammerspoon with the exact Hammerspoon Lua code I use to trigger this automated switch back to the first Multi-Output and BlackHole input devices found.
Use the id3v2 program to set metadata on mp3 files.
Useful to group a bunch of mp3 files for an audiobook.
Set the --author / -a and --album / -A tags at once so Mac's Books.app groups them properly into one audiobook:
id3v2 -a "MyAuthor" -A "MyAlbum" *.mp3The scripts mp3_set_artist.sh and mp3_set_album.sh in the DevOps-Bash-tools repo's media/
directory make it slightly easier.
Set the --track number for each mp3 file, so they play in the right order:
i=0
for x in *.mp3; do
((i+=1))
id3v2 -T $i "$x"
doneThe scripts mp3_set_track_order.sh and mp3_set_track_name.sh in the DevOps-Bash-tools repo's media/
directory make this slightly easier.
XXX: Danger - use only in an audiobook subdirectory, otherwise it'll ruin the metadata of your MP3 library!
find . -maxdepth 2 -iname '*.mp3' |
{
i=0
while read mp3; do
((i+=1))
id3v2 -a "MyAuthor" -A "MyAlbum" "$mp3"
done
}For subdirectories eg. CD1, CD2 etc...
XXX: Danger - use with care - if misused at the top dir it'd ruin your MP3 library's metadata!
find . -maxdepth 2 -iname '*.mp3' |
{
i=0
while read mp3; do
((i+=1))
id3v2 -T $i "$mp3"
done
}Public database of music metadata with a free to use API:
https://musicbrainz.org/doc/MusicBrainz_API
There are MusicBrainz API scripts in HariSekhon/DevOps-Bash-tools:
Unfortunately the API rate limiting is quite bad at 1 request per second per source IP, and 300 requests per second globally across everybody before they start denying requests with HTTP 503 errors.
This makes the API potentially impractical for large scale programmatic refinement of my extensive HariSekhon/Spotify-Playlists repo which has tens of thousands of tracks that may be queried.
https://picard.musicbrainz.org/
Open source database that can be used to auto-tag music files.
