x


Audio lag/loop after weplayer gets focus again

Hi,

I encoutered a problem with the audio of a ogv video, focusing on a webplayer build: After loading and while playback an external ogv file I call the MovieTexture.Stop() method. Now the video

stopped and i don´t hear any audio...fine. After switching to my OS (Win) or another running application and

coming back to the webbrowser, you can listen to the problem, unity is perfoming a permanent audio loop, when

there should be silence.

To test my problem i set up a very simple test scene: Create a Plane, attach an audio source to it and also the following script:

private var intro: MovieTexture;
private var showIntro = false;
private var url_intro = "Intro_Video.ogv"; 

function Start(){
    // ----------   VIDEO   -------------- //

    // Start download
    if(!intro){
       var www:WWW;

       if ((Application.platform == RuntimePlatform.OSXWebPlayer) || (Application.platform == RuntimePlatform.WindowsWebPlayer)) {
         www = new WWW(Application.dataPath + "/video/" + url_intro);
       }
       else www = new WWW ("file://" + Application.dataPath + "/video/" + url_intro);

       // Make sure the movie is ready to start before we start playing
       intro = www.movie;
       while (!intro.isReadyToPlay)
       yield;

       // Assign clip to audio source
       audio.clip = intro.audioClip;
    }
    // Sync playback with audio
    if (intro && !intro.isPlaying){
       intro.Play();
       audio.Play();
    }
    showIntro = true;
}

function OnMouseUp () {
   intro.Stop();
}

make sure to position the plane in front of the camera so that you can click on it. make a webplayer build. create a subfolder called "video" and put some ogv in that folder. rename the ogv to

"Intro_Video.ogv" for success with loading the external file. with a click on the plane you stop the video (and audio).

Is it a bug or am I doing something wrong?

more ▼

asked May 30 '11 at 10:21 AM

Fabse gravatar image

Fabse
1 1 1 2

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

Thanks a lot for just not answering. I decided to post my problem here, because this place is called "unity anwers". Well... in fact i had to wait since may 30th... looking every week for an answer....until today i downloaded the new version. Without changing anythig it works now. So it was a bug and it is fixed now. Thanks again for no answer.

more ▼

answered Jul 27 '11 at 09:24 AM

Fabse gravatar image

Fabse
1 1 1 2

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x1060
x831
x304
x204
x65

asked: May 30 '11 at 10:21 AM

Seen: 950 times

Last Updated: Aug 02 '11 at 02:09 PM