Audio streaming from real-time source

The idea here is to use audio coming from a VoIP session as the input parameter of an AudioSource component.

In that case, the players would have the feeling of the spatialized sound that Unity already provides instead of the mono sounds were are used to in chats.

To acquire this, there are two steps involved:

  1. Integrate a VoIP tool with Unity.
    One option that seems to do the work is the teamspeak3 SDK. I’m planning to have at max 4 players so in that case I can use the FREE version of the SDK without problems. I haven’t read much about the documentation to find out if it will be simple to write the plugin to use teampspeak and Unity though.

  2. update the audioClip on the AudioSource.
    This part is the one that worries me the most. I read that is possible to stream an audio file from an URL, using the WWW class, and start playing it even before it was fully downloaded. But what about streaming an audio file that is also being streamed? In this case, a VoIP chat.
    My first thought was to record the audio, keep saving it in very short-length files and then pass these files to the WWW.audioClip to be streamed. I haven’t tried this yet but I guess this approach would cause some non-desired delay. Not to mention that the WWW class requires the data to be in Ogg Vorbis format.

So, is it possible? If yes, any ideas on how to get this working?

PS: I’m still not sure if this topic fits better the External Tools section or the Unity Support of the forum.

Bump. Question is still relevant :slight_smile: