RenderHeads / UnityPlugin-AVProVideo

AVPro Video is a multi-platform Unity plugin for advanced video playback
https://www.renderheads.com/products/avpro-video/
224 stars 27 forks source link

Audio Output Mode "Unity" Has No Effect in Unity Editor (macOS) #1813

Closed MisutaaAsriel closed 3 hours ago

MisutaaAsriel commented 2 months ago

Issue

When trying to use Unity AudioSources as the primary output in testing, on macOS, Audio is instead output to System, bypassing linked AudioSources, irregardless of the fact PlatformOptionsMacOSX.audioMode == AudioMode.Unity.

Environment

 

Reproduction

  1. Set audio mode to Unity (in this case, handled by Architech's VPS)
  2. Set AVPro video player to output to a Unity AudioSource
  3. Open media in Play Mode

Result: Audio bypasses Audio Source, Audio Mixer, and Unity audio system, outputting directly to system as if AudioMode.System was chosen.

MisutaaAsriel commented 2 months ago

I will note I got it to play to Unity audio once somehow, by changing nothing and entering play mode a second time, but I have not been able to reproduce and the error has continued. 🙃

Chris-RH commented 2 months ago

Is this reproducible using a new project and AVPro Video mediaplayer demo?

MisutaaAsriel commented 2 months ago

Is this reproducible using a new project and AVPro Video mediaplayer demo?

100%. In fact, I found the behaviour even more strange, and it is something I have noticed recently in my original project too, so this test allowed me to confirm it wasn't a fluke and narrow down the behavior:

The audio will output to Unity on the first execution of Play Mode after a Unity Editor session has started, during the first playthrough of a media source during said session, only. On subsequent play-throughs, both via exiting and reentering Play Mode, and by replaying or changing the media source, the observed behavior is that audio is output System-Direct, irregardless of the player's setting. This occurs even if no media has been successfully played in a previous Play Mode session.

This would also be why the experience was intermittent in my other project at times — I happened to test video on the first play-test after opening the editor at random. Most other times, I find myself entering and exiting Play Mode rapidly to test things which cannot be tested in editor alone, which means the bug is triggered before I have a chance to test the audio playback.

Chris-RH commented 2 months ago

Thank you, its on our list of things to investigate :)

MorrisRH commented 1 week ago

I'm unable to reproduce this using version AVPro Video 3.0.4, Unity 2022.3.31f1.