exit( 0 );
}
-int inout( void *outputBuffer, void *inputBuffer, unsigned int nBufferFrames,
- double streamTime, RtAudioStreamStatus status, void *data )
+int inout( void *outputBuffer, void *inputBuffer, unsigned int /*nBufferFrames*/,
+ 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.
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 );
}
- catch ( RtError& e ) {
+ catch ( RtAudioError& e ) {
std::cout << '\n' << e.getMessage() << '\n' << std::endl;
exit( 1 );
}
- bufferBytes = bufferFrames * channels * sizeof( MY_TYPE );
-
// Test RtAudio functionality for reporting latency.
std::cout << "\nStream latency = " << adac.getStreamLatency() << " frames" << std::endl;
// Stop the stream.
adac.stopStream();
}
- catch ( RtError& e ) {
+ catch ( RtAudioError& e ) {
std::cout << '\n' << e.getMessage() << '\n' << std::endl;
goto cleanup;
}