- Home /
Streaming audio from ffmpeg RTP into Unity
I currently have a Pi setup that is streaming using ffmpeg, and I want to get this audio to play through unity. Is this possible?
I am trying to follow something like this:
#pragma strict
var url = "rtp://(xxx.xxx.x.x:xxxx)";
function Start () {
var www : WWW = new WWW (url);
audio.clip = www.GetAudioClip(false,true);
}
function Update () {
if(!audio.isPlaying && audio.clip.isReadyToPlay)
audio.Play();
}
But it also says that: Assets/Audio.js(6,6): BCE0144: 'UnityEngine.Component.audio' is obsolete. Property audio has been deprecated. Use GetComponent() instead. (UnityUpgradable)
What would I need to change to get a stream of something like this to work? Any help or suggestions are appreciated.
Comment