Repository navigation
Music Recognition
"What song is this?" — one click and the shell listens, identifies the track and tells you the title and artist, with buttons to open it on Shazam or search it on YouTube. It uses SongRec, an open-source client for Shazam's fingerprint service: SongRec turns a few seconds of audio into a compact fingerprint on your machine and sends only that to Shazam, not a recording.
It can listen to what your computer is playing (the default output's monitor) or to the microphone — so it identifies a song in a video or a stream as easily as one playing in the room.
- Dashboard quick toggle "Identify Music" (Super + N): click to start/stop listening; right-click switches the source between System sound and Microphone. The toggle shows Listening… while active.
-
Launcher: type
/songrec(a built-in action) and run it. - Dynamic Island: while listening, the island shows a breathing glyph and a Cancel button; when a track is found it shows the title and artist with Open (the Shazam page) and YouTube for ten seconds, a failure shows one line for four seconds. Hovering keeps the card up.
- Without the island the same information arrives as notifications: "Listening…", then "Music Recognized — title – artist" with Shazam and YouTube action buttons.
- The on-screen display and the desktop search-pill widgets carry a start/stop button too, and the AI assistant has a
song_identifytool (it asks for approval first, since it turns the microphone / system audio on). - IPC:
qs -c ii ipc call songRec toggle/stop.
scripts/musicRecognition/recognize-music.sh is the whole engine:
- Picks the audio device with
pactl: for System sound the default sink's.monitor, for Microphone the default source; if that device isn't found it falls back to the first available source. - Runs
songrec listen --audio-device <device> --json --disable-mprisinto a private FIFO (removed on exit) and reads its JSON lines. - Ignores empty results (
"matches": []) and exits on the first real match, or when the time limit is reached — whichever is first.
The service reports problems in plain words: Make sure you have songrec installed (exit code 1), No match found. Try again or check your audio output., Could not identify this song. Try a different audio source., Recognition failed. The shell's own privacy indicator knows SongRec is the shell's own capture and doesn't announce it as "an app is using your microphone".
| Key | Default | Meaning |
|---|---|---|
musicRecognition.timeout |
16 |
Seconds to listen before giving up |
musicRecognition.interval |
4 |
Passed to the script as -i; the current script accepts it but SongRec itself decides how often it tries |
dynamicIsland.widgets.songRec.enable |
true |
Let the island own recognition (otherwise notifications are used) |
The quick toggle is in the dashboard's default list (sidebar.quickToggles.actionCenter.toggles contains musicRecognition); reorder or remove it from the toggle editor (Sidebar Dashboard).
| Piece | Role |
|---|---|
services/SongRec.qml |
State, source choice, result parsing, notifications, songRec IPC |
scripts/musicRecognition/recognize-music.sh |
Device selection and SongRec run |
modules/common/models/quickToggles/MusicRecognitionToggle.qml |
The quick toggle |
modules/ii/dynamicIsland/core/sources/SongRecSource.qml, widgets/FloatingNotchSongRec.qml
|
Island face |
songrec is part of the base dependency set of the dotfiles installer; if it's missing the toggle tells you.