Streaming MP3 music player

In our 3d chat world, and I'd like to add music streaming to the chatrooms

ie - the chatroom host can enter in a URL of a streaming MP3 and then everyone in the chatroom hears that stream - the music files are not stored on our servers, but just browser client to another URL

As this can't be done in Unity directly, any suggestions for a embeddable music player that can play an MP3 stream?


have you tried to build "assets/prefabs" that includes MP3 files and then store them as unityPackages on the webserver?

Then you could make some sort of "UnityJukeBox". its not real streaming, I know, but its loadable.

Another idea would be to build on the Socket stream, and then build up waves you could place inside a buffer. But I dont know if you can write to audiobuffer data or you only can read it.

Lastly, a c# plugin might be what you need for the job. This might require a Unity PRO license. I dont know.

Checkout Asset
uAudio - MP3 Player

It plays mp3 files and also handles web audio streams.

It currently works for Windows and Android but I will add the other platform.

I realize this question’s a bit old, but I do have the answer. You can use the NAudio library to stream and MP3 from a URL. Then, you must take buffers from the stream and use the OnAudioFilterRead() function to “inject” the audio data. It’s jury rigged, but it works like a charm.

not sure this was available at the time of the original post.
Anyway, I guess it does what you want.