Search Unity

Resolved Audio glitches with script activation

Discussion in 'Scripting' started by JhonnyRage, Nov 10, 2020.

  1. JhonnyRage

    JhonnyRage

    Joined:
    Feb 23, 2017
    Posts:
    57
    i got a video that shows what is going on(ignore everything, the important thing is the audio xd)




    So... how i fix this?

    here is the code of the cinematic part that controls the audio
    Code (CSharp):
    1.    IEnumerator MiniCinematica()
    2.     {
    3.         yield return new WaitForSecondsRealtime(5);
    4.         CamCine.SetActive(true);
    5.         WhaleSFX.PlayOneShot(Whale, 0.7f);
    6.         while (WhaleSFX.isPlaying)
    7.         {
    8.             yield return null;
    9.         }
    10.         WhaleSFX.Stop();
    11.         finished = true;
    12.  
    13.  
    14.     }
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,745
    Sounds kinda like clipping... what does it sound like when you click on the clip in the import window in Unity? What does it sound like if you set the volume to 0.1f (or at least a LOT lower) on the playback source?
     
    JhonnyRage likes this.
  3. JhonnyRage

    JhonnyRage

    Joined:
    Feb 23, 2017
    Posts:
    57
    good afternoon, the audio seems correct, at least sounds right when i play from the import window, if i play that audio at 0.1f sounds nothing...
     
  4. JhonnyRage

    JhonnyRage

    Joined:
    Feb 23, 2017
    Posts:
    57
    Solved xd idk how but it has been solved, the saint spirit did a miracle...
    think it could be a unity bug or a .wav error...