Search Unity

Question Why does PlayOneShot allow volume above 1?

Discussion in 'Audio & Video' started by nalex66, Feb 7, 2024.

  1. nalex66

    nalex66

    Joined:
    Aug 26, 2022
    Posts:
    54
    This has been causing me a great deal of confusion. Everything I read in the documentation says that the volume goes from 0 to 1, and no louder. However, if I put a number above 1 for the volume in a PlayOneShot call, it gets louder. I've tested at 3, 10, 100, and it keeps getting progressively louder at values above 1.

    I don't have an audio mixer in my project, just a regular audio source using 3D spacial audio (its volume is already set to 1).

    The only thing that I can think of is that this is a VR game I'm making, and maybe the XR components include some sort of hidden audio mixer that is making this possible? I haven't added an audio spacializer plugin, and the documentation says that there isn't a default one included in the XR Interaction Kit.

    Can anyone enlighten me as to why volume is able to go above 1 in my project?
     
  2. Alex-Baldwin

    Alex-Baldwin

    Unity Technologies

    Joined:
    Apr 18, 2023
    Posts:
    2
    This is possibly a bug, I am not sure if this is deliberate behavior however. At the very least the documentation is lacking for this particular case. Thanks for bringing it up, I have a filed a bug report for us to look at it.
     
  3. nalex66

    nalex66

    Joined:
    Aug 26, 2022
    Posts:
    54
    Thanks for the reply! I'm not complaining, mind you--it feels like intended behaviour that's undocumented, and I do find it useful for some sounds that aren't loud enough in the source recording. It just keeps bothering me when I start to rely on it, because everything says that it shouldn't work.