rnine/SimplyCoreAudio

Feature Request: Support for AudioDeviceIOProc

Joebayld opened this issue · 1 comments

Hi there.

First off - great work on this library! It is clean and works great!

Now - I'm trying to register a AudioDeviceIOProc so I can access the buffer for an input stream and later do further processing. What are you thoughts on adding this functionality to the AudioStream object? I can help working on this, but there isn't a ton of documentation so I want to make sure its done properly.

Thanks,
Joe

rnine commented

@Joebayld Thank you!

I am not sure if it is possible to register an AudioDeviceIOProc on an AudioStream. As far as I can tell from looking at https://developer.apple.com/library/content/technotes/tn2223/_index.html, registering a new AudioDeviceIOProc takes an AudioDeviceID as input, not an AudioStreamID.

Here's the function signature to register a new AudioDeviceIOProc:

extern OSStatus
AudioDeviceCreateIOProcID(  AudioObjectID                               inDevice,
                            AudioDeviceIOProc                           inProc,
                            void* __nullable                            inClientData,
                            AudioDeviceIOProcID __nullable * __nonnull  outIOProcID)                                    __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);

The documentation describes the inDevice argument as "The AudioDevice to register the IOProc with."

That said, if you know how to implement this feature please go ahead and submit a PR 👍