Search Unity

Sound issues AGAIN!

Discussion in 'Editor & General Support' started by Kilrath81, Jul 13, 2014.

  1. Kilrath81

    Kilrath81

    Joined:
    Nov 19, 2013
    Posts:
    153
    I had severely delayed sound for some reason which i fixed with setting the sound to 2D last time... Now it doesnt work AGAIN! I have a game object attached to my camera that has an audio source on it. That audio sorce has a script that has a single function.

    Code (JavaScript):
    1. #pragma strict
    2. public var bloodSound : AudioClip;
    3. public var waterSound : AudioClip;
    4.  
    5. function playSound (sound : String)
    6. {
    7.     if (sound == "blood")
    8.         audio.clip = bloodSound;
    9.     else if (sound == "water")
    10.         audio.clip = waterSound;
    11.     else
    12.         Debug.Log("No sound error");
    13.        
    14.     Debug.Log("Playing Death Sound");
    15.     audio.Play();
    16. }
    The debug plays INSTANTLY upon death. The sound if it plays at all, can play anywhere from instantly to a whole second later. There is no empty space before the sound. This function is called ONLY ONCE so it isnt like its getting repeated over and over and eventually plays...

    http://puu.sh/a8Nfg/96cba46921.png
     
  2. Kilrath81

    Kilrath81

    Joined:
    Nov 19, 2013
    Posts:
    153
    tried sound priority 0 still no go. Tried Default, Best Latency and Best Performance in audio settings, no difference. As a matter of fact all sounds are partially delayed, when set any sound to play it can be instant or delayed. Doesnt matter if it is a sound that is play on awake or called from script.
     
    Last edited: Jul 13, 2014
  3. Kilrath81

    Kilrath81

    Joined:
    Nov 19, 2013
    Posts:
    153
    AAAAAND i tried native wave and load into memory,,, no difference still a random sound delay on play. And PlayOneShot() Does no better.
     
  4. gregzo

    gregzo

    Joined:
    Dec 17, 2011
    Posts:
    795
    Try G-Audio for 2D audio, you'll be a happy camper ;)

    Seriously, G-Audio does it's own mixing. For 2D stuff, it will save you lots of headaches: no AudioSource, no problem.

    Cheers,

    Gregzo
     
  5. Kilrath81

    Kilrath81

    Joined:
    Nov 19, 2013
    Posts:
    153
    Wish i could, cant afford a 5 dollar add on right now let alone a 60 dollar one.