Merge pull request #35 from xord/fix_compile_errors_with_core_audio
[rtaudio-cdist.git] / tests / duplex.cpp
index 291d2aa91eda7a1e8d4d84105d52d80652378465..43d12179bc9c028e0843bdff5c406d877ed5602f 100644 (file)
@@ -55,7 +55,7 @@ int inout( void *outputBuffer, void *inputBuffer, unsigned int /*nBufferFrames*/
   // a simple buffer copy operation here.
   if ( status ) std::cout << "Stream over/underflow detected." << std::endl;
 
-  unsigned int *bytes = (unsigned int *) data;
+  uint32_t *bytes = (uint32_t *) data;
   memcpy( outputBuffer, inputBuffer, *bytes );
   return 0;
 }
@@ -97,6 +97,11 @@ int main( int argc, char *argv[] )
   oParams.nChannels = channels;
   oParams.firstChannel = oOffset;
 
+  if ( iDevice == 0 )
+    iParams.deviceId = adac.getDefaultInputDevice();
+  if ( oDevice == 0 )
+    oParams.deviceId = adac.getDefaultOutputDevice();
+
   RtAudio::StreamOptions options;
   //options.flags |= RTAUDIO_NONINTERLEAVED;