X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=tests%2Frecord.cpp;h=faa9789a80ef11f87e5c828e138ae04d38bd7097;hb=03599c1281835f886e98da7d15244075ec88913f;hp=56b59b4eb1b30932e86b50471efdb37416291c69;hpb=18e6f5126073320450438e99b4833cabc3347dba;p=rtaudio-cdist.git diff --git a/tests/record.cpp b/tests/record.cpp index 56b59b4..faa9789 100644 --- a/tests/record.cpp +++ b/tests/record.cpp @@ -38,7 +38,7 @@ typedef double MY_TYPE; */ // Platform-dependent sleep routines. -#if defined( __WINDOWS_ASIO__ ) || defined( __WINDOWS_DS__ ) +#if defined( WIN32 ) #include #define SLEEP( milliseconds ) Sleep( (DWORD) milliseconds ) #else // Unix variants @@ -117,7 +117,10 @@ int main( int argc, char *argv[] ) // Set our stream parameters for input only. bufferFrames = 512; RtAudio::StreamParameters iParams; - iParams.deviceId = device; + if ( device == 0 ) + iParams.deviceId = adc.getDefaultInputDevice(); + else + iParams.deviceId = device; iParams.nChannels = channels; iParams.firstChannel = offset;