- Home /
Problem playing audio for streaming video
Hi All,
I seem to be encountering a wierd issue when trying to stream videos from VLC.
using UnityEngine;
using System.Collections;
public class testScript : MonoBehaviour {
private WWW wwwData;
private string url = "http://localhost:8081/test.ogg";
private MovieTexture movieObj;
private AudioClip audioObj;
IEnumerator Start() {
wwwData = new WWW(url);
yield return new WaitForSeconds(2.0f);
movieObj = wwwData.movie;
audioObj = movieObj.audioClip;
renderer.material.mainTexture = movieObj;
audio.clip = movieObj.audioClip;
movieObj.Play();
audio.Play();
}
}
Based on the above code, I can only hear the music, but the video stops on the first frame and the entire unity lags. If i comment out the audio.Play() at the end, the video plays fine without any sound. I have tried checking "movie.isReadyToPlay", but it always returns false. Anyone have any idea whats going on ?
This script was tested by attaching it to a plane in a new/empty scene. Changing the start to a normal void function and removing the 2 seconds wait makes no difference as well. VLC is streaming a Ogg container with Theora and Vorbis codecs via HTTP.
Your answer
Follow this Question
Related Questions
Black MovieTexture with Audio streaming on Mac? -1 Answers
WWW in Editor getting request with null attributes 1 Answer
Splash videos on android and iOS? 0 Answers
WWW.movie never get ready to play ? 0 Answers
3D->2D sound in MovieTexture 0 Answers