Sound plays even though Play On Awake is unticked
Asked Answered
K

4

0

Hi guys,

I have a weird problem where a newly added sound plays at the start of the game even though Play On Awake ☐ is unticked.

Also I added a line in the Start()-method in my script audioSystem.sound.Stop() if that would help, but no such luck.
Google didn’t help with this issue, or maybe I didn’t use the right search terms.

Can anyone help me?

Knitwear answered 26/1 at 17:21 Comment(3)

Is this happening on the device or in the editor as well? I've seen a bug like this on ipads that I've yet to figure out.

Erasmo

I haven't tested on the device yet, but the web player build has the same problem.

Knitwear

Hi there, does anybody know an efficient fix for this?

Nauru
D
0
  1. Make sure there are no other instances of the object in the scene.
  2. Check to see if the object is enabled (ticked) at runtime.
  3. Comment out all audioSystem.sound.Play() in your scripts, then enable the one by one to see if a function with .Play() inside is being called prematurely.

Sorry for the vague answers, it’s all I got with the information provided. Good luck :slight_smile:

Dutiable answered 26/1 at 17:22 Comment(1)

I triple checked - there are no other instances of the object in the scene. I'm not sure what you mean by ticked at runtime.. When running the game the "sound.enabled = true". If I make it "false" in the Start()-function it doesn't stop the sound from playing. Commenting out all the sound.Play() lines in the game doesn't stop the sound from playing. Thanks for your answer!

Knitwear
K
0

Well finally I got rid of the sound playing at the start. I just removed the sound file from the project and re-added it. Some kind of weird bug was going on there. Thanks for your help, guys :slight_smile:

Knitwear answered 6/6, 2023 at 2:41 Comment(1)

I agree with this. Bug is still in unity 5

Phenacite
P
0

I know, this is an old Thread, but I have the same issue in my Project (Unity-2018-2), re-adding the Audio-clip did not solve the problem for me. The audiosource.Play() function is only called when a UI button is clicked, which is not the case at start of the game. If I disable the audio source the sound does not play, so its that audio source which gets triggered at start. Any ideas?

Pascoe answered 26/1 at 17:22 Comment(1)

Solved it but not in a very clean way. disabled Audiosource on Awake and invoke an enable function with a delay of 0.15f. Works, but is not the best way. I hope somebody come up with a cleaner way to solve it.

Pascoe
P
0

not sure why, but found a fix by removing the audio source, changing the file name, and then adding it back. I think it might be caused by some invisible object playing the clip.

Phosphorate answered 26/1 at 10:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.