Skip to content

Commit

Permalink
Merge pull request #60 from alexbw/DeviceChannelOutputFix
Browse files Browse the repository at this point in the history
Device channel output fix
  • Loading branch information
alexbw committed Sep 11, 2013
2 parents 65ffb87 + 7bbadda commit 277539b
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions Novocaine/Novocaine.m
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,14 @@ OSStatus renderCallback (void *inRefCon,
int thisNumChannels = ioData->mBuffers[iBuffer].mNumberChannels;

for (int iChannel = 0; iChannel < thisNumChannels; ++iChannel) {
vDSP_vsadd(sm.outData+iChannel+iBuffer, sm.numOutputChannels, &zero, (float *)ioData->mBuffers[iBuffer].mData, thisNumChannels, inNumberFrames);

int interleaveOffset = iChannel;
if (iBuffer < sm.numOutputChannels){
interleaveOffset += iBuffer;
}

vDSP_vsadd(sm.outData+interleaveOffset, sm.numOutputChannels, &zero, (float *)ioData->mBuffers[iBuffer].mData, thisNumChannels, inNumberFrames);

}
}
}
Expand All @@ -806,7 +813,13 @@ OSStatus renderCallback (void *inRefCon,
int thisNumChannels = ioData->mBuffers[iBuffer].mNumberChannels;

for (int iChannel = 0; iChannel < thisNumChannels; ++iChannel) {
vDSP_vfix16(sm.outData+iChannel, sm.numOutputChannels, (SInt16 *)ioData->mBuffers[iBuffer].mData+iChannel, thisNumChannels, inNumberFrames);

int interleaveOffset = iChannel;
if (iBuffer < sm.numOutputChannels){
interleaveOffset += iBuffer;
}

vDSP_vfix16(sm.outData+interleaveOffset, sm.numOutputChannels, (SInt16 *)ioData->mBuffers[iBuffer].mData+iChannel, thisNumChannels, inNumberFrames);
}
}

Expand Down

0 comments on commit 277539b

Please sign in to comment.