Renamed RtError class to RtAudioError and embedded it in RtAudio.h.
[rtaudio-cdist.git] / tests / playsaw.cpp
index 46ea4fb7318c535186d3fec4b28599fcd79804ee..a590ca18ddf59f655efe8a8434fc0cce9d77e332 100644 (file)
@@ -88,7 +88,7 @@ int saw( void *outputBuffer, void *inputBuffer, unsigned int nBufferFrames,
 
   for ( i=0; i<nBufferFrames; i++ ) {
     for ( j=0; j<channels; j++ ) {
-      *buffer++ = (MY_TYPE) (lastValues[j] * SCALE);
+      *buffer++ = (MY_TYPE) (lastValues[j] * SCALE * 0.5);
       lastValues[j] += BASE_RATE * (j+1+(j*0.1));
       if ( lastValues[j] >= 1.0 ) lastValues[j] -= 2.0;
     }
@@ -116,7 +116,7 @@ int saw( void *outputBuffer, void *inputBuffer, unsigned int nBufferFrames,
   for ( j=0; j<channels; j++ ) {
     increment = BASE_RATE * (j+1+(j*0.1));
     for ( i=0; i<nBufferFrames; i++ ) {
-      *buffer++ = (MY_TYPE) (lastValues[j] * SCALE);
+      *buffer++ = (MY_TYPE) (lastValues[j] * SCALE * 0.5);
       lastValues[j] += increment;
       if ( lastValues[j] >= 1.0 ) lastValues[j] -= 2.0;
     }
@@ -172,7 +172,7 @@ int main( int argc, char *argv[] )
     dac.openStream( &oParams, NULL, FORMAT, fs, &bufferFrames, &saw, (void *)data, &options );
     dac.startStream();
   }
-  catch ( RtError& e ) {
+  catch ( RtAudioError& e ) {
     e.printMessage();
     goto cleanup;
   }
@@ -190,7 +190,7 @@ int main( int argc, char *argv[] )
       // Stop the stream
       dac.stopStream();
     }
-    catch ( RtError& e ) {
+    catch ( RtAudioError& e ) {
       e.printMessage();
     }
   }