Unity-Technologies / com.unity.webrtc

WebRTC package for Unity
Other
749 stars 186 forks source link

[BUG] Outdated docs on Audio Streaming? #543

Closed streunerlein closed 2 years ago

streunerlein commented 2 years ago

Describe the bug The reference talks about Audio Streaming on https://docs.unity3d.com/Packages/com.unity.webrtc@2.4/manual/audiostreaming.html using Audio.CaptureStream which I cannot find any documentation nor source for this API. Is this outdated or just wrong docs? What is the current state-of-the-art for Audio Streaming with UnityWebRTC?

karasusan commented 2 years ago

@streunerlein Hi, you can try the Audio scene in the package sample. Sorry documentation is not updated yet 😓 https://docs.unity3d.com/Packages/com.unity.webrtc@2.4/manual/sample.html

streunerlein commented 2 years ago

@karasusan Don't worry, it's no problem at all! Thanks for the sample link, I've followed the samples and was able to create audio streaming. I was hoping these docs point to an API I have missed or misunderstood, because I am currently fighting weird problems with streaming microphone input to multiple peers and hoped I was doing something wrong.

karasusan commented 2 years ago

@streunerlein Sure, I am understanding the documentation is lack for these features. I will make a priority of the documentation for next update.

crosf32 commented 2 years ago

@karasusan

Hi, I'm having so much trouble to figure out how to stream the whole scene audio ! As it was working in version 2.2.1 (using com.unity.renderstream as well) The doc hasn't been updated yet and the Audio class has disappeared ..

We can stream Audio only from an AudioSource component (which is working for the Microphone) but not for the whole scene.

I've tried to generate an AudioClip Combined from all the AudioSources in the scene and to apply it to an AudioSource to try to stream it but it doesn't work ..

What am i supposed to do ?

Thanks !

karasusan commented 2 years ago

AudioListener call OnAudioFilterRead method same as AudioSource. You can use the whole scene audio if you implements OnAudioFilterRead.

old: https://github.com/Unity-Technologies/com.unity.webrtc/blob/e900f5cd777484d25b20074aff854aea402b0ea4/Samples~/MediaStream/MediaStreamSample.cs#L260-L263

new: https://github.com/Unity-Technologies/com.unity.webrtc/blob/e1550d6e4772c59add97f865d3dcee7f0f85d6de/Runtime/Scripts/AudioStreamTrack.cs#L238

crosf32 commented 2 years ago

Oh ok, Thank you !

karasusan commented 2 years ago

@crosf32 Of course, we will update docs next month. Sorry for too late!

karasusan commented 2 years ago

memo: WRS-164

karasusan commented 2 years ago

Fixed docs in this PR #621

karasusan commented 2 years ago

@streunerlein We released the new version 2.4.0-exp.5. Please check it out and if your issue is not solved, please notify me.