Looping wav creates gap between plays
Hi guys,
I'm looping a cranking sound (.wav file) that's roughly 1 second long. When I attach it to a GameObject as an audio source and check "play on awake" and "loop" the sound loops fine without any noticeable gaps. So there isn't anything wrong with the sound file.
The sound should only play when a crank is turning. This happens in the Raise() function, which is called every time a user presses a button:
public void Raise()
{
if (!crankSound.isPlaying)
{
crankSound.Play();
}
}
What am I doing wrong here? How do I get rid of the little gap between plays that my code creates, but isn't present using the inspector's loop checkbox?
Thanks!
Your answer
Follow this Question
Related Questions
Fix sound delay 6 Answers
Second AudioClip won't play 0 Answers
Some sounds won't play 0 Answers
Audio is way too soft on mobile but alright in Unity Editor! 0 Answers
AudioSource.Play plays every sound at once,AudioSource.Play Plays every source at once 0 Answers