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

Input support for macOS #32

Open
michaeltyson opened this issue Aug 17, 2016 · 5 comments
Open

Input support for macOS #32

michaeltyson opened this issue Aug 17, 2016 · 5 comments

Comments

@michaeltyson
Copy link
Collaborator

Currently, there are issues with receiving audio input on macOS, resulting in CannotDoInCurrentContext errors when rendering. I suspect this is related to sample rate, and that an AudioConverter will be required when the input unit's rate doesn't match the output unit's one. This is only a theory, though.

@32Beat
Copy link

32Beat commented Aug 17, 2016

I frequently got CannotDoInCurrentContext when the renderslice sizes don't match. i.e. if the input device has been set with a 512 frame slicebuffer, then AudioUnitRender will only do 512 frames.

@michaeltyson
Copy link
Collaborator Author

Ah, that's such a dumb error message to use for that case - so unhelpful 😅

Pretty sure the frames per slice is set correctly, though - I did a little digging and sample rate's my best guess so far

@32Beat
Copy link

32Beat commented Aug 17, 2016

Does the input module actually attach an input device to the audio unit?

@32Beat
Copy link

32Beat commented Aug 17, 2016

line 95:

#if !TARGET_OS_IPHONE
    NSAssert(!(self.outputEnabled && self.inputEnabled), @"Can only have both input and output enabled on iOS");
#endif

should probably change to something like:

#if !TARGET_OS_IPHONE
    NSAssert(!(self.outputEnabled ^ self.inputEnabled), @"Must have either output or input enabled, (but not both)");
#endif

having both input and output enabled on the desktop didn't work for me. Likely not possible as the input will be running in its own thread.

@32Beat
Copy link

32Beat commented Aug 17, 2016

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