We are all avid listeners of the latest music and are aware that many other teens also stay alert to the latest musical trends. We have also dealt with stress before and were able to use music to help us stay focused and relaxed. Through some research, we understood that music is simply a reflection of a teen's current emotions. We then decided to use a user's Spotify history in order to determine whether a teenager was in a state of depression or not. As we continued to research we stumbled upon musical therapy and saw that we could implement this and create a playlist for depressed teens specific to their genre and taste of music BUT in a happy and positive track that would pull them out of their state of depression.
What it does
It takes in a user's recently played music tracks and decodes the data in a Spotify track and teach our machine to determine whether a song was sad or happy. If the machine detects numerous sad tracks repeatedly being played, it will create a playlist full of songs specific to the user's style of music but rather than being sad and depressing, the playlist will be full of happy songs that will take the user out of his/her depression.
How we built it
We built it by first using the Spotify API in order to receive a user's recently played tracks. We then implemented a library by the name of spotipy in order to take the data from the API and add it into our machine-learning algorithm. We also created a machine-learning algorithm in Python which takes in a standard set of happy and sad songs and using them and their features (danceability, energy, key, loudness, mode, speechiness, acoustics, instrumentals, liveness, valence, tempo) decides whether the recently played tracks are sad or happy. As it detects numerous sad songs on a continued basis, the program will decide to create a playlist which will bring up the sad and depressed user.
Challenges we ran into
At first, we ran into numerous problems with not only the Spotify Web API but also spotipy installation in general. We had to spend quite a few hours just attempting to download code editors, and libraries. In addition, the wifi was very slow at the beginning so we had to wait quite a bit for our downloads to complete. After that our coding went smoothly until we tried to get recently played tracks. At first, we had issues with spotipy installation but after that we ran into some severe issues where spotipy would not detect our API id. After an hour of troubleshooting, we understood our mistakes and got it to start working.
Accomplishments that we're proud of
We are definitely proud of our algorithm as we never thought that we could actually do it as we did not have that much experience with machine-learning/AI. In addition, we are proud of accessing the Spotipy library and understanding how the spotify API works as it was very first at confusing and we spent numerous hours making it work.
What we learned
We definitely relearned Python as it had been a long time since we had used it. In addition, we also learned how machine-learning and AI work and the process that a Computer takes to replicate a human brain. To add on, we even learned how to use an API and how to use a Python library that didn't have much support. Furthermore, we also learned how to give effective presentations and speeches through our body language, our words, and even our slides.
What's next for Vibes Save Lives
Next, we plan on adding this into the actual Spotify app as a plugin or a background feature rather than just a external prototype. Also we plan on expanding usability so it is not restricted to just one user and everyone can use this. Last but not least, we also plan to make it more user-friendly so that everyone and use it AND understand it.