UnityPlugin-AVProVideo icon indicating copy to clipboard operation
UnityPlugin-AVProVideo copied to clipboard

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

Open MisutaaAsriel opened this issue 1 year ago • 5 comments

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

  • Unity version: 2022.3.6f1 (x86-64)
  • AVPro Video version: 2.8.5-trial build 1892
  • Operating System version: macOS Sonoma
  • Device Model: MacBook Air M2
  • Video Specs: ALL VIDEO (local/streaming, H264) (n/a)

 

  • VRChat SDK 3.5.2
  • Architech's Video Player Shim 0.15.4

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 avatar Apr 06 '24 14:04 MisutaaAsriel

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. 🙃

MisutaaAsriel avatar Apr 06 '24 15:04 MisutaaAsriel

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

Chris-RH avatar Apr 08 '24 10:04 Chris-RH

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.

MisutaaAsriel avatar Apr 11 '24 00:04 MisutaaAsriel

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

Chris-RH avatar Apr 11 '24 08:04 Chris-RH

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

MorrisRH avatar Jun 27 '24 14:06 MorrisRH