int AudioProc::CallBack( const void *inputBuffer, void *outputBuffer, unsigned long framesPerBuffer,
const PaStreamCallbackTimeInfo* timeInfo, PaStreamCallbackFlags statusFlags, void *userData )
{
Device *thisDevice = (Device*)userData; //This holds the device info we need
//We need to split the signal up into channels
float *input = (float*)inputBuffer;
std::vector<float*>channel(thisDevice->inDev.channelCount); //make an array for the number of channels
for (unsigned int f=0;f<(unsigned)framesPerBuffer;f++) {
for(int i=0; i< thisDevice->inDev.channelCount; i++){
*channel[i]++ = *input++; <--- OUCH.. can't ++ a vector pointer.
}
}
///////////////////////////////////////////////////////////////////////////////////////
//On the other hand.. something like this works...
//Lets pretend I have 3 channels
float *input = (float*)inputBuffer;
float* channel_1 = (float*)inputBuffer;
float* channel_2 = (float*)inputBuffer;
float* channel_3 = (float*)inputBuffer;
for (unsigned int f=0;f<(unsigned)framesPerBuffer;f++) {
*channel_1++ = *output++
*channel_2++ = *output++
*channel_3++ = *output++
}
//So how can I do this with a pointer array like *channel[n] ???
return 0;
}