45
edits
| Line 207: | Line 207: | ||
/* From the application's NPAPI thread... */ | /* From the application's NPAPI thread... */ | ||
/* setup request structure, use sample_buffer_size from configuration */ | /* setup request structure, use sample_buffer_size from configuration */ | ||
NPDeviceContextAudioConfig request; | |||
NPDeviceContextAudioConfig config; | |||
pthread_t appAudioThreadID = 0; | pthread_t appAudioThreadID = 0; | ||
volatile appAudioDone = false; | volatile appAudioDone = false; | ||
| Line 243: | Line 243: | ||
/* application's thread dedicated to audio */ | /* application's thread dedicated to audio */ | ||
void* appAudioThread(void *userData) { | void* appAudioThread(void *userData) { | ||
/* context is sent via pthread's userData function arg */ | /* context & interface is sent via pthread's userData function arg */ | ||
NPDeviceContextAudio *context = (NPDeviceContextAudio *)userData; | |||
/* get pepper audio extensions (so we can call flushContext) */ | /* get pepper audio extensions (so we can call flushContext) */ | ||
NPDevice *audio = (NPDevice *)context->userData; | |||
/* simple audio loop for this example, poll global variable */ | /* simple audio loop for this example, poll global variable */ | ||
while (!appAudioDone) { | while (!appAudioDone) { | ||
| Line 268: | Line 268: | ||
} | } | ||
</pre> | </pre> | ||
===Switching to Low Power (Silence)=== | ===Switching to Low Power (Silence)=== | ||
edits