// implementation.
struct CoreHandle {
AudioDeviceID id[2]; // device ids
+#if defined( MAC_OS_X_VERSION_10_5 ) && ( MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 )
AudioDeviceIOProcID procId[2];
+#endif
UInt32 iStream[2]; // device stream index (or first if using multiple)
UInt32 nStreams[2]; // number of streams to use
bool xrun[2];
}
// Set the buffer number, which in ALSA is referred to as the "period".
- int totalSize, dir;
+ int totalSize, dir = 0;
unsigned int periods = 0;
if ( options ) periods = options->numberOfBuffers;
totalSize = *bufferSize * periods;
}
std::cout << "\nRecording for " << time << " seconds ... writing file 'record.raw' (buffer frames = " << bufferFrames << ")." << std::endl;
- while ( 1 ) {
+ while ( adc.isStreamRunning() ) {
SLEEP( 100 ); // wake every 100 ms to check if we're done
- if ( adc.isStreamRunning() == false ) break;
}
// Now write the entire data to the file.