I haven’t messed with audio too much in 2.1, but in the iPhone build I’ve attached a looping audio source to my robot for motor sounds. When the audio hits the loop point it hiccups for about 1/2 a second in both the editor and on the iPhone. Anyone got a work around for this? Seems like something simple that should work so maybe I’m forgetting something.
OK I guess I’ll submit a bug.
When you say “hiccup”, I’m assuming you mean it stops playing for that period of time and then resumes? Did you decompress this from an mp3, perchance? I’ve noticed that mp3 compression always puts a bit of silence at the end of the audio file, so if you extract your audio from that, you’ll probably need to edit the WAV and remove that bit.
Does turning on “Decompress on Load” in the settings change anything?
That setting doesn’t exist for the iPhone yet.
The silence at loop points has been an issue in Unity forever. Sometimes it’s there; sometimes it’s not. But it’s not just at those points that you need to worry about it, though:
http://forum.unity3d.com/viewtopic.php?t=11495&postdays=0&postorder=asc&start=15
That said, although I’ve found it more common to see this very short silence appear at loop points, the “half second” you mention may be another issue; I have heard longer delays in the restarting of loops, up to probably three seconds worth or more.
OK, I’ll try using a WAV and see what happens. I used MP3 since iPhone Unity won’t decompress Oggs automatically. I saw the other threads that suggested that the problem only happens with longer files so I shortened them and that didn’t solve the issue, so perhaps Brady is right. I’ll let you know if I solve it. In any case I submitted a bug with my project folder.
You may have imported an MP3, but Unity will not make a build with anything in the MP3 format, due to the possibility of having to pay license fees on that antiquated compression format. So what you actually used was an MP3 file converted into a PCM audio file.
MP3 Metadata (ID3 tags) sometimes manifests itself as extra silence when recompressing, so unless you only have MP3 audio to begin with, you gain no benefit from importing it into Unity that way (aside from saving space in the project folder itself), and you run the risk of dealing with this headache.
Yea, that was it, my files ended up with ~0.15-0.2 seconds of extra time versus using a WAV directly.
I don’t get a hicup. As far as their being a pause but when it loads the music it kinda plays 0.1 secs of the beginning and repeats it a few times I guess while its loading.
Also I don’t know if this has been covered. Can we only use uncompressed music because a 30s loop at decent quality is about 7 megs.
My game is 4 megs without music and I want to keep it under 10!
When I build with ogg its not supported on the iphone platform. Thanks in advanced sorry for the mini high jack but its audio related.
I discovered yesterday that I can only play one instance of a compressed sound at a time on the iPhone. This does not let me use my old approach of starting an AudioClip with PlayOneShot() before the clip is finished. So, I’ve reverted to my original approach, which is to cut the tail off of the loop, and paste it back at the beginning. This makes the beginning weird, but for my current game, it doesn’t matter.
So, I’ve got these perfectly looping files in Logic and Soundtrack. However, neither iTunes, Quicktime, nor Unity can play them back without a stutter. It doesn’t matter if I’m using AIFF or the 128 kbps .m4a (AAC) files I want to use for my game.
Anybody have any ideas?
I have the same bug with Unity iPhone.
I can’t use a looped thrust-sound for my gameobject because the loop will be paused end of sound for 1/2 seconds.
I’ve try it with mp3,wav format. The loop sound is OK. I have some loops sounds here but same problem. (len 2-3 seconds)
it is not possible with unity iPhone to make a clear loop sound without hiccup ?
Don’t use compressed sound for sound effects. Compressed sound is intended for things like background music.
–Eric
the loop sound is uncompressed. (checked in import settings)
and the wav file is 16 bit PCM audio.
Realmaze3D uses seamlessly looping sounds for background ambient noise. They are uncompressed .wav files, and the sound files consist of only the loops. If you’re trying to set loop points, that doesn’t work.
–Eric
that is funny. I have now build the game and on iPod 3.0 it works fine. Only in unity editor are the loop problems present.
Yep. Aside from compressed audio loop delay, Unity games on the iPhone sound better than they do on PCs or Macs. I have no idea why this is, but it’s lovely not to hear the crackling and distortion I have become used to over the past couple years with Unity.
As for loop problems in the Editor, Søren apparently fixed that, but I don’t know if said fix is coming to Unity iPhone any time soon.
LOlx
having this same issue, except using wav hasnt changed a thing.