Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Playing ogg files as reaction to onmousedown (webplayer prob

Discussion in 'Editor & General Support' started by EducaSoft, Sep 13, 2007.

  1. EducaSoft

    EducaSoft

    Joined:
    Sep 9, 2007
    Posts:
    650
    Hi

    I made a little scene with in it a sphere.
    That sphere has a spherecollider atached to it and also the following script

    var geluidje:AudioClip;

    function OnMouseDown() {
    audio.clip = geluidje;
    audio.volume=1;
    audio.Play ();
    }

    In the inspector I dragged a .OGG file (mono) to the variabele geluidje.

    So thats the setup. Now what happens.

    1) If I try this in a mac webplayer, I hear a sound on every mouseclick on that sphere

    2) If I try this in a win webplayer, I only hear the sound 1 time (after the first click) and after that its finished.

    3) If I drag a WAV file to the variabele geluidje, then I get it working under both mac and win webplayer.


    A clever person would tell me then : "We'll , use wav and you are ok"

    But...

    The wav file is 80Kb
    The ogg file is 8 Kb

    I plan on using 200+ such files in my program. Can you see the huge difference in filesize?


    Could this be a webplayer bug somehow? Any workarounds to it?


    Kind regards,

    Bart