Created
June 8, 2021 17:05
-
-
Save piousdeer/94b36044e1a8caa2b6c70503f4711912 to your computer and use it in GitHub Desktop.
Recognize music playing on your Linux computer via a terminal command
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
audd() { | |
api_token=test # get one from https://audd.io or use "test" if you don't mind the rate limits | |
source="$(pactl info | grep 'Default Sink' | cut -d":" -f2 | cut -c2-).monitor" | |
echo "Listening..." | |
ffmpeg -hide_banner -loglevel error -f pulse -i $source -t 7 -y /tmp/audd.ogg || return 1 | |
echo "Uploading..." | |
curl -s -F api_token=$api_token -F file=@/tmp/audd.ogg https://api.audd.io | jq | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment