Skip to content

Instantly share code, notes, and snippets.

@RelativisticMechanic
Created March 22, 2018 20:44
Show Gist options
  • Save RelativisticMechanic/aabf8a5f35cd41aaa468a451f0bb0c32 to your computer and use it in GitHub Desktop.
Save RelativisticMechanic/aabf8a5f35cd41aaa468a451f0bb0c32 to your computer and use it in GitHub Desktop.
unsigned int test_int = 0;
static int audio_interface_callback( const void *inputBuffer, void *outputBuffer,
unsigned long framesPerBuffer,
const PaStreamCallbackTimeInfo* timeInfo,
PaStreamCallbackFlags statusFlags,
void *userData )
{
uint16_t* out = (uint16_t*)outputBuffer;
uint16_t* data = (uint16_t*)((uintptr_t)userData + test_int * sizeof(uint16_t));
for(int i = 0; i < framesPerBuffer; i++)
{
*out++ = *data++;
*out++ = *data++;
test_int += 2;
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment