Updates to eguitar, ragamatic and examples project files for new RtAudio API.

This commit is contained in:
garyscavone
2023-08-04 10:37:22 -04:00
parent 7f97ab5f71
commit fd5e37863d
11 changed files with 206 additions and 236 deletions

View File

@@ -33,21 +33,15 @@ int main()
parameters.nChannels = 1;
RtAudioFormat format = ( sizeof(StkFloat) == 8 ) ? RTAUDIO_FLOAT64 : RTAUDIO_FLOAT32;
unsigned int bufferFrames = RT_BUFFER_SIZE;
try {
dac.openStream( &parameters, NULL, format, (unsigned int)Stk::sampleRate(), &bufferFrames, &tick, (void *)&sine );
}
catch ( RtAudioError &error ) {
error.printMessage();
if ( dac.openStream( &parameters, NULL, format, (unsigned int)Stk::sampleRate(), &bufferFrames, &tick, (void *)&sine ) ) {
std::cout << dac.getErrorText() << std::endl;
goto cleanup;
}
sine.setFrequency(440.0);
try {
dac.startStream();
}
catch ( RtAudioError &error ) {
error.printMessage();
if ( dac.startStream() ) {
std::cout << dac.getErrorText() << std::endl;
goto cleanup;
}
@@ -57,12 +51,7 @@ int main()
std::cin.get( keyhit );
// Shut down the output stream.
try {
dac.closeStream();
}
catch ( RtAudioError &error ) {
error.printMessage();
}
dac.closeStream();
cleanup: