Fix warning re S24 not trivially copyable by removing copy constructor.
[rtaudio-cdist.git] / tests / duplex.cpp
index 291d2aa91eda7a1e8d4d84105d52d80652378465..494e5ad7ab121e6ffa1ac98537d064af20c2c9f2 100644 (file)
@@ -97,9 +97,15 @@ 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;
 
+  bufferBytes = bufferFrames * channels * sizeof( MY_TYPE );
   try {
     adac.openStream( &oParams, &iParams, FORMAT, fs, &bufferFrames, &inout, (void *)&bufferBytes, &options );
   }
@@ -108,8 +114,6 @@ int main( int argc, char *argv[] )
     exit( 1 );
   }
 
-  bufferBytes = bufferFrames * channels * sizeof( MY_TYPE );
-
   // Test RtAudio functionality for reporting latency.
   std::cout << "\nStream latency = " << adac.getStreamLatency() << " frames" << std::endl;