last day (15 days later) » 

5:57 PM
1
A: Setting up audio unit iOS with mono input and stereo output

Adam BryantkAudioFormatFlagsAudioUnitCanonical is 32-bit 8.24 fixed point format. That means mBytesPerFrame should be 4 and mBitsPerChannel should be 32 for both stereo and mono. Setting it to 16-bits for would probably produce this error. That said, I doubt you want 8.24. You probably want kAudioFormatFl...

 
Thanks for the response. I will make those changes to the IO formats and see if it fixes my error (you're right that the naming is counterintuitive for the IO formats).
I'm assuming based on your response that I also need to switch kOutputBus with kInputBus when setting up my IO callbacks as well.
 
Sorry, I made a mistake. mBytesPerFrame should be 8 for stereo with 8.24.
I'm not sure. I think so. I've only ever set up a single callback, which I think is all you need really. You get input samples, process them, and then output them, all in the same callback. So it would be kAudioUnitProperty_SetRenderCallback, kAudioUnitScope_Input, kOutputBus.
Note that for enabling input, you do use input scope and input bus however.
 
I made the changes you suggested and I took your advice about changing from kAudioFormatFlagsAudioUnitCanonical and I'm now using kAudioFormatFlagIsSignedInteger | kAudioFormatFlagIsPacked. The error is gone and I'm now getting input but no output. I'm going to mark your answer as the accepted answer. I'm hoping I can continue picking your brain. Are you on IRC or any other chat service? I don't want to take up to much of your time, but my deadline for this is today and any help I can get it greatly appreciated.
 
Glad it helped. Post another question to stack overflow if you can't find the answer elsewhere on here. I'll keep an eye out...
I don't have much time to devote to helping you today (have my own deadlines), but let's see if it's something simple. So you're not getting output?
Are you using a single callback?
 
6:23 PM
Two
I saw your comment about just doing it all in one. I'll try that out and see if it works. I understand you have dealines as well so I'l just post my questions to stack. Thanks for your time, hope to see you around stack and good luck on your projects.
 
have you tried copying input directly to output? or generating a sine wave and outputting? how do you know input is good?
 
I know input is good because I dumped the buffers to the command prompt. On my output I'm trying generate a sine wave to the left channel only
 
Yeah, I'd try just a single callback. Good luck!
 
I'm working on a new stack post that shows how I'm generating my sine wave and writing to the output buffers
Thanks again
 

  last day (15 days later) »