Programming, philosophy, pedaling.
Jul 27, 2023
Tags:
This is another tool announcement post, this time for shaq
.
As the demo implies, shaq
does just one thing: it listens to an audio source and sends the results
to Shazam for fingerprinting. If a match is found, it prints it.
As usual, you can install it from PyPI using pip
or
pipx
:
1
2
3
4
5
pip install shaq
# or:
pipx install shaq
shaq --help
Usage
By default shaq
listens to the system microphone (helpfully supplied through
portaudio
) and writes its findings as plain text, but you can tell
it to detect from an arbitrary input instead:
1
2
3
4
5
6
7
8
# shaq analyzes the first 10 seconds by default
shaq --input mystery.mp3
# analyze a longer segment
shaq --input mystery.mp3 --duration 15
# anything with an audio track that ffmpeg can handle can be an input
shaq --input another-mystery.mp4
…as well as to emit JSON:
1
shaq --listen --duration 5 --json | jq '[.track.title, .track.subtitle]'
produces:
1
2
3
4
[
"Mendacity",
"Max Roach"
]
Under the