From 57e98ec9ad76a78303729837e35e175b65a01c96 Mon Sep 17 00:00:00 2001 From: Gary Scavone Date: Thu, 10 Oct 2013 23:59:34 +0200 Subject: Release 2.1.1 tarball --- doc/html/index.html | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'doc/html/index.html') diff --git a/doc/html/index.html b/doc/html/index.html index dda6132..5567502 100644 --- a/doc/html/index.html +++ b/doc/html/index.html @@ -30,7 +30,7 @@ The RtAudio API provides both blockin

Download

-Latest Release (7 October 2002): Version 2.1 (165 kB tar/gzipped) +Latest Release (24 October 2002): Version 2.1.1 (165 kB tar/gzipped)

Getting Started

@@ -436,7 +436,7 @@ In this example, the stream was opened for recording with a non-zero inputCh

Duplex Mode

-Finally, it is easy to use RtAudio for simultaneous audio input/output, or duplex operation. In this example, we use a callback function and pass our recorded data directly through for playback. +Finally, it is easy to use RtAudio for simultaneous audio input/output, or duplex operation. In this example, we use a callback function and simply scale the input data before sending it back to the output.

// duplex.cpp
 
@@ -444,9 +444,18 @@ Finally, it is easy to use RtAudio fo
 #include "RtAudio.h"
 
 // Pass-through function.
-int pass(char *buffer, int buffer_size, void *)
+int scale(char *buffer, int buffer_size, void *)
 {
-  // Surprise!!  We do nothing to pass the data through.
+  // Note: do nothing here for pass through.
+  double *my_buffer = (double *) buffer;
+
+  // Scale input data for output.
+  for (int i=0; i<buffer_size; i++) {
+    // Do for two channels.
+    *my_buffer++ *= 0.5;
+    *my_buffer++ *= 0.5;
+  }
+
   return 0;
 }
 
@@ -458,7 +467,6 @@ Finally, it is easy to use RtAudio fo
   int n_buffers = 4;      // number of internal buffers used by device
   int device = 0;         // 0 indicates the default or first available device
   int stream;             // our stream identifier
-  double data[2];
   char input;
   RtAudio *audio;
 
@@ -474,7 +482,7 @@ Finally, it is easy to use RtAudio fo
 
   try {
     // Set the stream callback function
-    audio->setStreamCallback(stream, &pass, NULL);
+    audio->setStreamCallback(stream, &scale, NULL);
 
     // Start the stream
     audio->startStream(stream);
@@ -504,7 +512,7 @@ Finally, it is easy to use RtAudio fo
 

When an RtAudio stream is running in duplex mode (nonzero input AND output channels), the audio write (playback) operation always occurs before the audio read (record) operation. This sequence allows the use of a single buffer to store both output and input data.

-As we see with this example, the write-read sequence of operations does not preclude the use of RtAudio in situations where input data is first processed and then output through a duplex stream. When the stream buffer is first allocated, it is initialized with zeros, which produces no audible result when output to the device. In this example, anything recorded by the audio stream input will be played out during the next round of audio processing. +As we see with this example, the write-read sequence of operations does not preclude the use of RtAudio in situations where input data is first processed and then output through a duplex stream. When the stream buffer is first allocated, it is initialized with zeros, which produces no audible result when output to the device. In this example, anything recorded by the audio stream input will be scaled and played out during the next round of audio processing.

Note that duplex operation can also be achieved by opening one output stream and one input stream using the same or different devices. However, there may be timing problems when attempting to use two different devices, due to possible device clock variations, unless a common external "sync" is provided. This becomes even more difficult to achieve using two separate callback streams because it is not possible to explicitly control the calling order of the callback functions.

@@ -527,7 +535,7 @@ In order to compile RtAudio for a spe - +
OS: Audio API: Preprocessor Definition: Library or Framework: Example Compiler Statement:
Linux ALSA __LINUX_ALSA__ asound, pthread g++ -Wall -D__LINUX_ALSA__ -o probe probe.cpp RtAudio.cpp -lasound -lpthread
Linux OSS __LINUX_OSS__ pthread g++ -Wall -D__LINUX_OSS__ -o probe probe.cpp RtAudio.cpp -lpthread
Macintosh OS X CoreAudio __MACOSX_CORE__ pthread, stdc++, CoreAudio cc -Wall -D__MACOSX_CORE__ -o probe probe.cpp RtAudio.cpp -framework CoreAudio -lstdc++ -lpthread
Macintosh OS X CoreAudio __MACOSX_CORE__ pthread, stdc++, CoreAudio CC -Wall -D__MACOSX_CORE__ -o probe probe.cpp RtAudio.cpp -framework CoreAudio -lstdc++ -lpthread
Irix AL __IRIX_AL__ audio, pthread CC -Wall -D__IRIX_AL__ -o probe probe.cpp RtAudio.cpp -laudio -lpthread
Windows Direct Sound __WINDOWS_DS__ dsound.lib (ver. 5.0 or higher), multithreaded compiler specific
Windows ASIO __WINDOWS_ASIO__ various ASIO header and source files compiler specific
-- cgit v1.2.3