How A 15 Year Old Created A Music Recognition Service In Less Than A Day With ACRCloud

My name is Shiraz McClennon, and I’m a 15 year old student from England. I have always been passionate about programming, and I love turning my ideas into a reality.

On Saturday 4th December 2019, I had the idea to create a service similar to Shazam in the form of a Telegram bot that would identify music in both audio and video files

My first hurdle was finding an API that would allow me to send audio files and give me a response back with the music information corresponding to the file. I quickly found out that music identification applications such as Shazam did not provide a public developer API for music identification, and music fingerprinting Python libraries required you to have your own fingerprint database.

After searching, I stumbled across ACRCloud. They claimed to offer “one of the world’s largest music fingerprint databases”, which was exactly what I was looking for.

I immediately created an account, downloaded their Python SDK, and began familiarising myself with their API. This was a breeze, as they provided an example JSON response from their API.

  • First I created an AVR (Audio & Video Recognition) project within the ACRCloud console (as that was the service I required for my Telegram bot).
  • Then I copied an ACRCloud Python SDK code snippet from their GitHub, and filled in the details given to me when I created my AVR project.
  • Finally, all I had to do was handle the JSON response.

 ACRCloud provides the track duration in milliseconds, so I created a small function that converts milliseconds into a minutes:seconds format (90000 = 1:30). I was able to directly pull basic information such as track name, main artist, album name and release date without any conversion.

Occasionally my code would break. I discovered that this was due to the fact that not every song is available on third party services such as YouTube, Spotify and Deezer, and when ACRCloud does not have the external metadata for these services (for example when it doesn’t exist), my bot would raise an exception. I overcame this small hurdle by adding an exception catch for all of my external metadata requests, and appending them to a string only if they existed.

I didn’t encounter a single issue with ACRCloud while testing my bot, and their 14 days free trial allowing you to thoroughly experience their service and get everything working before you even consider purchasing the service. Prior to using ACRCloud, I tried another service that, unknown to me at the time, limited your free requests to 300, which I found inadequate for testing, especially when combined with the fact that they did not have very clear documentation or sample code.

One aspect of the ACRCloud API that I really appreciated was that accessing metadata across different ACRCloud supported services have consistent JSON keys. For example the third party services that provide the track name use the JSON key (as shown below):

“external_metadata”: {“third-party-service”: {“track”: {“name”}}}

ACRCloud have created a seamless developer experience that “just works”, and I only spent a small portion of my day working with their API and SDK, as it was so easy to pick up and use. The ACRCloud developer console is user friendly, and they have very clear documentation and sample code which makes the developer experience significantly more streamlined and enjoyable.

It is worth noting that my Telegram bot was programmed with 100% pre-installed Python3 libraries with the two only library exceptions being “python-telegram-bot” and “acrcloud_sdk_python”. ACRCloud has an inexhaustible supply of features which could be used to their maximum capacity if desired, and there is still so much more JSON data that I anticipate using in the future. My Telegram bot was simply an idea that I wanted to make a reality, which enabled me to stumble upon one of my favourite developer friendly companies so far.

My experience developing with ACRCloud has truly been an easy, fun and enjoyable one.

If you’re interested in viewing my Telegram Bot’s code (developed by myself, a 15 year old, in less than a day), or would like to try out for yourself what a music recognition service powered by ACRCloud looks like, you can do so here: https://github.com/smcclennon/SongID

I hope this information has been insightful into the utility of ACRCloud, and informs your decision to use it.

Share