Created
April 13, 2012 17:26
-
-
Save diclophis/2378558 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// setup a small scratch buffer | |
short *buffer; | |
buffer = new short[min_buffer_length]; | |
void *pump_audio(void *) { | |
int wrote; | |
// zero out the scratch buffer | |
memset(buffer, 0, min_buffer_length * sizeof(short)); | |
while (true) { | |
FillBuffer(buffer, min_buffer_length * sizeof(short)); | |
wrote = PushBufferToDriver(buffer, min_buffer / sizeof(short)); | |
if (wrote < 0) { | |
//unable to write to sound driver/card | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment