@@ -97,6 +97,11 @@ int main( int argc, char *argv[] ) | |||||
oParams.nChannels = channels; | oParams.nChannels = channels; | ||||
oParams.firstChannel = oOffset; | oParams.firstChannel = oOffset; | ||||
if ( iDevice == 0 ) | |||||
iParams.deviceId = adac.getDefaultInputDevice(); | |||||
if ( oDevice == 0 ) | |||||
oParams.deviceId = adac.getDefaultOutputDevice(); | |||||
RtAudio::StreamOptions options; | RtAudio::StreamOptions options; | ||||
//options.flags |= RTAUDIO_NONINTERLEAVED; | //options.flags |= RTAUDIO_NONINTERLEAVED; | ||||
@@ -125,6 +125,9 @@ int main( int argc, char *argv[] ) | |||||
oParams.nChannels = channels; | oParams.nChannels = channels; | ||||
oParams.firstChannel = offset; | oParams.firstChannel = offset; | ||||
if ( device == 0 ) | |||||
oParams.deviceId = dac.getDefaultOutputDevice(); | |||||
data.channels = channels; | data.channels = channels; | ||||
try { | try { | ||||
dac.openStream( &oParams, NULL, FORMAT, fs, &bufferFrames, &output, (void *)&data ); | dac.openStream( &oParams, NULL, FORMAT, fs, &bufferFrames, &output, (void *)&data ); | ||||
@@ -174,6 +174,9 @@ int main( int argc, char *argv[] ) | |||||
oParams.nChannels = channels; | oParams.nChannels = channels; | ||||
oParams.firstChannel = offset; | oParams.firstChannel = offset; | ||||
if ( device == 0 ) | |||||
oParams.deviceId = dac.getDefaultOutputDevice(); | |||||
options.flags = RTAUDIO_HOG_DEVICE; | options.flags = RTAUDIO_HOG_DEVICE; | ||||
options.flags |= RTAUDIO_SCHEDULE_REALTIME; | options.flags |= RTAUDIO_SCHEDULE_REALTIME; | ||||
#if !defined( USE_INTERLEAVED ) | #if !defined( USE_INTERLEAVED ) | ||||
@@ -128,6 +128,9 @@ int main( int argc, char *argv[] ) | |||||
oParams.nChannels = channels; | oParams.nChannels = channels; | ||||
oParams.firstChannel = oOffset; | oParams.firstChannel = oOffset; | ||||
if ( oDevice == 0 ) | |||||
oParams.deviceId = dac.getDefaultOutputDevice(); | |||||
RtAudio::StreamOptions options; | RtAudio::StreamOptions options; | ||||
options.flags = RTAUDIO_HOG_DEVICE; | options.flags = RTAUDIO_HOG_DEVICE; | ||||
try { | try { | ||||
@@ -192,6 +195,8 @@ int main( int argc, char *argv[] ) | |||||
iParams.deviceId = iDevice; | iParams.deviceId = iDevice; | ||||
iParams.nChannels = channels; | iParams.nChannels = channels; | ||||
iParams.firstChannel = iOffset; | iParams.firstChannel = iOffset; | ||||
if ( iDevice == 0 ) | |||||
iParams.deviceId = dac.getDefaultInputDevice(); | |||||
options.flags = RTAUDIO_NONINTERLEAVED; | options.flags = RTAUDIO_NONINTERLEAVED; | ||||
try { | try { | ||||
dac.openStream( &oParams, &iParams, RTAUDIO_SINT32, fs, &bufferFrames, &inout, (void *)&bufferBytes, &options ); | dac.openStream( &oParams, &iParams, RTAUDIO_SINT32, fs, &bufferFrames, &inout, (void *)&bufferBytes, &options ); | ||||
@@ -121,6 +121,11 @@ int main( int argc, char *argv[] ) | |||||
iParams.nChannels = mydata.channels; | iParams.nChannels = mydata.channels; | ||||
iParams.firstChannel = iOffset; | iParams.firstChannel = iOffset; | ||||
if ( iDevice == 0 ) | |||||
iParams.deviceId = adc->getDefaultInputDevice(); | |||||
if ( oDevice == 0 ) | |||||
oParams.deviceId = adc->getDefaultOutputDevice(); | |||||
// First, test external stopStream() calls. | // First, test external stopStream() calls. | ||||
mydata.pulseCount = PULSE_RATE * fs; | mydata.pulseCount = PULSE_RATE * fs; | ||||
mydata.nFrames = 50 * fs; | mydata.nFrames = 50 * fs; | ||||