1. int AudioProc::CallBack( const void *inputBuffer, void *outputBuffer, unsigned long framesPerBuffer,
  2. const PaStreamCallbackTimeInfo* timeInfo, PaStreamCallbackFlags statusFlags, void *userData )
  3. {
  4. Device *thisDevice = (Device*)userData; //This holds the device info we need
  5.  
  6.  
  7.  
  8.  
  9. //We need to split the signal up into channels
  10. float *input = (float*)inputBuffer;
  11.  
  12. std::vector<float*>channel(thisDevice->inDev.channelCount); //make an array for the number of channels
  13.  
  14.  
  15. for (unsigned int f=0;f<(unsigned)framesPerBuffer;f++) {
  16. for(int i=0; i< thisDevice->inDev.channelCount; i++){
  17. *channel[i]++ = *input++; <--- OUCH.. can't ++ a vector pointer.
  18. }
  19. }
  20.  
  21.  
  22.  
  23. ///////////////////////////////////////////////////////////////////////////////////////
  24.  
  25. //On the other hand.. something like this works...
  26. //Lets pretend I have 3 channels
  27.  
  28. float *input = (float*)inputBuffer;
  29. float* channel_1 = (float*)inputBuffer;
  30. float* channel_2 = (float*)inputBuffer;
  31. float* channel_3 = (float*)inputBuffer;
  32.  
  33. for (unsigned int f=0;f<(unsigned)framesPerBuffer;f++) {
  34. *channel_1++ = *output++
  35. *channel_2++ = *output++
  36. *channel_3++ = *output++
  37. }
  38.  
  39.  
  40. //So how can I do this with a pointer array like *channel[n] ???
  41.  
  42. return 0;
  43. }