- Home /
AudioSource.PlayDelayed() bug
I've been using AudioSource.PlayDelayed() in order to ensure that the audio starts at the exact time I need it to, and have found that sometimes it plays a small bit of the audio when the function is called.
Is this a bug or is there something I'm missing? I haven't tried it yet, but would just setting the volume of the AudioSource to zero and then back up later be a good workaround?
I'm having the same exact issue. Have you found a fix for this or are you still just adjusting the volumes?
have you tried creating your own wrapper functions?
I've think I found that this happens because there's a CPU spike or something, not quite sure why it still happens but I believe it just has something to do with the current CPU load.
I haven't actually done anything to try and fix it yet (as it's not that bad of a problem), but I was just posting this to see if there was a way to fix it when it comes time for me to actually fix it.
In my case, what's happening is that I switch to a new scene, start loading my audio (there are multiple clips, I stream them), and whenever it happens it happens before the scene even changes over to show the new one.
I have this same bug too.. its on AUdioSource.play and AudioSource.playdelayed... frustrating :(
Answer by Craftnime · Aug 27, 2015 at 06:09 AM
yield WaitForSeconds(AmountOfTime);
AudioSource.Play();
If you want an Audio source to start after a certain amount of time, use the above. HOWEVER, this will NOT work in Update().
Your answer
![](https://koobas.hobune.stream/wayback/20220611234230im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
What does the numSamples parameter in GetOutputData actually mean? 1 Answer
AudioClips automatically fastforwarding at beginning of scenes 0 Answers
audiosources not playing after object destruction 0 Answers
Add animation for volume of BGM audiosource 0 Answers
Audio Clip duration not getting updated 0 Answers