Skip to content

Python script that listens by microphone what you play, display fullscreen album art and scrobbles to last.fm

License

Notifications You must be signed in to change notification settings

jbrepogmailcom/listen-show-scrobble-setlamps

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

listen-show-scrobble

Python script that listens by microphone what you play, obtains track details from Shazam, displays fullscreen album art, scrobbles to last.fm and sets color of lamps connected to Home Assistant.
HTML page is optimized only for 1920x1080 resolution. If you want to use it on other display then change songhtml1.html

Installation:

  • download all files to home directory
  • install all necessary libraries in #includes
  • get last.fm API key and secret and fill it into py code
  • get authorization key from Home Assistant and codes of entities you want to control and insert it to code
  • allow listen-loop.sh to run: sudo chmod +x listen-loop.sh
  • install chromium and get proper location by whereis chromium and modify py script if necessary

You may need to adjust line with arecord. Either parameter with correct device may be needed by adding -d "hw:0,0" or similar, or you may need to set microphone as default recording device, or you may need to adjust recording rate in parameter -r. Please do not ask about it, I cannot support. It took me lot of experimenting to get it working for my particular configuration.

Run script as python3 ./listen-show-scrobble-setlamps.py

the script is not failproof, it may end with error if no image is provided by shazam, therefore it is better to run it in loop by ./listen-loop.sh

About

Python script that listens by microphone what you play, display fullscreen album art and scrobbles to last.fm

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published