UnityRenderStreaming icon indicating copy to clipboard operation
UnityRenderStreaming copied to clipboard

[BUG]: Audio not picked up when BypassListenerEffects checked

Open krisrok opened this issue 2 years ago • 5 comments

Package version

3.1.0-exp.6

Environment

* OS: Windows 10
* Unity version: 2021.3
* Browser: Chrome 110.0.5481.97

Steps To Reproduce

  1. Using a setup with an AudioStreamSender, use an AudioListener (presumably on main camera)
  2. Add and configure an AudioSource to play in loop, check BypassListenerEffects
  3. Start stream

Current Behavior

No audio reaches the browser. Even though the AudioListener seems to pick it up: Disabling the AudioListener component mutes the audio.

Expected Behavior

Audio is picked up regardless of this setting.

Anything else?

No response

krisrok avatar Feb 17 '23 13:02 krisrok

@krisrok Hi, is this issue occured by the Bypass Listener Effects parameter?

karasusan avatar Feb 21 '23 02:02 karasusan

@karasusan Yes exactly.

I guess it is because the AudioStreamSender uses the API usually used by effects (using one of Unity's magic methods OnAudioFilterRead).

Just realized this is part of the Unity.WebRTC package.

krisrok avatar Feb 24 '23 15:02 krisrok

@krisrok your issue may be same below. https://github.com/Unity-Technologies/com.unity.webrtc/issues/834

karasusan avatar Feb 28 '23 02:02 karasusan

May be related but those are different sides of the API?

In case of the issue you referenced it's about feeding samples to Unity. The problem of this is the sound will not be spatial. This is as well as the workaround known for quite a while.

The issue at hand here is reading samples from Unity though.

But I think we can agree on the OnAudioFilterRead based API not being great for either task.

krisrok avatar Feb 28 '23 07:02 krisrok

@krisrok Surely there would be some issues using OnAudioFilterRead method for these features.

karasusan avatar Mar 07 '23 05:03 karasusan