| 1145 | |
| 1146 | #if defined(__APPLE__) |
| 1147 | void audioQueueCallback(void *inUserData, AudioQueueRef inAQ, AudioQueueBufferRef buffer) |
| 1148 | { |
| 1149 | modAudioOut out = inUserData; |
| 1150 | int samplesToGenerate = buffer->mAudioDataBytesCapacity / out->bytesPerFrame; |
| 1151 | OUTPUTSAMPLETYPE *output = (OUTPUTSAMPLETYPE *)buffer->mAudioData; |
| 1152 | |
| 1153 | buffer->mAudioDataByteSize = samplesToGenerate * out->bytesPerFrame; |
| 1154 | |
| 1155 | pthread_mutex_lock(&out->mutex); |
| 1156 | |
| 1157 | audioMix(out, samplesToGenerate, output); |
| 1158 | |
| 1159 | pthread_mutex_unlock(&out->mutex); |
| 1160 | |
| 1161 | AudioQueueEnqueueBuffer(out->audioQueue, buffer, 0, NULL); |
| 1162 | } |
| 1163 | |
| 1164 | void invokeCallbacks(CFRunLoopTimerRef timer, void *info) |
| 1165 | { |
no test coverage detected