I am new to gamedev and unity. And I have a rocket sound for my space ship which is pretty short. I have it so that it only play's when pressing down space but when you hold it long enough for the audio to play again (only a few seconds) it leaves a small gap in the middle and doesn't sound very good. I have looked online but nothing has worked yet. Thanks
Small gap in Audio looping
Download and run Audacity then drag in the sound file. Make sure there is no silence at the start or end. You can mouse select a small section, press delete, and save to remove the silence. Make a backup first.
If that's not it, maybe your not caching the sound into memory, or you're constantly reloading the sound.
🙂🙂🙂🙂🙂<←The tone posse, ready for action.
So yep, firstly check with some other software your sound file does loop correctly. If its just from a recording you took it will probably need some editing to get the ends to line up exactly.
Also how are you actually playing the sounds?
If you are waiting for the sound to be finished before then playing it again, then yes will likely get a gap, since your code to play again is not going to be instant. So generally you need to be telling your audio system you want this sound/buffer to loop in advance, so the audio system can make sure it does seamlessly.