shazamio / ShazamIO

🎵 Is a free asynchronous library from reverse engineered Shazam API written in Python 3.8+ with asyncio and aiohttp.
MIT License
521 stars 76 forks source link

Fix hang when recognize_song feed with less than 8ms sound #31

Closed Dronablo closed 2 years ago

Dronablo commented 2 years ago

If we try to pass less than 128 samples of audio to recognize_song(), it will stuck forever. This PR changes this behavior: it will return empty result immediately, assuming that it is impossible to find something recognizable in such a little audio sample.

dotX12 commented 2 years ago

@Dronablo, Thanks for your input! I accept :) Now I will make a new release.

dotX12 commented 2 years ago

Released: https://github.com/dotX12/ShazamIO/releases/tag/0.2.2.0

Dronablo commented 2 years ago

Well, I have little bit more to contribute ;). Code will be ready in a copy of days.