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

API improvement: consider a split() function #24

Open
bschwind opened this issue Sep 18, 2021 · 1 comment
Open

API improvement: consider a split() function #24

bschwind opened this issue Sep 18, 2021 · 1 comment

Comments

@bschwind
Copy link
Member

Similar to how tokio's TCP stream has a split function to give read and write halves, it would be nice to have the same for the audio processor, where split() would give you a CaptureProcessor and a RenderProcessor. This could make the API a little easier to use when you're not using a duplex audio stream, as then you wouldn't need to put the processor in an Arc<Mutex<_>>

@skywhale
Copy link
Member

You don't need Arc<Mutex<_>> because the processor is internally thread-safe. Right now, you clone a processor to use it across threads, and this may be non-intuitive. Could you take a look at this example https://github.com/tonarino/webrtc-audio-processing/blob/master/src/lib.rs#L324-L382, and let me know how this feels?

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