It's illegal to use copyrighted music on free music game?

I have a music visualizer made in unity and i have worked on a database of songs that i manually update but i was wondering if it’s illegal to release the visualizer with this copyright and royalty free music database integrated.
I actually made this database because it’s difficult to download songs and convert them to ogg and then upload them somewhere for just listening to them once.
Also sorry for my bad english.

If the songs were made by someone else and are not in the public domain you need their permission to redistribute them either by written consent or in the form of a free, open-source type of license. So yes, it would be illegal unfortunately.

well you can have the players add the music themselves (but not publically) to avoid the copyright. for example - you can have a “add music” button, which opens the dialog box to choose the song, but it doesn’t add in the database

Just googled how the populair Facebook game songpop does it: https://www.quora.com/Do-name-that-tune-apps-like-SongPop-license-their-music . So yes, it’s highly illigal. You’ll have to purchase a license to do it.