Hello all. I’ve just started working with oF so I’m a bit of a newb.
I’m trying to get stereo audio input working- iPad can do stereo with use of a usb soundcard) and it appears that oF is hardcoded for mono input:
ofxiPhoneSoundStream.mm in recordingCallback on line 108-111, and 132 for the audioReceived call. I’ve been hacking at it for a few hours and I’m a bit too novice to figure out how to get it working.
I know in theory it should work just fine.
Thoughts?
I always thought it did record stereo; it just interleaved the results so that buffer[0] = left1, buffer[1] = right1, buffer[2] = left2 etc. But that belief is based purely on a code comment somewhere in the source so who knows if it’s true or not!
Right but as mentioned the number of inputs in another part of the source is hardcoded to 1. So changing the number of inputs to anything other than 0 or 1 results in audioReceived not being called.
OSStatus status = AudioUnitRender(audioUnit, ioActionFlags, inTimeStamp, 1, inNumberFrames, ioData);
checkStatus(status);
if(status!=noErr) return status;
if(ioData->mNumberBuffers>0) {
int i = 0;
short int *buffer = (short int *) list.mBuffers[i].mData;
for(int j = 0; j < ioData->mBuffers[i].mDataByteSize/2; j++) {
// go through each sample and turn it into a float
tempBuffer[j] = (float)buffer[j]/32767.f;
I tried playing around with it to get it working but I suppose I suck.
Also note I tried another framework for stereo audio input and it works, though I’d rather use oF than have to convert the rest of my code.