Unity-Technologies / com.unity.webrtc

WebRTC package for Unity
Other
753 stars 191 forks source link

Make com.unity.webrtc work with Wwise #920

Closed Nemo-G closed 1 year ago

Nemo-G commented 1 year ago

Is your feature request related to a problem?

I'm recently looking into a case when clients disable Unity default audio(FMOD) and use Wwise as the only Sound Engine in Unity. So we'd make unity webrtc support Wwise.

Describe the solution you'd like

I would like two methods added.

  1. A GetData method so that I can pull audio from webrtc track into Wwise source plugin
  2. A UnsafeSetData method so that I can feed data from Wwise effect plugin into webrtc audio track

See this PR https://github.com/Unity-Technologies/com.unity.webrtc/pull/919

Describe alternatives you've considered

I think the two function is pretty straight-forward.

Additional context

No response

karasusan commented 1 year ago

Thanks for making the pull request. I posted the message on the PR. Can you confirm?

Nemo-G commented 1 year ago

Hi @karasusan Replied in PR https://github.com/Unity-Technologies/com.unity.webrtc/pull/919

Maybe it is other Unity check failed like NativeContainer instead of Allocator type. I haven't tested against all available types.

Since the buffer to copy is not managed by Unity, a straight forward marshal copy here can prevent all unnecessary operations like checking, introduce no side effect and deliver right away with no time wasted.

karasusan commented 1 year ago

@Nemo-G Thank you for sharing more detail. I'm going to check SetData API implementation and fix this issue.

karasusan commented 1 year ago

memo: WRS-481