I got drillstart, a sound of a drill warming up, then I got drillrepeat, the sound of the drill on full speed in repeat. About 15% of the time this code will make the audio jump, as in, I’ll hear the first little blip from drillStart, but then it will cut out, not play the whole drillStart sound and then start to play drillRepeat. So there is a gap inbetween these two sounds. How do I fix this?
I tried putting drillRepeat on a different gameobject with a different audiosource, thinking that maybe it wasnt switching the sound from drillstart to drillrepeat fast enough on a single audiosource, thus it was making the skip sound.
I also replaced the yield with a float timer, just to see
so I ended up with something like
var drillRepeatSound : GameObject;
var soundTimer : float = 0.0;
function Update()
{
if (soundTimer => audio.length)
{
drillSoundRepeat.audio.Play()
}
}
But it still has the EXACT same problem. So I tried turning off compression on all the sounds. Still the same problem.
Does anyone know whats going on here? This issue has me completely perplexed and I can’t have a game that has sound skipping issues.
Is there some other way I could go about implementing a warmup sound, then a repeat sound, then a fade out sound? Is the way I tried to do it the typical and proper way to do it?
BTW, I also tried compiling my project to windows standalone to see if it’d fix the issue, but no luck. But that also turned up another weird issue where, when exported to windows standalone some things would happen 10x as fast versus web build or in the unity player, anyone know whats up with that? Does Time.deltaTime go faster on windows standalone builds? Luckily this project is staying web build, but this worries me for future things when i might have to export windows standalone.
alright I fixed it by combing all my sounds into one file and then using audio.time to repeat over the middle portion of the audio.
Ive run into a slightly different issue though. I’m using a
audio.volume = collision.relativeVelocity.sqrMagnitude;
and all this seems to do is set the volume on my audio component to 1, the sqrMagnitude is printing out proper values. But it seems to just set my audio.volume to 1 no matter what value the sqrmagnitude is returning.