madsmtm / objc2

Bindings to Apple's frameworks in Rust
https://docs.rs/objc2/
MIT License
368 stars 39 forks source link

can i use objc2 for system audio capture? #647

Open louis030195 opened 2 months ago

louis030195 commented 2 months ago

hi great work here

i'm working on https://github.com/mediar-ai/screenpipe

i'm trying to use macos audio output capture without crashing computer but:

https://github.com/svtlabs/screencapturekit-rs/issues/52 https://github.com/RustAudio/cpal/pull/894/files

i even fixed tons of memory leaks on the screencapturekit rust lib but wondering if i should just switch to objc2 or https://github.com/yury/cidre

is there a way to capture audio output in objc2 through screencapturekit or coreaudio?

or if you have any recommendation

thanks for the great work 🙏

madsmtm commented 2 months ago

We do support ScreenCaptureKit in objc2-screen-capture-kit, and I would definitely recommend that over screencapturekit.

We do not yet support CoreAudio (tracked as part of #556), and I'm not sure exactly what's needed from it to make what you're doing work (not familiar with either framework), but if it comes down to it, you can always manually do the interop between objc2 and other crates.

Feel free to ping me in a PR or something that converts to objc2, I'd be happy to review it.

madsmtm commented 2 months ago

In particular, there are a few APIs from ScreenCaptureKit that we do not support, because they use other frameworks that we do not support. But again, you can work around that by providing the binding yourself.