#include "RtAudio.h"
#include <iostream>
+#include <cstdlib>
+#include <cstring>
#define BASE_RATE 0.005
#define TIME 1.0
// a simple buffer copy operation here.
if ( status ) std::cout << "Stream over/underflow detected." << std::endl;
- unsigned long *bytes = (unsigned long *) data;
+ unsigned int *bytes = (unsigned int *) data;
memcpy( outputBuffer, inputBuffer, *bytes );
return 0;
}
dac.showWarnings( true );
// Set our stream parameters for output only.
- bufferFrames = 256;
+ bufferFrames = 512;
RtAudio::StreamParameters oParams, iParams;
oParams.deviceId = oDevice;
oParams.nChannels = channels;
std::cout << "Playing again ... press <enter> to close the stream.\n";
std::cin.get( input );
}
- catch ( RtError& e ) {
+ catch ( RtAudioError& e ) {
e.printMessage();
goto cleanup;
}
std::cout << "\nPlaying ... press <enter> to stop.\n";
std::cin.get( input );
}
- catch ( RtError& e ) {
+ catch ( RtAudioError& e ) {
e.printMessage();
goto cleanup;
}
std::cout << "\nRunning ... press <enter> to stop.\n";
std::cin.get( input );
}
- catch ( RtError& e ) {
+ catch ( RtAudioError& e ) {
e.printMessage();
}