Audio streaming just like video ?

Hi all :smile:

I’m currently having some hard time with server things and UnityWebRequest obfuscated features :stuck_out_tongue:

Lemme explain.
In my app i need to play videos and audios files.
Those files are on my server.

Say my video files are 60MB and my audio files are 30MB ( both are pretty big ).

In my app, when using the videoplayer with an URL, everything works like a charm !
I mean:
The app connects right away to the server, launches the load and the vid starts playing almost immediately. If the user decides to skip this video, only the viewed part ( say 1MB ) has been grabbed from the net, and basta !

This is just perfect and exactly what i want !!!

Now i want to play audios JUST LIKE THE SAME WAY !:
The app connects to the server, the server says “yup”, and the play starts immediately.

And here’s my problem !
U3D downloads the entire audio file and only starts to play it at end !
Not saying that 30MB is huge, it is far too big for people who want to skip the playing at 2,5 sec^^

I believe most will consider this absolutely stupid ( that U3D is able to stream videos and not audio ) but am not sure ( i prefer to say, i’m almost sure ) of the server-side limits.

My belief is that apache and other servers are coded to shrink big videos in smaller chunks just to behave in a non-stupid-way but are not coded to do the same with MP3 files wich use to be much smaller…
am i wrong ?

So my question is very simple :slight_smile: and lays in the title:
Though it’s not really streaming ( as streaming streams are virtually infinite ) is there a way in unity to stream audio from a server, just like it is done for videos ?

Thanks a lot for you answers and happy unitying !

I finally got this working ( tries and redo of strange things: wait here, check error there, etc… U3D doc is particularly shitty and obfuscated on the audio-from-web topic ).

But strangely i sometimes got an FMOD error unable to seek… :eyes:

anybody knows what is this FMOD ???

ooookay… :rage:
After a whole day wondering and searching why my audioclip buffer is 38million of seconds… i just discovered that U3D is unable to handle OGGVORBIS audio length properly !!!

It seems obvious that many things in audioclip exist in U3D without having been tested.

I have to convert my audios to MP3 and everything works properly.

Maybe one day in U3D release notes well see an update saying:
<< we decided to become serious devs… >>

happy unitying !