Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Acquiring RTCAudioTrack #22

Open
darnfish opened this issue May 10, 2021 · 8 comments
Open

Acquiring RTCAudioTrack #22

darnfish opened this issue May 10, 2021 · 8 comments

Comments

@darnfish
Copy link

darnfish commented May 10, 2021

Hey, thanks so much for this library! Had a headache over this for a couple days, was super relived when I found this fork :~)

I was wondering how I can directly get an RTCAudioTrack for the audio stream in question, from RTCAudioDeviceModule or some other source. I haven't had much luck creating a new audio source and adding it to the RTCMediaStream which RTCPeerConnection gave me, so some help would be appreciated.

Thanks!

Some background: I'm capturing CMSampleBuffer inside RPBroadcastHandler using Swift and Mediasoup

@akihikodaki
Copy link
Contributor

See examples/objc/AppRTCMobile/ARDAppClient.m. The setup procedure does not change except what is described in README.pixiv.en.md even if you use CMSampleBuffer from RPBroadcastHandler.

@darnfish
Copy link
Author

Was able to get the RTCAudioTrack from the RTCPeerConnectionFactory, but I can't hear anything for both mic (enabled) and app audio. Can you see anything immediately wrong with my implementation?

https://gist.github.com/darnfish/36e6d2c36b635dba8cc2fcf5312720b8

@akihikodaki
Copy link
Contributor

@darnfish It has a RTCMediaStream so I suppose it uses Plan B. This fork is tested only with the Unified Plan and I have no knowledge about Plan B.

@darnfish
Copy link
Author

I moved away from RTCMediaStream and I'm still having the same issue, do you think it's possible that the SFU I'm using (Mediasoup) has the issue? I've been thinking of making my own fork but instead implementing the capture method into RTCAudioSource directly.

Here is the updated code: https://gist.github.com/darnfish/69d662b080aaeb85e2a07f00673b3600

@akihikodaki
Copy link
Contributor

@darnfish Have you explicitly chosen Unified Plan?

@darnfish
Copy link
Author

As an architectural decision? Or is it a config change?

@akihikodaki
Copy link
Contributor

@darnfish It must be explicitly configured. Search for "unified" in examples/objc/AppRTCMobile/ARDAppClient.m.

@darnfish
Copy link
Author

Hm, I don't think this fork will work with my setup :~(

Do you think it'd be possible to build a capturer method into RTCAudioSource? I've been looking into it but I have 0 C++ / Objective-C++ knowledge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants