- Home /
Question by
sumpfkraut · Oct 08, 2013 at 09:32 AM ·
audiostreamfalloff
Audio falloff from movie stream
I neeed help with a Movie-Stream (ogg-file) in a web-player. It works fine, but the Audio have no falloff. I found old simillar questions here, but no solution.
I have only one Audio-listener (Camera) in my Scene.
Here is the script: #pragma strict
@script RequireComponent(typeof(AudioSource))
public var moviePfad : String;
public var audioMaxDistance : float = 50;
public var loop : boolean = true;
private var movieTexture : MovieTexture;
protected var streamReady : boolean = false;
function Start ()
{
StartCoroutine(StartStream(moviePfad));
}
function StartStream (url:String)
{
var videoStreamer : WWW = new WWW (url);
movieTexture = videoStreamer.movie;
audio.clip = movieTexture.audioClip;
while (!movieTexture.isReadyToPlay) {
yield;
}
audio.rolloffMode = AudioRolloffMode.Linear;
audio.minDistance=1;
audio.maxDistance=audioMaxDistance;
//audio.dopplerLevel = 0;
//audio.panLevel = 1;
audio.loop = loop;
audio.Play ();
movieTexture.loop = loop;
movieTexture.Play ();
streamReady = true;
}
function Update () {
if (streamReady) {
renderer.material.mainTexture = movieTexture;
}
}
Comment
Your answer
Follow this Question
Related Questions
What effect does "Stream from disc" have on an audio file for an iOS or Android App? 1 Answer
Endless Audio streaming (Radio)?! 3 Answers
Movie texture audio: no falloff 3 Answers
using NAudio library with Android to play Icecast stream 0 Answers
Stream from disc audio file, doesn't work on iPad1? 0 Answers