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. Dismiss Notice

audio.loop Whats Up With That??

Discussion in 'Editor & General Support' started by renman3000, Apr 7, 2014.

  1. renman3000

    renman3000

    Joined:
    Nov 7, 2011
    Posts:
    6,680
    In two years, I don't think I have made a single complaint about Unity, but the audio looping. WTF world??!!!

    I mean come on!!! Every time I attempt to loop an audio file, it does NOT LOOP properly.


    Please can some one give me some type of repsonse that will eliviate this nightmarish situation???
     
  2. Hikiko66

    Hikiko66

    Joined:
    May 5, 2013
    Posts:
    1,300
    You're doing it wrong

    That's ambiguous
     
    Last edited: Apr 7, 2014
  3. BlakeGillman

    BlakeGillman

    Joined:
    Dec 7, 2013
    Posts:
    412
    I will explain it in simple steps (Not to be rude, but just to be helpful :)

    1) Important audio file
    2) Drag audio to camera It should then create an audio source component
    3) Under the attached Audio Source component, if you want to play as soon as that camera becomes active, select "Play on awake"
    4) Make sure the "Loop" checkbox is selected, this will then automatically replay the audio file when it has reached the end of its course, if you have an audio file that does not loop properly at the end, that is not unity's fault but the audio file itself is not 'seamless' so to speak. Try googling "How to make a good looping audio file". That will give you some tips on making sure the end and start are the same, so when it starts over, its as if it never stopped.
     
  4. DanielQuick

    DanielQuick

    Joined:
    Dec 31, 2010
    Posts:
    3,137
    Also, if the audio is compressed you have another checkbox "Gapless looping" in the AudioClip import settings.
     
  5. Hikiko66

    Hikiko66

    Joined:
    May 5, 2013
    Posts:
    1,300
    Might also want to check that the Audiosettings and your imported audio are of the same Hz
    I don't know if that has an effect on the internal implementation of looping, but it changes the length of the file because it plays back at a different speed
     
  6. renman3000

    renman3000

    Joined:
    Nov 7, 2011
    Posts:
    6,680

    Thanks all,
    the issue may have been above. I was importing loops as mp3's. This is fine for one shot sounds but bad for loops apparently. As such, when I import the file as an AIF at 44.1K its fine.


    Oh thank god.
    Cheers!