UnityPlugin-AVProVideo
UnityPlugin-AVProVideo copied to clipboard
[macOS] Switching audio tracks causes volume adjustment to stop working with audio mixer
Unity version
2022.3.54f1
Unity editor platform
macOS
AVPro Video edition
Trial
AVPro Video version
3.2.6
Device hardware
Max Studio (2022) 32 GB RAM, M1 Max
Which macOS version are you using?
Sonoma 14.7.4
Texture format
BGRA
Audio output
Unity
Any other Media Player component configuration required to reproduce the issue.
No response
Which output component(s) are you using?
Display uGUI
Any other component configuration required to reproduce the issue.
No response
The issue
I'm using AudioMixer to control volume of different audio groups in my application. I'm changing volume by adjusting AudioMixer's Master group volume. When switching audio tracks on macOS, volume logic breaks: adjusting mixer's volume has no effect and new audio track plays on maximum volume (since volume of 1 is the default value of MediaPlayer component). When switching back to original audio track volume controls start working again. It looks like AudioOutput component is being ignored after audio track was changed. I found out that function RequestAudio in AudioOutputManager class may be the problem: the condition if (instance.isPcmDataReady) is never true after I switch audio tracks and sets back to true only after original audio track is chosen. It seems that GrabAudio function returns false by some reason. Scene: Demo_MediaPlayer
Here's modified code from demo project: https://pastebin.com/zNY0XjtR
Media information
No response
Log output