Playing audio files from folder

Hello, Im trying to create a “custom” music folder in my game. The idea is that every player can put there his own music and hear it during the game.

What i’ve done so far is to read the folder files.

But i cant find the way to “attach” the files to an audio clip. I´ve been readding trying to find the audio clip propertie that references to the audio file, but i dont know if im too dumb or if this is not the way to do it.

How can i do this?. Any object propertie that i somehow missed?.

Thanks in advance.

The easiest way is with WWW which also lets you use local files, but only .ogg files are supported.

So it´s easy but not practical, because ogg it´s not a format that most of the people use for their songs.

Any other idea?.

Thanks in advance.

ogg or wav will be it anyway, because unity only supports ogg and wav, you can’t play anything else on desktop. (other stuff you drop in is converted)
Independent on if you want or not or if you use WWW or not …

any other format requires standalone targeting, pro and a plugin.

other formats like mp3 require you to buy a multi thousand USD license per title to be allowed to play it back, thats why many engines dropped it long ago for any non-mobile platform (mobiles don’t need it as the hw maker pays the license for the device)