}
unlock:
- //MUTEX_UNLOCK( &stream_.mutex );
// Make sure to only tick duplex stream time once if using two devices
if ( stream_.mode != DUPLEX || (stream_.mode == DUPLEX && handle->id[0] != handle->id[1] && deviceId == handle->id[0] ) )
exit( 0 );
}
+double streamTimePrintIncrement = 1.0; // seconds
+double streamTimePrintTime = 1.0; // seconds
+
int inout( void *outputBuffer, void *inputBuffer, unsigned int /*nBufferFrames*/,
- double /*streamTime*/, RtAudioStreamStatus status, void *data )
+ double streamTime, RtAudioStreamStatus status, void *data )
{
// Since the number of input and output channels is equal, we can do
// a simple buffer copy operation here.
if ( status ) std::cout << "Stream over/underflow detected." << std::endl;
+ if ( streamTime >= streamTimePrintTime ) {
+ std::cout << "streamTime = " << streamTime << std::endl;
+ streamTimePrintTime += streamTimePrintIncrement;
+ }
+
unsigned int *bytes = (unsigned int *) data;
memcpy( outputBuffer, inputBuffer, *bytes );
return 0;