Inspiration

Now more than ever we find ourselves in Discord calls with friends. Sure you can play music in the background for everyone to enjoy, but if you can't sing together like Karaoke where's the fun in that? That was the problem we wanted to solve, to have a fun and competitive Karaoke feature in Discord!

What it does

KaraokeBot takes a song and artist name and then plays that song. It then detects if you speaking/singing and starts recording. From there it calculates the accuracy of your vocal pitch and lyrical accuracy with that of the song and artist. Once complete, you will be given a score that you can compare with friends to see who is the most talented!

~start: Queues your song input for karaoke! Format:~play~artist~song Ex. ~play~BLACKPINK~Whistle'
~stop: Stops recording your song to calculate your karaoke score!
~exit: Removes karaoke bot from the voice channel \n :(', inline: false}, )
~shutdown: Shutdown bot from the server.
~help: List of available commands

How we built it

We used Python and JavaScript to program the bot and make everything run smoothly. Python was used to handle all the analysis of music, speech, and accuracy. JavaScript was used to handle the frontend of the bot and how it reacts to given commands as well as data collection and handling. The full list of API's and libraries are:

Python

  • Aubio
  • Numpy
  • SpeechRecognition
  • Numpy
  • Pydub
  • Pydub Utils
  • LyricsGenius
  • Wave
  • Azure

JavaScript

  • Node.js
  • PythonShell
  • Discord.js

Challenges we ran into

  • Recording users in a discord voice channel was not supported in the Python version of the discord library, so all of our code created until that point needed to be ported to JavaScript in order to utilize the discord.js library
  • All of our analysis was done in Python files, so we struggled to link node.js and Python together and return values to be sent back to the bot
  • A lot of the libraries used in this bot are more obscure and don't have a sufficient amount of documentation/examples behind them, which meant a lot of learning and guess and checking to ensure that what we were doing was right

Accomplishments that we're proud of

We're happy to see that what we imagined at the start of the hackathon is now a reality! We've had some fun testing it and after the hackathon, we're looking to forward to making some final changes and adding it to our personal discord servers to share with our friends!

What we learned

For some of us, this was the first time that we have created a discord bot which is super exciting! For all of us, this is the first time we have created a bot in Javascript, which has given us an opportunity to start learning a new language that we don't much have much experience with!

What's next for KaraokeBot

Our bot currently uses a simpler formulation to complete analysis, but in the future we want to use regression analysis, ANOVA or other analytical methods to complete analysis and output a better response to the user. We could also use some type of machine learning approach if it is viable! In addition, data is currently stored locally so storing data into a database and creating a leaderboard for the best singers in the discord server would be ideal.

Our bot currently works with one user and the music bot at one time, but we hope to add functionality for every user that is inside the discord server, and create a 'versus' mode system for each song, to determine the best singer in the group!

Built With

+ 12 more
Share this project:

Updates