Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Video VideoPlayer using an AudioSource - changing volume has no effect?

Discussion in 'Audio & Video' started by jerotas, Jul 30, 2020.

  1. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,148
    Hi,

    I would like to hear everyone's opinion whether this is a bug or not. I think it is.

    If I use a VideoPlayer component and play its audio through an AudioSource, once it starts playing, any changes to the volume, spatial blend or pan of the Audio Source have no effect. Mute works. I would expect to be able to at least change the volume after it starts playing. It seems to use whatever the volume was when it started playing and it can't be updated or doesn't notice updates.

    Is this a bug? I will gladly file a bug if it is.
     
  2. DominiqueLrx

    DominiqueLrx

    Unity Technologies

    Joined:
    Dec 14, 2016
    Posts:
    214
    Hi!

    I just gave this a try in the editor (OSX, 2019.3.15f1), and manipulating the AudioSource's volume slider while the VideoPlayer is playing does change the volume. Can you give us more details about what you are doing? Are you changing the volume through scripting? In the editor or runtime? Any setting we should be aware of on the AudioSource? And what platform is this for?

    Sounds like a bug, but we need more info before knowing for sure.

    Dominique Leroux
    A/V developer at Unity
     
  3. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,148
    Sorry I figured it out last night. The main difference between what I was doing and what you are doing is likely that the game object my Audio Source is on is disabled. When it's disabled, then Audio still plays (which is weird) but changing the volume and spatial blend has no effect until you activate the game object. I was just clicking things on the Inspector, not through code, at runtime.

    Let me know if you think that's a bug or not. I can send you an example if you need.
     
  4. DominiqueLrx

    DominiqueLrx

    Unity Technologies

    Joined:
    Dec 14, 2016
    Posts:
    214
    Hi again!

    Glad you found an explanation and a solution to the problem. But it really is a bug that a disabled AudioSource would emit audio. So yes: please file a bug for this. It'll be easy to fix and makes perfect sense.

    Thanks a lot for bringing this to our attention!

    Dominique
     
  5. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,148
    Thanks, I made a new project and it still happens, so I submitted the bug.
    Here's a link the bug for anyone who cares.

    http://fogbugz.unity3d.com/default.asp?1268769_9e31qhg16gea9kca
     
  6. DominiqueLrx

    DominiqueLrx

    Unity Technologies

    Joined:
    Dec 14, 2016
    Posts:
    214
    jerotas likes this.
unityunity