I recently went Karaoke with my friends and was inspired to create my own mini karaoke app. The first thought I had was how can I remove the lead vocal from a song. After doing a bit of research I've found that a crude way to achieve this is by taking a stereo mixed audio invert one channel and the vocal will phase cancel. The theory behind this is that usually a song will have the vocal front and center in the acoustic space thus the left and right channel are identical, thus combining the two channel with one inverted should cancel out the vocal
There are multiple limitation to this method. One of which is that it assumes the vocal to be centered and that the audio is stereo, the algoirthm also removes anything that is centered within the acoustic space not just vocals.
Also while doing a research I've found a pretty cool web app called Vocal Remover that does what I wanted using AI + a lot more feature. I would highly recommend using that app if you want to achieve what my toy app tries to do.
NOTE: because my server is very small (hosting on digital ocean on 2 gb of ram) this app will likely run into a 502 error since this takes a lot of memory to run. If you are interested in testing this out the code to do this can be found here