Match any song which playing through your pc speakers and more
The answer can be found that i sit a lot of hours in front of a PC for work, and many many times, i listen to some local radio, which is just a stream , and want to know how the song is named.
All the other solutions was to capture audio from input devices, and i had to make a whole procedure on looping my output, through an audio mix, and outputing in a virtual input (voicemeeter is called the software https://vb-audio.com/Voicemeeter/, take a look, very powerful)
- It loads and searches for default playback device (e.g. Speakers)
- It links it to the Loopback device (as it has the same name)
- The button trigers the record audio to an array (4 seconds) and then sends to api to recognize
- Returns a popup window with full infos and even Preview Audio. Crash-free , even on not selecting device, and error handling of no result and not return values in API
It just detects the audio from speakers (loopback) , (it only detects the default output device, and search for its loopback device)
records it to a small wav file and send it using Shazamio package library (https://github.com/shazamio/ShazamIO)
and returns a window with info.
Its just the basic functionallity, but more feauture will be added.
- Code Cleanup
- Stable release
- All bugs fixed. Now checks everything (even to not re-trigger the recognition once it's started once)
- Actually not start the recognition if selected_device is not a device
- Fixed "Year" tag always to Unknown, wrong location was searched.
- More infos in result window
- Add a play button as shazamio also fetches a preview audio of identified song
- Added Icon.ico to new popup window
- Lot of debug messages for me
- Added Input devices
- Check to validate selection to not start if no device is selected
- Added also image to button instead of "Recognize"
- Added animation when clicking the button
- Separated thread for recognition
- Added detection for loopback devices
- Detached the wav file (converted to byte array)
- More infos on result window
- Initial release
Building yourself (or look in Releases:)
Before running the application, you need to install the required Python packages. You can install all necessary packages using pip:
pip install numpy requests Pillow pydub simpleaudio ffmpeg-python shazamio
build command for Windows:
pip install pyinstaller
COPY ASSETS FOLDER TO BUILD ELSE GONNA FAIL, COPY TO SAME DIR AS THE SCRIPT
pyinstaller --onefile --windowed --icon=icon.ico --add-data "icon.ico;." --add-data "shaza_logo.png;." --add-data "shaza_anim.gif;." --name "SongIdentifier" shazam.py
- Transfer the Recognition process to a new thread for not hanging the whole app. (in v0.2)
- A nicer UI (v0.4)
- Selection multiple devices, both input and output (loopback) not defaulting just to default output device. (v0.3)
- A way to capture audio to bit stream , so no need for file (v0.2)
- A nicer animation (v0.2.1)
- More info on window (v0.4)
- Check to not crash if not treated well (bugs in all versions) (v0.4, and v1.0)
- A LINK! (v0.2)
- TRYING to add a duration for playing audio preview (if you can implement this feel free to PR) ... more.
It will be ported to an all-in-one .exe for usage on any windows machines.
The library need for identification Shazamio (https://github.com/shazamio/ShazamIO ) was only written in Python , else the C# will be preferred.