From 830706e4368bb27d4c7d8138fbce4e393cedcd2f Mon Sep 17 00:00:00 2001 From: Gary Scavone Date: Fri, 11 Oct 2013 00:00:56 +0200 Subject: Release 3.0 tarball --- doc/html/RtAudio_8h-source.html | 823 ++++++++++++------- doc/html/RtError_8h-source.html | 64 ++ doc/html/annotated.html | 18 +- doc/html/classRtAudio-members.html | 57 +- doc/html/classRtAudio.html | 788 ++++++++---------- doc/html/classRtError-members.html | 37 +- doc/html/classRtError.html | 138 +++- doc/html/doxygen.css | 179 ++++- doc/html/doxygen.gif | Bin 2378 -> 0 bytes doc/html/doxygen.png | Bin 0 -> 2352 bytes doc/html/files.html | 14 +- doc/html/functions.html | 114 ++- doc/html/functions_enum.html | 26 + doc/html/functions_eval.html | 42 + doc/html/functions_func.html | 43 + doc/html/functions_vars.html | 32 + doc/html/index.html | 883 ++++++++++----------- doc/html/structRtAudioDeviceInfo-members.html | 28 + doc/html/structRtAudioDeviceInfo.html | 226 ++++++ .../structRtAudio_1_1RTAUDIO__DEVICE-members.html | 34 - doc/html/structRtAudio_1_1RTAUDIO__DEVICE.html | 384 --------- 21 files changed, 2124 insertions(+), 1806 deletions(-) create mode 100644 doc/html/RtError_8h-source.html delete mode 100644 doc/html/doxygen.gif create mode 100644 doc/html/doxygen.png create mode 100644 doc/html/functions_enum.html create mode 100644 doc/html/functions_eval.html create mode 100644 doc/html/functions_func.html create mode 100644 doc/html/functions_vars.html create mode 100644 doc/html/structRtAudioDeviceInfo-members.html create mode 100644 doc/html/structRtAudioDeviceInfo.html delete mode 100644 doc/html/structRtAudio_1_1RTAUDIO__DEVICE-members.html delete mode 100644 doc/html/structRtAudio_1_1RTAUDIO__DEVICE.html (limited to 'doc/html') diff --git a/doc/html/RtAudio_8h-source.html b/doc/html/RtAudio_8h-source.html index ffe382d..7c78353 100644 --- a/doc/html/RtAudio_8h-source.html +++ b/doc/html/RtAudio_8h-source.html @@ -7,328 +7,533 @@
Tutorial   Class/Enum List   File List   Compound Members  

- -

RtAudio.h

00001 /************************************************************************/
-00038 /************************************************************************/
+
+

RtAudio.h

00001 /************************************************************************/
+00038 /************************************************************************/
 00039 
-00040 #if !defined(__RTAUDIO_H)
-00041 #define __RTAUDIO_H
-00042 
-00043 #include <map>
-00044 
-00045 #if defined(__LINUX_ALSA__)
-00046   #include <alsa/asoundlib.h>
-00047   #include <pthread.h>
-00048   #include <unistd.h>
-00049 
-00050   typedef snd_pcm_t *AUDIO_HANDLE;
-00051   typedef int DEVICE_ID;
-00052   typedef pthread_t THREAD_HANDLE;
-00053   typedef pthread_mutex_t MUTEX;
-00054 
-00055 #elif defined(__LINUX_OSS__)
-00056   #include <pthread.h>
-00057   #include <unistd.h>
-00058 
-00059   typedef int AUDIO_HANDLE;
-00060   typedef int DEVICE_ID;
-00061   typedef pthread_t THREAD_HANDLE;
-00062   typedef pthread_mutex_t MUTEX;
-00063 
-00064 #elif defined(__WINDOWS_DS__)
-00065   #include <windows.h>
-00066   #include <process.h>
-00067 
-00068   // The following struct is used to hold the extra variables
-00069   // specific to the DirectSound implementation.
-00070   typedef struct {
-00071     void * object;
-00072     void * buffer;
-00073     UINT bufferPointer;
-00074   } AUDIO_HANDLE;
+00040 // RtAudio: Version 3.0, 11 March 2004
+00041 
+00042 #ifndef __RTAUDIO_H
+00043 #define __RTAUDIO_H
+00044 
+00045 #include "RtError.h"
+00046 #include <string>
+00047 #include <vector>
+00048 
+00049 // Operating system dependent thread functionality.
+00050 #if defined(__WINDOWS_DS__) || defined(__WINDOWS_ASIO__)
+00051   #include <windows.h>
+00052   #include <process.h>
+00053 
+00054   typedef unsigned long ThreadHandle;
+00055   typedef CRITICAL_SECTION StreamMutex;
+00056 
+00057 #else // Various unix flavors with pthread support.
+00058   #include <pthread.h>
+00059 
+00060   typedef pthread_t ThreadHandle;
+00061   typedef pthread_mutex_t StreamMutex;
+00062 
+00063 #endif
+00064 
+00065 // This global structure type is used to pass callback information
+00066 // between the private RtAudio stream structure and global callback
+00067 // handling functions.
+00068 struct CallbackInfo {
+00069   void *object;    // Used as a "this" pointer.
+00070   ThreadHandle thread;
+00071   bool usingCallback;
+00072   void *callback;
+00073   void *userData;
+00074   void *apiInfo;   // void pointer for API specific callback information
 00075 
-00076   typedef LPGUID DEVICE_ID;
-00077   typedef unsigned long THREAD_HANDLE;
-00078   typedef CRITICAL_SECTION MUTEX;
-00079 
-00080 #elif defined(__WINDOWS_ASIO__)
-00081   #include <windows.h>
-00082   #include <process.h>
-00083 
-00084   typedef int AUDIO_HANDLE;
-00085   typedef int DEVICE_ID;
-00086   typedef unsigned long THREAD_HANDLE;
-00087   typedef CRITICAL_SECTION MUTEX;
-00088 
-00089 #elif defined(__IRIX_AL__)
-00090   #include <dmedia/audio.h>
-00091   #include <pthread.h>
-00092   #include <unistd.h>
-00093 
-00094   typedef ALport AUDIO_HANDLE;
-00095   typedef long DEVICE_ID;
-00096   typedef pthread_t THREAD_HANDLE;
-00097   typedef pthread_mutex_t MUTEX;
-00098 
-00099 #elif defined(__MACOSX_CORE__)
-00100 
-00101   #include <CoreAudio/AudioHardware.h>
-00102   #include <pthread.h>
-00103 
-00104   typedef unsigned int AUDIO_HANDLE;
-00105   typedef AudioDeviceID DEVICE_ID;
-00106   typedef pthread_t THREAD_HANDLE;
-00107   typedef pthread_mutex_t MUTEX;
-00108 
-00109 #endif
-00110 
-00111 
-00112 /************************************************************************/
-00125 /************************************************************************/
-00126 
-00127 class RtError
-00128 {
-00129 public:
-00131   enum TYPE {
-00132     WARNING,
-00133     DEBUG_WARNING,
-00134     UNSPECIFIED,
-00135     NO_DEVICES_FOUND,
-00136     INVALID_DEVICE,
-00137     INVALID_STREAM,
-00138     MEMORY_ERROR,
-00139     INVALID_PARAMETER,
-00140     DRIVER_ERROR,
-00141     SYSTEM_ERROR,
-00142     THREAD_ERROR
-00143   };
-00144 
-00145 protected:
-00146   char error_message[256];
-00147   TYPE type;
+00076   // Default constructor.
+00077   CallbackInfo()
+00078     :object(0), usingCallback(false), callback(0),
+00079      userData(0), apiInfo(0) {}
+00080 };
+00081 
+00082 // Support for signed integers and floats.  Audio data fed to/from
+00083 // the tickStream() routine is assumed to ALWAYS be in host
+00084 // byte order.  The internal routines will automatically take care of
+00085 // any necessary byte-swapping between the host format and the
+00086 // soundcard.  Thus, endian-ness is not a concern in the following
+00087 // format definitions.
+00088 typedef unsigned long RtAudioFormat;
+00089 static const RtAudioFormat RTAUDIO_SINT8 = 0x1;    
+00090 static const RtAudioFormat RTAUDIO_SINT16 = 0x2;   
+00091 static const RtAudioFormat RTAUDIO_SINT24 = 0x4;   
+00092 static const RtAudioFormat RTAUDIO_SINT32 = 0x8;   
+00093 static const RtAudioFormat RTAUDIO_FLOAT32 = 0x10; 
+00094 static const RtAudioFormat RTAUDIO_FLOAT64 = 0x20; 
+00096 typedef int (*RtAudioCallback)(char *buffer, int bufferSize, void *userData);
+00097 
+00099 struct RtAudioDeviceInfo {
+00100   std::string name;      
+00101   bool probed;          
+00102   int outputChannels;   
+00103   int inputChannels;    
+00104   int duplexChannels;   
+00105   bool isDefault;       
+00106   std::vector<int> sampleRates; 
+00107   RtAudioFormat nativeFormats;  
+00109   // Default constructor.
+00110   RtAudioDeviceInfo()
+00111     :probed(false), outputChannels(0), inputChannels(0),
+00112        duplexChannels(0), isDefault(false), nativeFormats(0) {}
+00113 };
+00114 
+00115 // **************************************************************** //
+00116 //
+00117 // RtApi class declaration.
+00118 //
+00119 // Note that RtApi is an abstract base class and cannot be
+00120 // explicitly instantiated.  The class RtAudio will create an
+00121 // instance of an RtApi subclass (RtApiOss, RtApiAlsa,
+00122 // RtApiJack, RtApiCore, RtApiAl, RtApiDs, or RtApiAsio).
+00123 //
+00124 // **************************************************************** //
+00125 
+00126 class RtApi
+00127 {
+00128 public:
+00129 
+00130   RtApi();
+00131   virtual ~RtApi();
+00132   void openStream( int outputDevice, int outputChannels,
+00133                    int inputDevice, int inputChannels,
+00134                    RtAudioFormat format, int sampleRate,
+00135                    int *bufferSize, int numberOfBuffers );
+00136   virtual void setStreamCallback( RtAudioCallback callback, void *userData ) = 0;
+00137   virtual void cancelStreamCallback() = 0;
+00138   int getDeviceCount(void);
+00139   RtAudioDeviceInfo getDeviceInfo( int device );
+00140   char * const getStreamBuffer();
+00141   virtual void tickStream() = 0;
+00142   virtual void closeStream();
+00143   virtual void startStream() = 0;
+00144   virtual void stopStream() = 0;
+00145   virtual void abortStream() = 0;
+00146 
+00147 protected:
 00148 
-00149 public:
-00151   RtError(const char *p, TYPE tipe = RtError::UNSPECIFIED);
-00152 
-00154   virtual ~RtError(void);
-00155 
-00157   virtual void printMessage(void);
-00158 
-00160   virtual const TYPE& getType(void) { return type; }
-00161 
-00163   virtual const char *getMessage(void) { return error_message; }
-00164 };
+00149   static const unsigned int MAX_SAMPLE_RATES;
+00150   static const unsigned int SAMPLE_RATES[];
+00151 
+00152   enum { FAILURE, SUCCESS };
+00153 
+00154   enum StreamMode {
+00155     OUTPUT,
+00156     INPUT,
+00157     DUPLEX,
+00158     UNINITIALIZED = -75
+00159   };
+00160 
+00161   enum StreamState {
+00162     STREAM_STOPPED,
+00163     STREAM_RUNNING
+00164   };
 00165 
-00166 
-00167 // This public structure type is used to pass callback information
-00168 // between the private RtAudio stream structure and global callback
-00169 // handling functions.
-00170 typedef struct {
-00171   void *object;  // Used as a "this" pointer.
-00172   int streamId;
-00173   DEVICE_ID device[2];
-00174   THREAD_HANDLE thread;
-00175   void *callback;
-00176   void *buffers;
-00177   unsigned long waitTime;
-00178   bool blockTick;
-00179   bool stopStream;
-00180   bool usingCallback;
-00181   void *userData;
-00182 } CALLBACK_INFO;
-00183 
-00184 
-00185 // *************************************************** //
-00186 //
-00187 // RtAudio class declaration.
-00188 //
-00189 // *************************************************** //
-00190 
-00191 class RtAudio
-00192 {
-00193 public:
-00194 
-00195   // Support for signed integers and floats.  Audio data fed to/from
-00196   // the tickStream() routine is assumed to ALWAYS be in host
-00197   // byte order.  The internal routines will automatically take care of
-00198   // any necessary byte-swapping between the host format and the
-00199   // soundcard.  Thus, endian-ness is not a concern in the following
-00200   // format definitions.
-00201   typedef unsigned long RTAUDIO_FORMAT;
-00202   static const RTAUDIO_FORMAT RTAUDIO_SINT8; 
-00203   static const RTAUDIO_FORMAT RTAUDIO_SINT16; 
-00204   static const RTAUDIO_FORMAT RTAUDIO_SINT24; 
-00205   static const RTAUDIO_FORMAT RTAUDIO_SINT32; 
-00206   static const RTAUDIO_FORMAT RTAUDIO_FLOAT32; 
-00207   static const RTAUDIO_FORMAT RTAUDIO_FLOAT64; 
-00209   //static const int MAX_SAMPLE_RATES = 14;
-00210   enum { MAX_SAMPLE_RATES = 14 };
-00211 
-00212   typedef int (*RTAUDIO_CALLBACK)(char *buffer, int bufferSize, void *userData);
-00213 
-00215   typedef struct {
-00216     char name[128];    
-00217     DEVICE_ID id[2];  /* No value reported by getDeviceInfo(). */
-00218     bool probed;       
-00219     int maxOutputChannels; 
-00220     int maxInputChannels;  
-00221     int maxDuplexChannels; 
-00222     int minOutputChannels; 
-00223     int minInputChannels;  
-00224     int minDuplexChannels; 
-00225     bool hasDuplexSupport; 
-00226     bool isDefault;        
-00227     int nSampleRates;      
-00228     int sampleRates[MAX_SAMPLE_RATES]; 
-00229     RTAUDIO_FORMAT nativeFormats;     
-00230   } RTAUDIO_DEVICE;
+00166   // A protected structure for audio streams.
+00167   struct RtApiStream {
+00168     int device[2];          // Playback and record, respectively.
+00169     void *apiHandle;        // void pointer for API specific stream handle information
+00170     StreamMode mode;         // OUTPUT, INPUT, or DUPLEX.
+00171     StreamState state;       // STOPPED or RUNNING
+00172     char *userBuffer;
+00173     char *deviceBuffer;
+00174     bool doConvertBuffer[2]; // Playback and record, respectively.
+00175     bool deInterleave[2];    // Playback and record, respectively.
+00176     bool doByteSwap[2];      // Playback and record, respectively.
+00177     int sampleRate;
+00178     int bufferSize;
+00179     int nBuffers;
+00180     int nUserChannels[2];    // Playback and record, respectively.
+00181     int nDeviceChannels[2];  // Playback and record channels, respectively.
+00182     RtAudioFormat userFormat;
+00183     RtAudioFormat deviceFormat[2]; // Playback and record, respectively.
+00184     StreamMutex mutex;
+00185     CallbackInfo callbackInfo;
+00186 
+00187     RtApiStream()
+00188       :apiHandle(0), userBuffer(0), deviceBuffer(0) {}
+00189     //      :apiHandle(0), mode(UNINITIALIZED), state(STREAM_STOPPED),
+00190     //       userBuffer(0), deviceBuffer(0) {}
+00191   };
+00192 
+00193   // A protected device structure for audio devices.
+00194   struct RtApiDevice {
+00195     std::string name;      
+00196     bool probed;           
+00197     void *apiDeviceId;     // void pointer for API specific device information
+00198     int maxOutputChannels; 
+00199     int maxInputChannels;  
+00200     int maxDuplexChannels; 
+00201     int minOutputChannels; 
+00202     int minInputChannels;  
+00203     int minDuplexChannels; 
+00204     bool hasDuplexSupport; 
+00205     bool isDefault;        
+00206     std::vector<int> sampleRates; 
+00207     RtAudioFormat nativeFormats;  
+00209     // Default constructor.
+00210     RtApiDevice()
+00211       :probed(false), apiDeviceId(0), maxOutputChannels(0), maxInputChannels(0),
+00212        maxDuplexChannels(0), minOutputChannels(0), minInputChannels(0),
+00213        minDuplexChannels(0), isDefault(false), nativeFormats(0) {}
+00214   };
+00215 
+00216   typedef signed short Int16;
+00217   typedef signed int Int32;
+00218   typedef float Float32;
+00219   typedef double Float64;
+00220 
+00221   char message_[256];
+00222   int nDevices_;
+00223   std::vector<RtApiDevice> devices_;
+00224   RtApiStream stream_;
+00225 
+00230   virtual void initialize(void) = 0;
 00231 
-00233 
-00239   RtAudio();
-00240 
-00242 
-00253   RtAudio(int *streamId,
-00254           int outputDevice, int outputChannels,
-00255           int inputDevice, int inputChannels,
-00256           RTAUDIO_FORMAT format, int sampleRate,
-00257           int *bufferSize, int numberOfBuffers);
-00258 
-00260 
-00264   ~RtAudio();
+00240   virtual void probeDeviceInfo( RtApiDevice *info );
+00241 
+00250   virtual bool probeDeviceOpen( int device, StreamMode mode, int channels, 
+00251                                 int sampleRate, RtAudioFormat format,
+00252                                 int *bufferSize, int numberOfBuffers );
+00253 
+00258   virtual int getDefaultInputDevice(void);
+00259 
+00264   virtual int getDefaultOutputDevice(void);
 00265 
-00267 
-00294   int openStream(int outputDevice, int outputChannels,
-00295                  int inputDevice, int inputChannels,
-00296                  RTAUDIO_FORMAT format, int sampleRate,
-00297                  int *bufferSize, int numberOfBuffers);
-00298 
-00300 
-00319   void setStreamCallback(int streamId, RTAUDIO_CALLBACK callback, void *userData);
-00320 
-00322 
-00329   void cancelStreamCallback(int streamId);
-00330 
-00332   int getDeviceCount(void);
-00333 
-00335 
-00343   void getDeviceInfo(int device, RTAUDIO_DEVICE *info);
-00344 
-00346 
-00351   char * const getStreamBuffer(int streamId);
-00352 
-00354 
-00359   void tickStream(int streamId);
+00267   void clearDeviceInfo( RtApiDevice *info );
+00268 
+00270   void clearStreamInfo();
+00271 
+00273   void error( RtError::Type type );
+00274 
+00279   void verifyStream();
+00280 
+00285   void convertStreamBuffer( StreamMode mode );
+00286 
+00288   void byteSwapBuffer( char *buffer, int samples, RtAudioFormat format );
+00289 
+00291   int formatBytes( RtAudioFormat format );
+00292 };
+00293 
+00294 
+00295 // **************************************************************** //
+00296 //
+00297 // RtAudio class declaration.
+00298 //
+00299 // RtAudio is a "controller" used to select an available audio i/o
+00300 // interface.  It presents a common API for the user to call but all
+00301 // functionality is implemented by the class RtAudioApi and its
+00302 // subclasses.  RtAudio creates an instance of an RtAudioApi subclass
+00303 // based on the user's API choice.  If no choice is made, RtAudio
+00304 // attempts to make a "logical" API selection.
+00305 //
+00306 // **************************************************************** //
+00307 
+00308 class RtAudio
+00309 {
+00310 public:
+00311 
+00313   enum RtAudioApi {
+00314     UNSPECIFIED,    
+00315     LINUX_ALSA,     
+00316     LINUX_OSS,      
+00317     LINUX_JACK,     
+00318     MACOSX_CORE,    
+00319     IRIX_AL,        
+00320     WINDOWS_ASIO,   
+00321     WINDOWS_DS      
+00322   };
+00323 
+00325 
+00335   RtAudio( RtAudioApi api=UNSPECIFIED );
+00336 
+00338 
+00349   RtAudio( int outputDevice, int outputChannels,
+00350            int inputDevice, int inputChannels,
+00351            RtAudioFormat format, int sampleRate,
+00352            int *bufferSize, int numberOfBuffers, RtAudioApi api=UNSPECIFIED );
+00353 
+00355 
+00359   ~RtAudio();
 00360 
 00362 
-00366   void closeStream(int streamId);
-00367 
-00369 
-00373   void startStream(int streamId);
-00374 
-00376 
-00380   void stopStream(int streamId);
-00381 
-00383 
-00387   void abortStream(int streamId);
-00388 
-00390 
-00395   int streamWillBlock(int streamId);
-00396 
-00397 #if (defined(__MACOSX_CORE__) || defined(__WINDOWS_ASIO__))
-00398   // This function is intended for internal use only.  It must be
-00399   // public because it is called by the internal callback handler,
-00400   // which is not a member of RtAudio.  External use of this function
-00401   // will most likely produce highly undesireable results!
-00402   void callbackEvent(int streamId, DEVICE_ID deviceId, void *inData, void *outData);
-00403 #endif
-00404 
-00405 protected:
-00406 
-00407 private:
-00408 
-00409   static const unsigned int SAMPLE_RATES[MAX_SAMPLE_RATES];
-00410 
-00411   enum { FAILURE, SUCCESS };
-00412 
-00413   enum STREAM_MODE {
-00414     OUTPUT,
-00415     INPUT,
-00416     DUPLEX,
-00417     UNINITIALIZED = -75
-00418   };
-00419 
-00420   enum STREAM_STATE {
-00421     STREAM_STOPPED,
-00422     STREAM_RUNNING
-00423   };
+00388   void openStream( int outputDevice, int outputChannels,
+00389                    int inputDevice, int inputChannels,
+00390                    RtAudioFormat format, int sampleRate,
+00391                    int *bufferSize, int numberOfBuffers );
+00392 
+00394 
+00413   void setStreamCallback(RtAudioCallback callback, void *userData) { rtapi_->setStreamCallback( callback, userData ); };
+00414 
+00416 
+00423   void cancelStreamCallback() { rtapi_->cancelStreamCallback(); };
 00424 
-00425   typedef struct {
-00426     int device[2];          // Playback and record, respectively.
-00427     STREAM_MODE mode;       // OUTPUT, INPUT, or DUPLEX.
-00428     AUDIO_HANDLE handle[2]; // Playback and record handles, respectively.
-00429     STREAM_STATE state;     // STOPPED or RUNNING
-00430     char *userBuffer;
-00431     char *deviceBuffer;
-00432     bool doConvertBuffer[2]; // Playback and record, respectively.
-00433     bool deInterleave[2];    // Playback and record, respectively.
-00434     bool doByteSwap[2];      // Playback and record, respectively.
-00435     int sampleRate;
-00436     int bufferSize;
-00437     int nBuffers;
-00438     int nUserChannels[2];    // Playback and record, respectively.
-00439     int nDeviceChannels[2];  // Playback and record channels, respectively.
-00440     RTAUDIO_FORMAT userFormat;
-00441     RTAUDIO_FORMAT deviceFormat[2]; // Playback and record, respectively.
-00442     MUTEX mutex;
-00443     CALLBACK_INFO callbackInfo;
-00444   } RTAUDIO_STREAM;
-00445 
-00446   typedef signed short INT16;
-00447   typedef signed int INT32;
-00448   typedef float FLOAT32;
-00449   typedef double FLOAT64;
-00450 
-00451   char message[256];
-00452   int nDevices;
-00453   RTAUDIO_DEVICE *devices;
+00426   int getDeviceCount(void) { return rtapi_->getDeviceCount(); };
+00427 
+00429 
+00437   RtAudioDeviceInfo getDeviceInfo(int device) { return rtapi_->getDeviceInfo( device ); };
+00438 
+00440 
+00445   char * const getStreamBuffer() { return rtapi_->getStreamBuffer(); };
+00446 
+00448 
+00453   void tickStream() { rtapi_->tickStream(); };
 00454 
-00455   std::map<int, void *> streams;
 00456 
-00458   void error(RtError::TYPE type);
-00459 
-00464   void initialize(void);
-00465 
-00470   int getDefaultInputDevice(void);
-00471 
-00476   int getDefaultOutputDevice(void);
+00460   void closeStream()  { rtapi_->closeStream(); };
+00461 
+00463 
+00467   void startStream() { rtapi_->startStream(); };
+00468 
+00470 
+00474   void stopStream() { rtapi_->stopStream(); };
+00475 
 00477 
-00479   void clearDeviceInfo(RTAUDIO_DEVICE *info);
-00480 
-00488   void probeDeviceInfo(RTAUDIO_DEVICE *info);
-00489 
-00496   bool probeDeviceOpen(int device, RTAUDIO_STREAM *stream,
-00497                        STREAM_MODE mode, int channels, 
-00498                        int sampleRate, RTAUDIO_FORMAT format,
-00499                        int *bufferSize, int numberOfBuffers);
-00500 
-00507   void *verifyStream(int streamId);
-00508 
-00513   void convertStreamBuffer(RTAUDIO_STREAM *stream, STREAM_MODE mode);
-00514 
-00516   void byteSwapBuffer(char *buffer, int samples, RTAUDIO_FORMAT format);
-00517 
-00519   int formatBytes(RTAUDIO_FORMAT format);
-00520 };
-00521 
-00522 // Define the following flag to have extra information spewed to stderr.
-00523 //#define __RTAUDIO_DEBUG__
-00524 
-00525 #endif
-

+00481 void abortStream() { rtapi_->abortStream(); }; +00482 +00483 +00484 protected: +00485 +00486 void initialize( RtAudioApi api ); +00487 +00488 RtApi *rtapi_; +00489 }; +00490 +00491 +00492 // RtApi Subclass prototypes. +00493 +00494 #if defined(__LINUX_ALSA__) +00495 +00496 class RtApiAlsa: public RtApi +00497 { +00498 public: +00499 +00500 RtApiAlsa(); +00501 ~RtApiAlsa(); +00502 void tickStream(); +00503 void closeStream(); +00504 void startStream(); +00505 void stopStream(); +00506 void abortStream(); +00507 int streamWillBlock(); +00508 void setStreamCallback( RtAudioCallback callback, void *userData ); +00509 void cancelStreamCallback(); +00510 +00511 private: +00512 +00513 void initialize(void); +00514 void probeDeviceInfo( RtApiDevice *info ); +00515 bool probeDeviceOpen( int device, StreamMode mode, int channels, +00516 int sampleRate, RtAudioFormat format, +00517 int *bufferSize, int numberOfBuffers ); +00518 }; +00519 +00520 #endif +00521 +00522 #if defined(__LINUX_JACK__) +00523 +00524 class RtApiJack: public RtApi +00525 { +00526 public: +00527 +00528 RtApiJack(); +00529 ~RtApiJack(); +00530 void tickStream(); +00531 void closeStream(); +00532 void startStream(); +00533 void stopStream(); +00534 void abortStream(); +00535 void setStreamCallback( RtAudioCallback callback, void *userData ); +00536 void cancelStreamCallback(); +00537 // This function is intended for internal use only. It must be +00538 // public because it is called by the internal callback handler, +00539 // which is not a member of RtAudio. External use of this function +00540 // will most likely produce highly undesireable results! +00541 void callbackEvent( unsigned long nframes ); +00542 +00543 private: +00544 +00545 void initialize(void); +00546 void probeDeviceInfo( RtApiDevice *info ); +00547 bool probeDeviceOpen( int device, StreamMode mode, int channels, +00548 int sampleRate, RtAudioFormat format, +00549 int *bufferSize, int numberOfBuffers ); +00550 }; +00551 +00552 #endif +00553 +00554 #if defined(__LINUX_OSS__) +00555 +00556 class RtApiOss: public RtApi +00557 { +00558 public: +00559 +00560 RtApiOss(); +00561 ~RtApiOss(); +00562 void tickStream(); +00563 void closeStream(); +00564 void startStream(); +00565 void stopStream(); +00566 void abortStream(); +00567 int streamWillBlock(); +00568 void setStreamCallback( RtAudioCallback callback, void *userData ); +00569 void cancelStreamCallback(); +00570 +00571 private: +00572 +00573 void initialize(void); +00574 void probeDeviceInfo( RtApiDevice *info ); +00575 bool probeDeviceOpen( int device, StreamMode mode, int channels, +00576 int sampleRate, RtAudioFormat format, +00577 int *bufferSize, int numberOfBuffers ); +00578 }; +00579 +00580 #endif +00581 +00582 #if defined(__MACOSX_CORE__) +00583 +00584 #include <CoreAudio/AudioHardware.h> +00585 +00586 class RtApiCore: public RtApi +00587 { +00588 public: +00589 +00590 RtApiCore(); +00591 ~RtApiCore(); +00592 int getDefaultOutputDevice(void); +00593 int getDefaultInputDevice(void); +00594 void tickStream(); +00595 void closeStream(); +00596 void startStream(); +00597 void stopStream(); +00598 void abortStream(); +00599 void setStreamCallback( RtAudioCallback callback, void *userData ); +00600 void cancelStreamCallback(); +00601 +00602 // This function is intended for internal use only. It must be +00603 // public because it is called by the internal callback handler, +00604 // which is not a member of RtAudio. External use of this function +00605 // will most likely produce highly undesireable results! +00606 void callbackEvent( AudioDeviceID deviceId, void *inData, void *outData ); +00607 +00608 private: +00609 +00610 void initialize(void); +00611 void probeDeviceInfo( RtApiDevice *info ); +00612 bool probeDeviceOpen( int device, StreamMode mode, int channels, +00613 int sampleRate, RtAudioFormat format, +00614 int *bufferSize, int numberOfBuffers ); +00615 }; +00616 +00617 #endif +00618 +00619 #if defined(__WINDOWS_DS__) +00620 +00621 class RtApiDs: public RtApi +00622 { +00623 public: +00624 +00625 RtApiDs(); +00626 ~RtApiDs(); +00627 int getDefaultOutputDevice(void); +00628 int getDefaultInputDevice(void); +00629 void tickStream(); +00630 void closeStream(); +00631 void startStream(); +00632 void stopStream(); +00633 void abortStream(); +00634 int streamWillBlock(); +00635 void setStreamCallback( RtAudioCallback callback, void *userData ); +00636 void cancelStreamCallback(); +00637 +00638 private: +00639 +00640 void initialize(void); +00641 void probeDeviceInfo( RtApiDevice *info ); +00642 bool probeDeviceOpen( int device, StreamMode mode, int channels, +00643 int sampleRate, RtAudioFormat format, +00644 int *bufferSize, int numberOfBuffers ); +00645 }; +00646 +00647 #endif +00648 +00649 #if defined(__WINDOWS_ASIO__) +00650 +00651 class RtApiAsio: public RtApi +00652 { +00653 public: +00654 +00655 RtApiAsio(); +00656 ~RtApiAsio(); +00657 void tickStream(); +00658 void closeStream(); +00659 void startStream(); +00660 void stopStream(); +00661 void abortStream(); +00662 void setStreamCallback( RtAudioCallback callback, void *userData ); +00663 void cancelStreamCallback(); +00664 +00665 // This function is intended for internal use only. It must be +00666 // public because it is called by the internal callback handler, +00667 // which is not a member of RtAudio. External use of this function +00668 // will most likely produce highly undesireable results! +00669 void callbackEvent( long bufferIndex ); +00670 +00671 private: +00672 +00673 void initialize(void); +00674 void probeDeviceInfo( RtApiDevice *info ); +00675 bool probeDeviceOpen( int device, StreamMode mode, int channels, +00676 int sampleRate, RtAudioFormat format, +00677 int *bufferSize, int numberOfBuffers ); +00678 }; +00679 +00680 #endif +00681 +00682 #if defined(__IRIX_AL__) +00683 +00684 class RtApiAl: public RtApi +00685 { +00686 public: +00687 +00688 RtApiAl(); +00689 ~RtApiAl(); +00690 int getDefaultOutputDevice(void); +00691 int getDefaultInputDevice(void); +00692 void tickStream(); +00693 void closeStream(); +00694 void startStream(); +00695 void stopStream(); +00696 void abortStream(); +00697 int streamWillBlock(); +00698 void setStreamCallback( RtAudioCallback callback, void *userData ); +00699 void cancelStreamCallback(); +00700 +00701 private: +00702 +00703 void initialize(void); +00704 void probeDeviceInfo( RtApiDevice *info ); +00705 bool probeDeviceOpen( int device, StreamMode mode, int channels, +00706 int sampleRate, RtAudioFormat format, +00707 int *bufferSize, int numberOfBuffers ); +00708 }; +00709 +00710 #endif +00711 +00712 // Define the following flag to have extra information spewed to stderr. +00713 //#define __RTAUDIO_DEBUG__ +00714 +00715 #endif +

-
- ©2001-2002 Gary P. Scavone, CCRMA, Stanford University. All Rights Reserved.
- Maintained by Gary P. Scavone, gary@ccrma.stanford.edu

+ +
©2001-2004 Gary P. Scavone, McGill University. All Rights Reserved.
+ Maintained by Gary P. Scavone, gary@music.mcgill.ca
diff --git a/doc/html/RtError_8h-source.html b/doc/html/RtError_8h-source.html new file mode 100644 index 0000000..d216750 --- /dev/null +++ b/doc/html/RtError_8h-source.html @@ -0,0 +1,64 @@ + + +The RtAudio Tutorial + + + +

+Tutorial   Class/Enum List   File List   Compound Members  
+
+ +

RtError.h

00001 /************************************************************************/
+00010 /************************************************************************/
+00011 
+00012 #ifndef RTERROR_H
+00013 #define RTERROR_H
+00014 
+00015 #include <iostream>
+00016 #include <string>
+00017 
+00018 class RtError
+00019 {
+00020 public:
+00022   enum Type {
+00023     WARNING,           
+00024     DEBUG_WARNING,     
+00025     UNSPECIFIED,       
+00026     NO_DEVICES_FOUND,  
+00027     INVALID_DEVICE,    
+00028     INVALID_STREAM,    
+00029     MEMORY_ERROR,      
+00030     INVALID_PARAMETER, 
+00031     DRIVER_ERROR,      
+00032     SYSTEM_ERROR,      
+00033     THREAD_ERROR       
+00034   };
+00035 
+00036 protected:
+00037   std::string message_;
+00038   Type type_;
+00039 
+00040 public:
+00042   RtError(const std::string& message, Type type = RtError::UNSPECIFIED) : message_(message), type_(type){}
+00043 
+00045   virtual ~RtError(void) {};
+00046 
+00048   virtual void printMessage(void) { std::cerr << '\n' << message_ << "\n\n"; }
+00049 
+00051   virtual const Type& getType(void) { return type_; }
+00052 
+00054   virtual const std::string& getMessage(void) { return message_; }
+00055 
+00057   virtual const char *getMessageString(void) { return message_.c_str(); }
+00058 };
+00059 
+00060 #endif
+

+ + + +
©2001-2004 Gary P. Scavone, McGill University. All Rights Reserved.
+ Maintained by Gary P. Scavone, gary@music.mcgill.ca
+ + + diff --git a/doc/html/annotated.html b/doc/html/annotated.html index f298ed2..55c6533 100644 --- a/doc/html/annotated.html +++ b/doc/html/annotated.html @@ -7,17 +7,17 @@
Tutorial   Class/Enum List   File List   Compound Members  

- -

RtAudio Compound List

Here are the classes, structs, unions and interfaces with brief descriptions: + +

RtAudio Class List

Here are the classes, structs, unions and interfaces with brief descriptions: + + + +
RtAudioRealtime audio i/o C++ classes
RtAudioDeviceInfoThe public device information structure for returning queried values
RtErrorException handling class for RtAudio & RtMidi

-
- ©2001-2002 Gary P. Scavone, CCRMA, Stanford University. All Rights Reserved.
- Maintained by Gary P. Scavone, gary@ccrma.stanford.edu

+ +
©2001-2004 Gary P. Scavone, McGill University. All Rights Reserved.
+ Maintained by Gary P. Scavone, gary@music.mcgill.ca
diff --git a/doc/html/classRtAudio-members.html b/doc/html/classRtAudio-members.html index d4fcffb..49997ae 100644 --- a/doc/html/classRtAudio-members.html +++ b/doc/html/classRtAudio-members.html @@ -7,35 +7,36 @@

Tutorial   Class/Enum List   File List   Compound Members  

- -

RtAudio Member List

This is the complete list of members for RtAudio, including all inherited members. -
+ +

RtAudio Member List

This is the complete list of members for RtAudio, including all inherited members. + + + + + + + + + + + + + + + + + + + + + + + +
abortStream()RtAudio [inline]
cancelStreamCallback()RtAudio [inline]
closeStream()RtAudio [inline]
getDeviceCount(void)RtAudio [inline]
getDeviceInfo(int device)RtAudio [inline]
getStreamBuffer()RtAudio [inline]
IRIX_AL enum valueRtAudio
LINUX_ALSA enum valueRtAudio
LINUX_JACK enum valueRtAudio
LINUX_OSS enum valueRtAudio
MACOSX_CORE enum valueRtAudio
openStream(int outputDevice, int outputChannels, int inputDevice, int inputChannels, RtAudioFormat format, int sampleRate, int *bufferSize, int numberOfBuffers)RtAudio
RtAudio(RtAudioApi api=UNSPECIFIED)RtAudio
RtAudio(int outputDevice, int outputChannels, int inputDevice, int inputChannels, RtAudioFormat format, int sampleRate, int *bufferSize, int numberOfBuffers, RtAudioApi api=UNSPECIFIED)RtAudio
RtAudioApi enum nameRtAudio
setStreamCallback(RtAudioCallback callback, void *userData)RtAudio [inline]
startStream()RtAudio [inline]
stopStream()RtAudio [inline]
tickStream()RtAudio [inline]
UNSPECIFIED enum valueRtAudio
WINDOWS_ASIO enum valueRtAudio
WINDOWS_DS enum valueRtAudio
~RtAudio()RtAudio

-
- ©2001-2002 Gary P. Scavone, CCRMA, Stanford University. All Rights Reserved.
- Maintained by Gary P. Scavone, gary@ccrma.stanford.edu

+ +
©2001-2004 Gary P. Scavone, McGill University. All Rights Reserved.
+ Maintained by Gary P. Scavone, gary@music.mcgill.ca
diff --git a/doc/html/classRtAudio.html b/doc/html/classRtAudio.html index 157d97a..a66b7d8 100644 --- a/doc/html/classRtAudio.html +++ b/doc/html/classRtAudio.html @@ -7,83 +7,143 @@

Tutorial   Class/Enum List   File List   Compound Members  

- -

RtAudio Class Reference

Realtime audio i/o C++ class. + +

RtAudio Class Reference

Realtime audio i/o C++ classes. More...

#include <RtAudio.h>

List of all members. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Methods

 RtAudio ()
 The default constructor. More...

 RtAudio (int *streamId, int outputDevice, int outputChannels, int inputDevice, int inputChannels, RTAUDIO_FORMAT format, int sampleRate, int *bufferSize, int numberOfBuffers)
 A constructor which can be used to open a stream during instantiation. More...

 ~RtAudio ()
 The destructor. More...

int openStream (int outputDevice, int outputChannels, int inputDevice, int inputChannels, RTAUDIO_FORMAT format, int sampleRate, int *bufferSize, int numberOfBuffers)
 A public method for opening a stream with the specified parameters. More...

void setStreamCallback (int streamId, RTAUDIO_CALLBACK callback, void *userData)
 A public method which sets a user-defined callback function for a given stream. More...

void cancelStreamCallback (int streamId)
 A public method which cancels a callback process and function for a given stream. More...

-int getDeviceCount (void)
 A public method which returns the number of audio devices found.

void getDeviceInfo (int device, RTAUDIO_DEVICE *info)
 Fill a user-supplied RTAUDIO_DEVICE structure for a specified device number. More...

char* const getStreamBuffer (int streamId)
 A public method which returns a pointer to the buffer for an open stream. More...

void tickStream (int streamId)
 Public method used to trigger processing of input/output data for a stream. More...

void closeStream (int streamId)
 Public method which closes a stream and frees any associated buffers. More...

void startStream (int streamId)
 Public method which starts a stream. More...

void stopStream (int streamId)
 Stop a stream, allowing any samples remaining in the queue to be played out and/or read in. More...

void abortStream (int streamId)
 Stop a stream, discarding any samples remaining in the input/output queue. More...

int streamWillBlock (int streamId)
 Queries a stream to determine whether a call to the tickStream() method will block. More...


Static Public Attributes

const RTAUDIO_FORMAT RTAUDIO_SINT8
const RTAUDIO_FORMAT RTAUDIO_SINT16
const RTAUDIO_FORMAT RTAUDIO_SINT24
const RTAUDIO_FORMAT RTAUDIO_SINT32
const RTAUDIO_FORMAT RTAUDIO_FLOAT32
const RTAUDIO_FORMAT RTAUDIO_FLOAT64

Public Types

enum  RtAudioApi {
+  UNSPECIFIED, +LINUX_ALSA, +LINUX_OSS, +LINUX_JACK, +
+  MACOSX_CORE, +IRIX_AL, +WINDOWS_ASIO, +WINDOWS_DS +
+ }
 Audio API specifier arguments. More...


Public Member Functions

 RtAudio (RtAudioApi api=UNSPECIFIED)
 The default class constructor.

 RtAudio (int outputDevice, int outputChannels, int inputDevice, int inputChannels, RtAudioFormat format, int sampleRate, int *bufferSize, int numberOfBuffers, RtAudioApi api=UNSPECIFIED)
 A constructor which can be used to open a stream during instantiation.

 ~RtAudio ()
 The destructor.

void openStream (int outputDevice, int outputChannels, int inputDevice, int inputChannels, RtAudioFormat format, int sampleRate, int *bufferSize, int numberOfBuffers)
 A public method for opening a stream with the specified parameters.

void setStreamCallback (RtAudioCallback callback, void *userData)
 A public method which sets a user-defined callback function for a given stream.

void cancelStreamCallback ()
 A public method which cancels a callback process and function for the stream.

+int getDeviceCount (void)
 A public method which returns the number of audio devices found.

RtAudioDeviceInfo getDeviceInfo (int device)
 Return an RtAudioDeviceInfo structure for a specified device number.

char *const  getStreamBuffer ()
 A public method which returns a pointer to the buffer for an open stream.

void tickStream ()
 Public method used to trigger processing of input/output data for a stream.

void closeStream ()
 Public method which closes a stream and frees any associated buffers.

void startStream ()
 Public method which starts a stream.

void stopStream ()
 Stop a stream, allowing any samples remaining in the queue to be played out and/or read in.

void abortStream ()
 Stop a stream, discarding any samples remaining in the input/output queue.


Detailed Description

-Realtime audio i/o C++ class. -

-RtAudio provides a common API (Application Programming Interface) for realtime audio input/output across Linux (native ALSA and OSS), SGI, Macintosh OS X (CoreAudio), and Windows (DirectSound and ASIO) operating systems. -

-RtAudio WWW site: http://www-ccrma.stanford.edu/~gary/rtaudio/ -

-RtAudio: a realtime audio i/o C++ class Copyright (c) 2001-2002 Gary P. Scavone -

-Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -

-The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +Realtime audio i/o C++ classes. +

+RtAudio provides a common API (Application Programming Interface) for realtime audio input/output across Linux (native ALSA, Jack, and OSS), SGI, Macintosh OS X (CoreAudio), and Windows (DirectSound and ASIO) operating systems.

+RtAudio WWW site: http://music.mcgill.ca/~gary/rtaudio/

+RtAudio: a realtime audio i/o C++ class Copyright (c) 2001-2004 Gary P. Scavone

+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

+Any person wishing to distribute modifications to the Software is requested to send the modifications to the original developer so that they can be incorporated into the canonical version.

+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

-Any person wishing to distribute modifications to the Software is requested to send the modifications to the original developer so that they can be incorporated into the canonical version. +


Member Enumeration Documentation

+

+ + + + +
+ + +
enum RtAudio::RtAudioApi +
+
+ + + + + +
+   + +

-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +Audio API specifier arguments.

+

Enumeration values:
+ + + + + + + + + +
UNSPECIFIED  +Search for a working compiled API.
LINUX_ALSA  +The Advanced Linux Sound Architecture API.
LINUX_OSS  +The Linux Open Sound System API.
LINUX_JACK  +The Linux Jack Low-Latency Audio Server API.
MACOSX_CORE  +Macintosh OS-X Core Audio API.
IRIX_AL  +The Irix Audio Library API.
WINDOWS_ASIO  +The Steinberg Audio Stream I/O API.
WINDOWS_DS  +The Microsoft Direct Sound API.
+
+


Constructor & Destructor Documentation

-

- +

+

- +Probes the system to make sure at least one audio input/output device is available and determines the api-specific identifier for each device found. An RtError error can be thrown if no devices are found or if a memory allocation error occurs.

+If no API argument is specified and multiple API support has been compiled, the default order of use is JACK, ALSA, OSS (Linux systems) and ASIO, DS (Windows systems).

+ - - + + + + + +
-RtAudio::RtAudio ( - -) - RtAudio::RtAudio RtAudioApi  api = UNSPECIFIED  ) 
@@ -98,71 +158,75 @@ RtAudio::RtAudio (

-The default constructor. +The default class constructor.

-Probes the system to make sure at least one audio input/output device is available and determines the api-specific identifier for each device found. An RtError error can be thrown if no devices are found or if a memory allocation error occurs.

-

- +

+

- +The specified output and/or input device identifiers correspond to those enumerated via the getDeviceInfo() method. If device = 0, the default or first available devices meeting the given parameters is selected. If an output or input channel value is zero, the corresponding device value is ignored. When a stream is successfully opened, its identifier is returned via the "streamId" pointer. An RtError can be thrown if no devices are found for the given parameters, if a memory allocation error occurs, or if a driver error occurs.
See also:
openStream()
+
+ - - + + + + + + + + + + - + + + - + + + - + + + - + + + - + + + - + + + - + + + - + +
-RtAudio::RtAudio ( - -int * streamId, - RtAudio::RtAudio int  outputDevice,
int  outputChannels,
-int outputDevice, - int  inputDevice,
-int outputChannels, - int  inputChannels,
-int inputDevice, - RtAudioFormat  format,
-int inputChannels, - int  sampleRate,
-RTAUDIO_FORMAT format, - int *  bufferSize,
-int sampleRate, - int  numberOfBuffers,
-int * bufferSize, - RtAudioApi  api = UNSPECIFIED
-int numberOfBuffers ) -
@@ -177,25 +241,23 @@ int numberOfBuffers )

-A constructor which can be used to open a stream during instantiation. +A constructor which can be used to open a stream during instantiation.

-The specified output and/or input device identifiers correspond to those enumerated via the getDeviceInfo() method. If device = 0, the default or first available devices meeting the given parameters is selected. If an output or input channel value is zero, the corresponding device value is ignored. When a stream is successfully opened, its identifier is returned via the "streamId" pointer. An RtError can be thrown if no devices are found for the given parameters, if a memory allocation error occurs, or if a driver error occurs.

-See also:
-openStream()
-

- +

+

- +Stops and closes an open stream and devices and deallocates buffer and structure memory.
+ - - + + + + +
-RtAudio::~RtAudio ( - -) - RtAudio::~RtAudio  ) 
@@ -210,137 +272,69 @@ RtAudio::~RtAudio (

-The destructor. +The destructor.

-Stops and closes any open streams and devices and deallocates buffer and structure memory.


Member Function Documentation

-

- +

+

- - -
+ - - + + + + - - - - + + - - - - + + - + + + - + + + - + + + - -
-int RtAudio::openStream ( - -int outputDevice, - void RtAudio::openStream int  outputDevice,
-int outputChannels, -
-int inputDevice, - int  outputChannels,
-int inputChannels, -
-RTAUDIO_FORMAT format, - int  inputDevice,
-int sampleRate, - int  inputChannels,
-int * bufferSize, - RtAudioFormat  format,
-int numberOfBuffers ) - int  sampleRate,
-
- - - - - -
-   - - -

-A public method for opening a stream with the specified parameters. -

-If successful, the opened stream ID is returned. Otherwise, an RtError is thrown.

-Parameters:
- - - - - - - - - -
outputDevice: -If equal to 0, the default or first device found meeting the given parameters is opened. Otherwise, the device number should correspond to one of those enumerated via the getDeviceInfo() method.
outputChannels: -The desired number of output channels. If equal to zero, the outputDevice identifier is ignored.
inputDevice: -If equal to 0, the default or first device found meeting the given parameters is opened. Otherwise, the device number should correspond to one of those enumerated via the getDeviceInfo() method.
inputChannels: -The desired number of input channels. If equal to zero, the inputDevice identifier is ignored.
format: -An RTAUDIO_FORMAT specifying the desired sample data format.
sampleRate: -The desired sample rate (sample frames per second).
bufferSize: -A pointer value indicating the desired internal buffer size in sample frames. The actual value used by the device is returned via the same pointer. A value of zero can be specified, in which case the lowest allowable value is determined.
numberOfBuffers: -A value which can be used to help control device latency. More buffers typically result in more robust performance, though at a cost of greater latency. A value of zero can be specified, in which case the lowest allowable value is used.
-
-

- - - - -
- - - + + + + - + + + - + +
-void RtAudio::setStreamCallback ( - -int streamId, - int *  bufferSize,
-RTAUDIO_CALLBACK callback, - int  numberOfBuffers
-void * userData ) -
@@ -355,91 +349,45 @@ void * userData )

-A public method which sets a user-defined callback function for a given stream. +A public method for opening a stream with the specified parameters.

-This method assigns a callback function to a specific, previously opened stream for non-blocking stream functionality. A separate process is initiated, though the user function is called only when the stream is "running" (between calls to the startStream() and stopStream() methods, respectively). The callback process remains active for the duration of the stream and is automatically shutdown when the stream is closed (via the closeStream() method or by object destruction). The callback process can also be shutdown and the user function de-referenced through an explicit call to the cancelStreamCallback() method. Note that a single stream can use only blocking or callback functionality at the same time, though it is possible to alternate modes on the same stream through the use of the setStreamCallback() and cancelStreamCallback() methods (the blocking tickStream() method can be used before a callback is set and/or after a callback is cancelled). An RtError will be thrown for an invalid device argument.

-

- - -
- - - - - - -
-void RtAudio::cancelStreamCallback ( - -int streamId ) -
+An RtError is thrown if a stream cannot be opened.

+

Parameters:
+ + + + + + + + + +
outputDevice: If equal to 0, the default or first device found meeting the given parameters is opened. Otherwise, the device number should correspond to one of those enumerated via the getDeviceInfo() method.
outputChannels: The desired number of output channels. If equal to zero, the outputDevice identifier is ignored.
inputDevice: If equal to 0, the default or first device found meeting the given parameters is opened. Otherwise, the device number should correspond to one of those enumerated via the getDeviceInfo() method.
inputChannels: The desired number of input channels. If equal to zero, the inputDevice identifier is ignored.
format: An RtAudioFormat specifying the desired sample data format.
sampleRate: The desired sample rate (sample frames per second).
*bufferSize: A pointer value indicating the desired internal buffer size in sample frames. The actual value used by the device is returned via the same pointer. A value of zero can be specified, in which case the lowest allowable value is determined.
numberOfBuffers: A value which can be used to help control device latency. More buffers typically result in more robust performance, though at a cost of greater latency. A value of zero can be specified, in which case the lowest allowable value is used.
+
- +

+

- - - -
-   - - -

-A public method which cancels a callback process and function for a given stream. -

-This method shuts down a callback process and de-references the user function for a specific stream. Callback functionality can subsequently be restarted on the stream via the setStreamCallback() method. An RtError will be thrown for an invalid device argument.

-

- - - - -
+ - - + + + + - + + + - -
-void RtAudio::getDeviceInfo ( - -int device, - void RtAudio::setStreamCallback RtAudioCallback  callback,
-RTAUDIO_DEVICE * info ) - void *  userData
-
- - - - - -
-   - - -

-Fill a user-supplied RTAUDIO_DEVICE structure for a specified device number. -

-Any device integer between 1 and getDeviceCount() is valid. If a device is busy or otherwise unavailable, the structure member "probed" will have a value of "false" and all other members are undefined. If the specified device is the current default input or output device, the "isDefault" member will have a value of "true". An RtError will be thrown for an invalid device argument.

-

- - - +This method assigns a callback function to a previously opened stream for non-blocking stream functionality. A separate process is initiated, though the user function is called only when the stream is "running" (between calls to the startStream() and stopStream() methods, respectively). The callback process remains active for the duration of the stream and is automatically shutdown when the stream is closed (via the closeStream() method or by object destruction). The callback process can also be shutdown and the user function de-referenced through an explicit call to the cancelStreamCallback() method. Note that the stream can use only blocking or callback functionality at a particular time, though it is possible to alternate modes on the same stream through the use of the setStreamCallback() and cancelStreamCallback() methods (the blocking tickStream() method can be used before a callback is set and/or after a callback is cancelled). An RtError will be thrown if called when no stream is open or a thread errors occurs.
- - - + + +
-char *const RtAudio::getStreamBuffer ( - -int streamId ) - [inline]
@@ -454,23 +402,22 @@ int streamId )

-A public method which returns a pointer to the buffer for an open stream. +A public method which sets a user-defined callback function for a given stream.

-The user should fill and/or read the buffer data in interleaved format and then call the tickStream() method. An RtError will be thrown for an invalid stream identifier.

-

- +

+

- +This method shuts down a callback process and de-references the user function for the stream. Callback functionality can subsequently be restarted on the stream via the setStreamCallback() method. An RtError will be thrown if called when no stream is open.
+ - - + + + + +
-void RtAudio::tickStream ( - -int streamId ) - void RtAudio::cancelStreamCallback  )  [inline]
@@ -485,23 +432,23 @@ int streamId )

-Public method used to trigger processing of input/output data for a stream. +A public method which cancels a callback process and function for the stream.

-This method blocks until all buffer data is read/written. An RtError will be thrown for an invalid stream identifier or if a driver error occurs.

-

- +

+

- +Any device integer between 1 and getDeviceCount() is valid. If a device is busy or otherwise unavailable, the structure member "probed" will have a value of "false" and all other members are undefined. If the specified device is the current default input or output device, the "isDefault" member will have a value of "true". An RtError will be thrown for an invalid device argument.
+ - - + + + + + +
-void RtAudio::closeStream ( - -int streamId ) - RtAudioDeviceInfo RtAudio::getDeviceInfo int  device  )  [inline]
@@ -516,23 +463,22 @@ int streamId )

-Public method which closes a stream and frees any associated buffers. +Return an RtAudioDeviceInfo structure for a specified device number.

-If an invalid stream identifier is specified, this method issues a warning and returns (an RtError is not thrown).

-

- +

+

- +The user should fill and/or read the buffer data in interleaved format and then call the tickStream() method. An RtError will be thrown if called when no stream is open.
+ - - + + + + +
-void RtAudio::startStream ( - -int streamId ) - char* const RtAudio::getStreamBuffer  )  [inline]
@@ -547,23 +493,22 @@ int streamId )

-Public method which starts a stream. +A public method which returns a pointer to the buffer for an open stream.

-An RtError will be thrown for an invalid stream identifier or if a driver error occurs.

-

- +

+

- +This method blocks until all buffer data is read/written. An RtError will be thrown if a driver error occurs or if called when no stream is open.
+ - - + + + + +
-void RtAudio::stopStream ( - -int streamId ) - void RtAudio::tickStream  )  [inline]
@@ -578,23 +523,22 @@ int streamId )

-Stop a stream, allowing any samples remaining in the queue to be played out and/or read in. +Public method used to trigger processing of input/output data for a stream.

-An RtError will be thrown for an invalid stream identifier or if a driver error occurs.

-

- +

+

- +If a stream is not open, this method issues a warning and returns (an RtError is not thrown).
+ - - + + + + +
-void RtAudio::abortStream ( - -int streamId ) - void RtAudio::closeStream  )  [inline]
@@ -609,23 +553,22 @@ int streamId )

-Stop a stream, discarding any samples remaining in the input/output queue. +Public method which closes a stream and frees any associated buffers.

-An RtError will be thrown for an invalid stream identifier or if a driver error occurs.

-

- +

+

- +An RtError will be thrown if a driver error occurs or if called when no stream is open.
+ - - + + + + +
-int RtAudio::streamWillBlock ( - -int streamId ) - void RtAudio::startStream  )  [inline]
@@ -640,21 +583,22 @@ int streamId )

-Queries a stream to determine whether a call to the tickStream() method will block. +Public method which starts a stream.

-A return value of 0 indicates that the stream will NOT block. A positive return value indicates the number of sample frames that cannot yet be processed without blocking.

-


Member Data Documentation

-

- +

+

- - -
+ - + + + + +
-const RTAUDIO_FORMAT RtAudio::RTAUDIO_SINT8 [static] - void RtAudio::stopStream  )  [inline]
@@ -669,44 +613,22 @@ const RTAUDIO_FORMAT RtAudio::RTAUDIO_SINT8 [static]

-8-bit signed integer.

-

- - - - -
- - - - - -
-const RTAUDIO_FORMAT RtAudio::RTAUDIO_SINT16 [static] -
-
- - - - +An RtError will be thrown if a driver error occurs or if called when no stream is open.
-   - - +Stop a stream, allowing any samples remaining in the queue to be played out and/or read in.

-16-bit signed integer.

-

- +

+

- - -
+ - + + + + +
-const RTAUDIO_FORMAT RtAudio::RTAUDIO_SINT24 [static] - void RtAudio::abortStream  )  [inline]
@@ -721,94 +643,18 @@ const RTAUDIO_FORMAT RtAudio::RTAUDIO_SINT24 [static]

-Upper 3 bytes of 32-bit signed integer.

-

- - - - -
- - - - - -
-const RTAUDIO_FORMAT RtAudio::RTAUDIO_SINT32 [static] -
-
- - - - - -
-   - - -

-32-bit signed integer.

-

- - - - -
- - - - - -
-const RTAUDIO_FORMAT RtAudio::RTAUDIO_FLOAT32 [static] -
-
- - - - - -
-   - - -

-Normalized between plus/minus 1.0.

-

- - - - -
- - - - - -
-const RTAUDIO_FORMAT RtAudio::RTAUDIO_FLOAT64 [static] -
-
- - - - +An RtError will be thrown if a driver error occurs or if called when no stream is open.
-   - - +Stop a stream, discarding any samples remaining in the input/output queue.

-Normalized between plus/minus 1.0.


The documentation for this class was generated from the following file:
-
- ©2001-2002 Gary P. Scavone, CCRMA, Stanford University. All Rights Reserved.
- Maintained by Gary P. Scavone, gary@ccrma.stanford.edu

+ +
©2001-2004 Gary P. Scavone, McGill University. All Rights Reserved.
+ Maintained by Gary P. Scavone, gary@music.mcgill.ca
diff --git a/doc/html/classRtError-members.html b/doc/html/classRtError-members.html index e44e39e..85f42a3 100644 --- a/doc/html/classRtError-members.html +++ b/doc/html/classRtError-members.html @@ -7,20 +7,31 @@

Tutorial   Class/Enum List   File List   Compound Members  

- -

RtError Member List

This is the complete list of members for RtError, including all inherited members. -
+ +

RtError Member List

This is the complete list of members for RtError, including all inherited members. + + + + + + + + + + + + + + + + + + +
DEBUG_WARNING enum valueRtError
DRIVER_ERROR enum valueRtError
getMessage(void)RtError [inline, virtual]
getMessageString(void)RtError [inline, virtual]
getType(void)RtError [inline, virtual]
INVALID_DEVICE enum valueRtError
INVALID_PARAMETER enum valueRtError
INVALID_STREAM enum valueRtError
MEMORY_ERROR enum valueRtError
NO_DEVICES_FOUND enum valueRtError
printMessage(void)RtError [inline, virtual]
RtError(const std::string &message, Type type=RtError::UNSPECIFIED)RtError [inline]
SYSTEM_ERROR enum valueRtError
THREAD_ERROR enum valueRtError
Type enum nameRtError
UNSPECIFIED enum valueRtError
WARNING enum valueRtError
~RtError(void)RtError [inline, virtual]

-
- ©2001-2002 Gary P. Scavone, CCRMA, Stanford University. All Rights Reserved.
- Maintained by Gary P. Scavone, gary@ccrma.stanford.edu

+ +
©2001-2004 Gary P. Scavone, McGill University. All Rights Reserved.
+ Maintained by Gary P. Scavone, gary@music.mcgill.ca
diff --git a/doc/html/classRtError.html b/doc/html/classRtError.html index b81582a..7301c2c 100644 --- a/doc/html/classRtError.html +++ b/doc/html/classRtError.html @@ -7,60 +7,122 @@

Tutorial   Class/Enum List   File List   Compound Members  

- -

RtError Class Reference

Exception handling class for RtAudio. + +

RtError Class Reference

Exception handling class for RtAudio & RtMidi. More...

-#include <RtAudio.h> +#include <RtError.h>

List of all members. + - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + +

Public Types

enum  TYPE {
-  WARNING, -DEBUG_WARNING, -UNSPECIFIED, -NO_DEVICES_FOUND, +
enum  Type {
+  WARNING, +DEBUG_WARNING, +UNSPECIFIED, +NO_DEVICES_FOUND,
-  INVALID_DEVICE, -INVALID_STREAM, -MEMORY_ERROR, -INVALID_PARAMETER, +  INVALID_DEVICE, +INVALID_STREAM, +MEMORY_ERROR, +INVALID_PARAMETER,
-  DRIVER_ERROR, -SYSTEM_ERROR, -THREAD_ERROR +  DRIVER_ERROR, +SYSTEM_ERROR, +THREAD_ERROR
}
 Defined RtError types.


Public Methods

RtError (const char *p, TYPE tipe=RtError::UNSPECIFIED)
 The constructor.

-virtual ~RtError (void)
 The destructor.

-virtual void printMessage (void)
 Prints "thrown" error message to stdout.

-virtual const TYPEgetType (void)
 Returns the "thrown" error message TYPE.

-virtual const char* getMessage (void)
 Returns the "thrown" error message string.

 Defined RtError types. More...


Public Member Functions

RtError (const std::string &message, Type type=RtError::UNSPECIFIED)
 The constructor.

+virtual ~RtError (void)
 The destructor.

+virtual void printMessage (void)
 Prints thrown error message to stderr.

+virtual const TypegetType (void)
 Returns the thrown error message type.

+virtual const std::string & getMessage (void)
 Returns the thrown error message string.

+virtual const char * getMessageString (void)
 Returns the thrown error message as a C string.


Detailed Description

-Exception handling class for RtAudio. +Exception handling class for RtAudio & RtMidi.

-The RtError class is quite simple but it does allow errors to be "caught" by RtError::TYPE. Almost all RtAudio methods can "throw" an RtError, most typically if an invalid stream identifier is supplied to a method or a driver error occurs. There are a number of cases within RtAudio where warning messages may be displayed but an exception is not thrown. There is a private RtAudio method, error(), which can be modified to globally control how these messages are handled and reported. +The RtError class is quite simple but it does allow errors to be "caught" by RtError::Type. See the RtAudio and RtMidi documentation to know which methods can throw an RtError.

+


Member Enumeration Documentation

+

+ + + + +
+ + +
enum RtError::Type +
+
+ + + + + +
+   + + +

+Defined RtError types. +

+

Enumeration values:
+ + + + + + + + + + + + +
WARNING  +A non-critical error.
DEBUG_WARNING  +A non-critical error which might be useful for debugging.
UNSPECIFIED  +The default, unspecified error type.
NO_DEVICES_FOUND  +No devices found on system.
INVALID_DEVICE  +An invalid device ID was specified.
INVALID_STREAM  +An invalid stream ID was specified.
MEMORY_ERROR  +An error occured during memory allocation.
INVALID_PARAMETER  +An invalid parameter was specified to a function.
DRIVER_ERROR  +A system driver error occured.
SYSTEM_ERROR  +A system error occured.
THREAD_ERROR  +A thread error occured.
+
+


The documentation for this class was generated from the following file: +
  • RtError.h
    -
    - ©2001-2002 Gary P. Scavone, CCRMA, Stanford University. All Rights Reserved.
    - Maintained by Gary P. Scavone, gary@ccrma.stanford.edu

    + +
    ©2001-2004 Gary P. Scavone, McGill University. All Rights Reserved.
    + Maintained by Gary P. Scavone, gary@music.mcgill.ca
    diff --git a/doc/html/doxygen.css b/doc/html/doxygen.css index 7f8e5b8..a89dd24 100644 --- a/doc/html/doxygen.css +++ b/doc/html/doxygen.css @@ -1,20 +1,169 @@ -H1 { text-align: center; } -A.qindex {} -A.qindexRef {} +H1 { + text-align: center; + font-family: Arial, Helvetica, sans-serif; +} +H2 { + font-family: Geneva, Arial, Helvetica, sans-serif; +} +CAPTION { font-weight: bold } +DIV.qindex { width: 100%; + background-color: #eeeeff; + border: 4px solid #eeeeff; + text-align: center; + margin-bottom: 2px +} +A.qindex { text-decoration: none; font-weight: bold; color: #0000ee } +A.qindex:visited { text-decoration: none; font-weight: bold; color: #0000ee } +A.qindex:hover { text-decoration: none; background-color: #ddddff } +A.qindexHL { text-decoration: none; font-weight: bold; + background-color: #6666cc; + color: #ffffff + } +A.qindexHL:hover { text-decoration: none; background-color: #6666cc; color: #ffffff } +A.qindexHL:visited { text-decoration: none; background-color: #6666cc; color: #ffffff } A.el { text-decoration: none; font-weight: bold } A.elRef { font-weight: bold } A.code { text-decoration: none; font-weight: normal; color: #4444ee } A.codeRef { font-weight: normal; color: #4444ee } +A:hover { text-decoration: none; background-color: #f2f2ff } DL.el { margin-left: -1cm } -DIV.fragment { width: 100%; border: none; background-color: #eeeeee } -DIV.ah { background-color: black; margin-bottom: 3; margin-top: 3 } -TD.md { background-color: #f2f2ff } -DIV.groupHeader { margin-left: 16; margin-top: 12; margin-bottom: 6; font-weight: bold } -DIV.groupText { margin-left: 16; font-style: italic; font-size: smaller } -FONT.keyword { color: #008000 } -FONT.keywordtype { color: #604020 } -FONT.keywordflow { color: #e08000 } -FONT.comment { color: #800000 } -FONT.preprocessor { color: #806020 } -FONT.stringliteral { color: #002080 } -FONT.charliteral { color: #008080 } +DIV.fragment { + width: 98%; + border: 1px solid #CCCCCC; + background-color: #f5f5f5; + padding-left: 4px; + margin: 4px; +} +DIV.ah { background-color: black; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px } +TD.md { background-color: #f2f2ff; font-weight: bold; } +TD.mdname1 { background-color: #f2f2ff; font-weight: bold; color: #602020; } +TD.mdname { background-color: #f2f2ff; font-weight: bold; color: #602020; width: 600px; } +DIV.groupHeader { margin-left: 16px; margin-top: 12px; margin-bottom: 6px; font-weight: bold } +DIV.groupText { margin-left: 16px; font-style: italic; font-size: smaller } +BODY { + background: white; + color: black; + margin-right: 20px; + margin-left: 20px; +} +TD.indexkey { + background-color: #eeeeff; + font-weight: bold; + padding-right : 10px; + padding-top : 2px; + padding-left : 10px; + padding-bottom : 2px; + margin-left : 0px; + margin-right : 0px; + margin-top : 2px; + margin-bottom : 2px +} +TD.indexvalue { + background-color: #eeeeff; + font-style: italic; + padding-right : 10px; + padding-top : 2px; + padding-left : 10px; + padding-bottom : 2px; + margin-left : 0px; + margin-right : 0px; + margin-top : 2px; + margin-bottom : 2px +} +TR.memlist { + background-color: #f0f0f0; +} +P.formulaDsp { text-align: center; } +IMG.formulaDsp { } +IMG.formulaInl { vertical-align: middle; } +SPAN.keyword { color: #008000 } +SPAN.keywordtype { color: #604020 } +SPAN.keywordflow { color: #e08000 } +SPAN.comment { color: #800000 } +SPAN.preprocessor { color: #806020 } +SPAN.stringliteral { color: #002080 } +SPAN.charliteral { color: #008080 } +.mdTable { + border: 1px solid #868686; + background-color: #f2f2ff; +} +.mdRow { + padding: 8px 20px; +} +.mdescLeft { + font-size: smaller; + font-family: Arial, Helvetica, sans-serif; + background-color: #FAFAFA; + padding-left: 8px; + border-top: 1px none #E0E0E0; + border-right: 1px none #E0E0E0; + border-bottom: 1px none #E0E0E0; + border-left: 1px none #E0E0E0; + margin: 0px; +} +.mdescRight { + font-size: smaller; + font-family: Arial, Helvetica, sans-serif; + font-style: italic; + background-color: #FAFAFA; + padding-left: 4px; + border-top: 1px none #E0E0E0; + border-right: 1px none #E0E0E0; + border-bottom: 1px none #E0E0E0; + border-left: 1px none #E0E0E0; + margin: 0px; + padding-bottom: 0px; + padding-right: 8px; +} +.memItemLeft { + padding: 1px 0px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-style: solid; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + background-color: #FAFAFA; + font-family: Geneva, Arial, Helvetica, sans-serif; + font-size: 12px; +} +.memItemRight { + padding: 1px 0px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-style: solid; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + background-color: #FAFAFA; + font-family: Geneva, Arial, Helvetica, sans-serif; + font-size: 13px; +} +.search { color: #0000ee; + font-weight: bold; +} +FORM.search { + margin-bottom: 0px; + margin-top: 0px; +} +INPUT.search { font-size: 75%; + color: #000080; + font-weight: normal; + background-color: #eeeeff; +} +TD.tiny { font-size: 75%; +} diff --git a/doc/html/doxygen.gif b/doc/html/doxygen.gif deleted file mode 100644 index 192c83c..0000000 Binary files a/doc/html/doxygen.gif and /dev/null differ diff --git a/doc/html/doxygen.png b/doc/html/doxygen.png new file mode 100644 index 0000000..96ae72c Binary files /dev/null and b/doc/html/doxygen.png differ diff --git a/doc/html/files.html b/doc/html/files.html index 735f22c..6b04ddd 100644 --- a/doc/html/files.html +++ b/doc/html/files.html @@ -7,14 +7,16 @@

    Tutorial   Class/Enum List   File List   Compound Members  

    - -

    RtAudio File List

    Here is a list of all documented files with brief descriptions: + +

    RtAudio File List

    Here is a list of all documented files with brief descriptions: + + +
    RtAudio.h [code]
    RtError.h [code]

    -
    - ©2001-2002 Gary P. Scavone, CCRMA, Stanford University. All Rights Reserved.
    - Maintained by Gary P. Scavone, gary@ccrma.stanford.edu

    + +
    ©2001-2004 Gary P. Scavone, McGill University. All Rights Reserved.
    + Maintained by Gary P. Scavone, gary@music.mcgill.ca
    diff --git a/doc/html/functions.html b/doc/html/functions.html index 5da0499..f360f94 100644 --- a/doc/html/functions.html +++ b/doc/html/functions.html @@ -7,53 +7,97 @@

    Tutorial   Class/Enum List   File List   Compound Members  

    - -

    RtAudio Compound Members

    Here is a list of all documented class members with links to the classes they belong to:
      + + +
      a | c | d | g | i | l | m | n | o | p | r | s | t | u | w | ~
      + +

      + +

      +Here is a list of all documented class members with links to the class documentation for each member:

      - a -

      +

      - c -

      +

      - d -

      +

      - g -

      +

      - i -

      +

      - l -

      +

      - m -

      +

      - n -

      +

      - o -

      +

      - p -

      +

      - r -

      +

      - s -

      +

      - t -

      +

      - u -

      +

      - w -

      +

      - ~ -


      -
      - ©2001-2002 Gary P. Scavone, CCRMA, Stanford University. All Rights Reserved.
      - Maintained by Gary P. Scavone, gary@ccrma.stanford.edu

      + +
      ©2001-2004 Gary P. Scavone, McGill University. All Rights Reserved.
      + Maintained by Gary P. Scavone, gary@music.mcgill.ca
      diff --git a/doc/html/functions_enum.html b/doc/html/functions_enum.html new file mode 100644 index 0000000..7c5672a --- /dev/null +++ b/doc/html/functions_enum.html @@ -0,0 +1,26 @@ + + +The RtAudio Tutorial + + + +

      +Tutorial   Class/Enum List   File List   Compound Members  
      +
      + + + +

      +

      +
      + + + +
      ©2001-2004 Gary P. Scavone, McGill University. All Rights Reserved.
      + Maintained by Gary P. Scavone, gary@music.mcgill.ca
      + + + diff --git a/doc/html/functions_eval.html b/doc/html/functions_eval.html new file mode 100644 index 0000000..6750f37 --- /dev/null +++ b/doc/html/functions_eval.html @@ -0,0 +1,42 @@ + + +The RtAudio Tutorial + + + +
      +Tutorial   Class/Enum List   File List   Compound Members  
      +
      + + + +

      +

      +
      + + + +
      ©2001-2004 Gary P. Scavone, McGill University. All Rights Reserved.
      + Maintained by Gary P. Scavone, gary@music.mcgill.ca
      + + + diff --git a/doc/html/functions_func.html b/doc/html/functions_func.html new file mode 100644 index 0000000..faa8a6a --- /dev/null +++ b/doc/html/functions_func.html @@ -0,0 +1,43 @@ + + +The RtAudio Tutorial + + + +
      +Tutorial   Class/Enum List   File List   Compound Members  
      +
      + + + +

      +

      +
      + + + +
      ©2001-2004 Gary P. Scavone, McGill University. All Rights Reserved.
      + Maintained by Gary P. Scavone, gary@music.mcgill.ca
      + + + diff --git a/doc/html/functions_vars.html b/doc/html/functions_vars.html new file mode 100644 index 0000000..442d884 --- /dev/null +++ b/doc/html/functions_vars.html @@ -0,0 +1,32 @@ + + +The RtAudio Tutorial + + + +
      +Tutorial   Class/Enum List   File List   Compound Members  
      +
      + + + +

      +

      +
      + + + +
      ©2001-2004 Gary P. Scavone, McGill University. All Rights Reserved.
      + Maintained by Gary P. Scavone, gary@music.mcgill.ca
      + + + diff --git a/doc/html/index.html b/doc/html/index.html index 5567502..7de36f6 100644 --- a/doc/html/index.html +++ b/doc/html/index.html @@ -7,611 +7,566 @@
      Tutorial   Class/Enum List   File List   Compound Members  

      - -

      The RtAudio Tutorial

      -

      - -

      -

      -

      Introduction

      - -

      -RtAudio is a C++ class which provides a common API (Application Programming Interface) for realtime audio input/output across Linux (native ALSA and OSS), Macintosh OS X, SGI, and Windows (DirectSound and ASIO) operating systems. RtAudio significantly simplifies the process of interacting with computer audio hardware. It was designed with the following goals: + +

      The RtAudio Tutorial

      +

      Introduction    What's New (Version 3.0)   Download    Getting Started    Error Handling    Probing Device Capabilities    Device Settings    Playback (blocking functionality)    Playback (callback functionality)    Recording    Duplex Mode    Using Simultaneous Multiple APIs    Summary of Methods    Compiling    Debugging    API Notes    Acknowledgements    License

      +Introduction

      +RtAudio is a set of C++ classes which provide a common API (Application Programming Interface) for realtime audio input/output across Linux (native ALSA, JACK, and OSS), Macintosh OS X, SGI, and Windows (DirectSound and ASIO) operating systems. RtAudio significantly simplifies the process of interacting with computer audio hardware. It was designed with the following goals:

        -
      • object oriented C++ design
      • simple, common API across all supported platforms
      • single independent header and source file for easy inclusion in programming projects
      • blocking functionality
      • callback functionality
      • extensive audio device parameter control
      • audio device capability probing
      • automatic internal conversion for data format, channel number compensation, de-interleaving, and byte-swapping
      • control over multiple audio streams and devices with a single instance
      - -

      -RtAudio incorporates the concept of audio streams, which represent audio output (playback) and/or input (recording). Available audio devices and their capabilities can be enumerated and then specified when opening a stream. When allowed by the underlying audio API, multiple streams can run at the same time and a single device can serve multiple streams. See the OS Notes section for information specific to each of the supported audio APIs. -

      -The RtAudio API provides both blocking (synchronous) and callback (asyncronous) functionality. Callbacks are typically used in conjunction with graphical user interfaces (GUI). Blocking functionality is often necessary for explicit control of multiple input/output stream synchronization or when audio must be synchronized with other system events. -

      -

      Download

      - -

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

      -

      Getting Started

      - -

      -The first thing that must be done when using RtAudio is to create an instance of the class. The default constructor RtAudio::RtAudio() scans the underlying audio system to verify that at least one device is available. RtAudio often uses C++ exceptions to report errors, necessitating try/catch blocks around most member functions. The following code example demonstrates default object construction and destruction: -

      -

      #include "RtAudio.h"
      -
      -int main()
      -{
      +
    • +object oriented C++ design
    • +
    • +simple, common API across all supported platforms
    • +
    • +only two header files and one source file for easy inclusion in programming projects
    • +
    • +allow simultaneous multi-api support
    • +
    • +blocking functionality
    • +
    • +callback functionality
    • +
    • +extensive audio device parameter control
    • +
    • +audio device capability probing
    • +
    • +automatic internal conversion for data format, channel number compensation, de-interleaving, and byte-swapping
    • + +

      +RtAudio incorporates the concept of audio streams, which represent audio output (playback) and/or input (recording). Available audio devices and their capabilities can be enumerated and then specified when opening a stream. Where applicable, multiple API support can be compiled and a particular API specified when creating an RtAudio instance. See the API Notes section for information specific to each of the supported audio APIs.

      +The RtAudio API provides both blocking (synchronous) and callback (asynchronous) functionality. Callbacks are typically used in conjunction with graphical user interfaces (GUI). Blocking functionality is often necessary for explicit control of multiple input/output stream synchronization or when audio must be synchronized with other system events.

      +What's New (Version 3.0)

      +RtAudio now allows simultaneous multi-api support. For example, you can compile RtAudio to provide both DirectSound and ASIO support on Windows platforms or ALSA, JACK, and OSS support on Linux platforms. This was accomplished by creating an abstract base class, RtApi, with subclasses for each supported API (RtApiAlsa, RtApiJack, RtApiOss, RtApiDs, RtApiAsio, RtApiCore, and RtApiAl). The class RtAudio is now a "controller" which creates an instance of an RtApi subclass based on the user's API choice via an optional RtAudio::RtAudioApi instantiation argument. If no API is specified, RtAudio attempts to make a "logical" API selection.

      +Support for the JACK low-latency audio server has been added with this version of RtAudio. It is necessary to have the JACK server running before creating an instance of RtAudio.

      +Several API changes have been made in version 3.0 of RtAudio in an effort to provide more consistent behavior across all supported audio APIs. The most significant of these changes is that multiple stream support from a single RtAudio instance has been discontinued. As a result, stream identifier input arguments are no longer required. Also, the RtAudio::streamWillBlock() function was poorly supported by most APIs and has been deprecated (though the function still exists in those subclasses of RtApi that do allow it to be implemented).

      +The RtAudio::getDeviceInfo() function was modified to return a globally defined RtAudioDeviceInfo structure. This structure is a simplified version of the previous RTAUDIO_DEVICE structure. In addition, the RTAUDIO_FORMAT structure was renamed RtAudioFormat and defined globally within RtAudio.h. These changes were made for clarity and to better conform with standard C++ programming practices.

      +The RtError class declaration and definition have been extracted to a separate file (RtError.h). This was done in preparation for a new release of the RtMidi class (planned for Summer 2004).

      +Download

      +Latest Release (11 March 2004): Version 3.0 (200 kB tar/gzipped)

      +Getting Started

      +With version 3.0, it is now possible to compile multiple API support on a given platform and to specify an API choice during class instantiation. In the examples that follow, no API will be specified (in which case, RtAudio attempts to select the most "logical" available API).

      +The first thing that must be done when using RtAudio is to create an instance of the class. The default constructor scans the underlying audio system to verify that at least one device is available. RtAudio often uses C++ exceptions to report errors, necessitating try/catch blocks around most member functions. The following code example demonstrates default object construction and destruction:

      +

      #include "RtAudio.h"
      +
      +int main()
      +{
         RtAudio *audio;
       
      -  // Default RtAudio constructor
      -  try {
      -    audio = new RtAudio();
      +  // Default RtAudio constructor
      +  try {
      +    audio = new RtAudio();
         }
      -  catch (RtError &error) {
      -    // Handle the exception here
      +  catch (RtError &error) {
      +    // Handle the exception here
      +    error.printMessage();
         }
       
      -  // Clean up
      -  delete audio;
      -}
      -

      -Obviously, this example doesn't demonstrate any of the real functionality of RtAudio. However, all uses of RtAudio must begin with a constructor (either default or overloaded varieties) and must end with class destruction. Further, it is necessary that all class methods which can throw a C++ exception be called within a try/catch block. -

      -

      Error Handling

      - -

      -RtAudio uses a C++ exception handler called RtError, which is declared and defined within the RtAudio class files. The RtError class is quite simple but it does allow errors to be "caught" by RtError::TYPE. Almost all RtAudio methods can "throw" an RtError, most typically if an invalid stream identifier is supplied to a method or a driver error occurs. There are a number of cases within RtAudio where warning messages may be displayed but an exception is not thrown. There is a private RtAudio method, error(), which can be modified to globally control how these messages are handled and reported. -

      -

      Probing Device Capabilities

      - -

      -A programmer may wish to query the available audio device capabilities before deciding which to use. The following example outlines how this can be done. -

      -

      // probe.cpp
      -
      -#include <iostream>
      -#include "RtAudio.h"
      -
      -int main()
      -{
      +  // Clean up
      +  delete audio;
      +}
      +

      +Obviously, this example doesn't demonstrate any of the real functionality of RtAudio. However, all uses of RtAudio must begin with a constructor (either default or overloaded varieties) and must end with class destruction. Further, it is necessary that all class methods which can throw a C++ exception be called within a try/catch block.

      +Error Handling

      +RtAudio uses a C++ exception handler called RtError, which is declared and defined in RtError.h. The RtError class is quite simple but it does allow errors to be "caught" by RtError::Type. Almost all RtAudio methods can "throw" an RtError, most typically if a driver error occurs or a stream function is called when no stream is open. There are a number of cases within RtAudio where warning messages may be displayed but an exception is not thrown. There is a protected RtAudio method, error(), which can be modified to globally control how these messages are handled and reported. By default, error messages are not automatically displayed in RtAudio unless the preprocessor definition __RTAUDIO_DEBUG__ is defined. Messages associated with caught exceptions can be displayed with, for example, the RtError::printMessage() function.

      +Probing Device Capabilities

      +A programmer may wish to query the available audio device capabilities before deciding which to use. The following example outlines how this can be done.

      +

      // probe.cpp
      +
      +#include <iostream>
      +#include "RtAudio.h"
      +
      +int main()
      +{
         RtAudio *audio;
       
      -  // Default RtAudio constructor
      -  try {
      -    audio = new RtAudio();
      +  // Default RtAudio constructor
      +  try {
      +    audio = new RtAudio();
         }
      -  catch (RtError &error) {
      +  catch (RtError &error) {
           error.printMessage();
           exit(EXIT_FAILURE);
         }
       
      -  // Determine the number of devices available
      -  int devices = audio->getDeviceCount();
      +  // Determine the number of devices available
      +  int devices = audio->getDeviceCount();
       
      -  // Scan through devices for various capabilities
      -  RtAudio::RTAUDIO_DEVICE info;
      -  for (int i=1; i<=devices; i++) {
      +  // Scan through devices for various capabilities
      +  RtAudioDeviceInfo info;
      +  for (int i=1; i<=devices; i++) {
       
      -    try {
      -      audio->getDeviceInfo(i, &info);
      +    try {
      +      info = audio->getDeviceInfo(i);
           }
      -    catch (RtError &error) {
      +    catch (RtError &error) {
             error.printMessage();
      -      break;
      +      break;
           }
       
      -    // Print, for example, the maximum number of output channels for each device
      -    cout << "device = " << i;
      -    cout << ": maximum output channels = " << info.maxOutputChannels << "\n";
      +    // Print, for example, the maximum number of output channels for each device
      +    std::cout << "device = " << i;
      +    std::cout << ": maximum output channels = " << info.outputChannels << "\n";
         }
       
      -  // Clean up
      -  delete audio;
      -
      -  return 0;
      -}
      -

      -The RTAUDIO_DEVICE structure is defined in RtAudio.h and provides a variety of information useful in assessing the capabilities of a device: -

      -

        typedef struct {
      -    char name[128];
      -    bool probed;                          // true if the device probe was successful.
      -    int maxOutputChannels;
      -    int maxInputChannels;
      -    int maxDuplexChannels;
      -    int minOutputChannels;
      -    int minInputChannels;
      -    int minDuplexChannels;
      -    bool hasDuplexSupport;                // true if duplex mode is supported.
      -    bool isDefault;                       // true if this is the default output or input device.
      -    int nSampleRates;                     // Number of discrete rates, or -1 if range supported.
      -    double sampleRates[MAX_SAMPLE_RATES]; // Supported sample rates, or {min, max} if range.
      -    RTAUDIO_FORMAT nativeFormats;
      -  } RTAUDIO_DEVICE;
      -

      -The following data formats are defined and fully supported by RtAudio: -

      -

        typedef unsigned long RTAUDIO_FORMAT;
      -  static const RTAUDIO_FORMAT  RTAUDIO_SINT8;   // Signed 8-bit integer
      -  static const RTAUDIO_FORMAT  RTAUDIO_SINT16;  // Signed 16-bit integer
      -  static const RTAUDIO_FORMAT  RTAUDIO_SINT24;  // Signed 24-bit integer (upper 3 bytes of 32-bit signed integer.)
      -  static const RTAUDIO_FORMAT  RTAUDIO_SINT32;  // Signed 32-bit integer
      -  static const RTAUDIO_FORMAT  RTAUDIO_FLOAT32; // 32-bit float normalized between +/- 1.0
      -  static const RTAUDIO_FORMAT  RTAUDIO_FLOAT64; // 64-bit double normalized between +/- 1.0
      -

      -The nativeFormats member of the RtAudio::RTAUDIO_DEVICE structure is a bit mask of the above formats which are natively supported by the device. However, RtAudio will automatically provide format conversion if a particular format is not natively supported. When the probed member of the RTAUDIO_DEVICE structure is false, the remaining structure members are undefined and the device is probably unuseable. -

      -In general, the user need not be concerned with the minimum channel values reported in the RTAUDIO_DEVICE structure. While some audio devices may require a minimum channel value > 1, RtAudio will provide automatic channel number compensation when the number of channels set by the user is less than that required by the device. Channel compensation is NOT possible when the number of channels set by the user is greater than that supported by the device. -

      -It should be noted that the capabilities reported by a device driver or underlying audio API are not always accurate and/or may be dependent on a combination of device settings. For this reason, RtAudio does not rely on the reported values when attempting to open a stream. -

      -

      Device Settings

      + // Clean up + delete audio; -

      -The next step in using RtAudio is to open a stream with particular device and parameter settings. -

      -

      #include "RtAudio.h"
      -
      -int main()
      -{
      -  int channels = 2;
      -  int sample_rate = 44100;
      -  int buffer_size = 256;  // 256 sample frames
      -  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
      +  return 0;
      +}
      +

      +The RtAudioDeviceInfo structure is defined in RtAudio.h and provides a variety of information useful in assessing the capabilities of a device:

      +

        typedef struct RtAudioDeviceInfo{
      +    std::string name;             // Character string device identifier.
      +    bool probed;                  // true if the device capabilities were successfully probed.
      +    int outputChannels;           // Maximum output channels supported by device.
      +    int inputChannels;            // Maximum input channels supported by device.
      +    int duplexChannels;           // Maximum simultaneous input/output channels supported by device.
      +    bool isDefault;               // true if this is the default output or input device.
      +    std::vector<int> sampleRates; // Supported sample rates.
      +    RtAudioFormat nativeFormats;  // Bit mask of supported data formats.
      +  };
      +

      +The following data formats are defined and fully supported by RtAudio:

      +

        typedef unsigned long RtAudioFormat;
      +  static const RtAudioFormat  RTAUDIO_SINT8;   // Signed 8-bit integer
      +  static const RtAudioFormat  RTAUDIO_SINT16;  // Signed 16-bit integer
      +  static const RtAudioFormat  RTAUDIO_SINT24;  // Signed 24-bit integer (upper 3 bytes of 32-bit signed integer.)
      +  static const RtAudioFormat  RTAUDIO_SINT32;  // Signed 32-bit integer
      +  static const RtAudioFormat  RTAUDIO_FLOAT32; // 32-bit float normalized between +/- 1.0
      +  static const RtAudioFormat  RTAUDIO_FLOAT64; // 64-bit double normalized between +/- 1.0
      +

      +The nativeFormats member of the RtAudioDeviceInfo structure is a bit mask of the above formats which are natively supported by the device. However, RtAudio will automatically provide format conversion if a particular format is not natively supported. When the probed member of the RtAudioDeviceInfo structure is false, the remaining structure members are undefined and the device is probably unuseable.

      +While some audio devices may require a minimum channel value greater than one, RtAudio will provide automatic channel number compensation when the number of channels set by the user is less than that required by the device. Channel compensation is NOT possible when the number of channels set by the user is greater than that supported by the device.

      +It should be noted that the capabilities reported by a device driver or underlying audio API are not always accurate and/or may be dependent on a combination of device settings. For this reason, RtAudio does not typically rely on the queried values when attempting to open a stream.

      +Device Settings

      +The next step in using RtAudio is to open a stream with particular device and parameter settings.

      +

      #include "RtAudio.h"
      +
      +int main()
      +{
      +  int channels = 2;
      +  int sampleRate = 44100;
      +  int bufferSize = 256;  // 256 sample frames
      +  int nBuffers = 4;      // number of internal buffers used by device
      +  int device = 0;        // 0 indicates the default or first available device
         RtAudio *audio;
       
      -  // Instantiate RtAudio and open a stream within a try/catch block
      -  try {
      -    audio = new RtAudio();
      -    stream = audio->openStream(device, channels, 0, 0, RtAudio::RTAUDIO_FLOAT32,
      -                               sample_rate, &buffer_size, n_buffers);
      +  // Instantiate RtAudio and open a stream within a try/catch block
      +  try {
      +    audio = new RtAudio();
         }
      -  catch (RtError &error) {
      +  catch (RtError &error) {
           error.printMessage();
           exit(EXIT_FAILURE);
         }
       
      -  // Clean up
      -  delete audio;
      +  try {
      +    audio->openStream(device, channels, 0, 0, RTAUDIO_FLOAT32,
      +                      sampleRate, &bufferSize, nBuffers);
      +  }
      +  catch (RtError &error) {
      +    error.printMessage();
      +    // Perhaps try other parameters?
      +  }
       
      -  return 0;
      -}
      -

      -The RtAudio::openStream() method attempts to open a stream with a specified set of parameter values. When successful, a stream identifier is returned. In this case, we attempt to open a two channel playback stream with the default output device, 32-bit floating point data, a sample rate of 44100 Hz, a frame rate of 256 sample frames per read/write, and 4 internal device buffers. When device = 0, RtAudio first attempts to open the default audio device with the given parameters. If that attempt fails, RtAudio searches through the remaining available devices in an effort to find a device which will meet the given parameters. If all attempts are unsuccessful, an RtError is thrown. When a non-zero device value is specified, an attempt is made to open that device only (device = 1 specifies the first identified device, as reported by RtAudio::getDeviceInfo()). -

      -RtAudio provides four signed integer and two floating point data formats which can be specified using the RtAudio::RTAUDIO_FORMAT parameter values mentioned earlier. If the opened device does not natively support the given format, RtAudio will automatically perform the necessary data format conversion. -

      -The bufferSize parameter specifies the desired number of sample frames which will be written to and/or read from a device per write/read operation. The nBuffers parameter is used in setting the underlying device buffer parameters. Both the bufferSize and nBuffers parameters can be used to control stream latency though there is no guarantee that the passed values will be those used by a device (the nBuffers parameter is ignored when using the OS X CoreAudio and the Windows ASIO APIs). In general, lower values for both parameters will produce less latency but perhaps less robust performance. Both parameters can be specified with values of zero, in which case the smallest allowable values will be used. The bufferSize parameter is passed as a pointer and the actual value used by the stream is set during the device setup procedure. bufferSize values should be a power of two. Optimal and allowable buffer values tend to vary between systems and devices. Check the OS Notes section for general guidelines. -

      -As noted earlier, the device capabilities reported by a driver or underlying audio API are not always accurate and/or may be dependent on a combination of device settings. Because of this, RtAudio does not attempt to query a device's capabilities or use previously reported values when opening a device. Instead, RtAudio simply attempts to set the given parameters on a specified device and then checks whether the setup is successful or not. -

      -

      Playback (blocking functionality)

      + // Clean up + delete audio; -

      -Once the device is open for playback, there are only a few final steps necessary for realtime audio output. We'll first provide an example (blocking functionality) and then discuss the details. -

      -

      // playback.cpp
      -
      -#include "RtAudio.h"
      -
      -int main()
      -{
      -  int count;
      -  int channels = 2;
      -  int sample_rate = 44100;
      -  int buffer_size = 256;  // 256 sample frames
      -  int n_buffers = 4;      // number of internal buffers used by device
      -  float *buffer;
      -  int device = 0;         // 0 indicates the default or first available device
      -  int stream;             // our stream identifier
      +  return 0;
      +}
      +

      +The RtAudio::openStream() method attempts to open a stream with a specified set of parameter values. In this case, we attempt to open a two channel playback stream with the default output device, 32-bit floating point data, a sample rate of 44100 Hz, a frame rate of 256 sample frames per read/write, and 4 internal device buffers. When device = 0, RtAudio first attempts to open the default audio device with the given parameters. If that attempt fails, RtAudio searches through the remaining available devices in an effort to find a device which will meet the given parameters. If all attempts are unsuccessful, an RtError is thrown. When a non-zero device value is specified, an attempt is made to open that device ONLY (device = 1 specifies the first identified device, as reported by RtAudio::getDeviceInfo()).

      +RtAudio provides four signed integer and two floating point data formats which can be specified using the RtAudioFormat parameter values mentioned earlier. If the opened device does not natively support the given format, RtAudio will automatically perform the necessary data format conversion.

      +The bufferSize parameter specifies the desired number of sample frames which will be written to and/or read from a device per write/read operation. The nBuffers parameter is used in setting the underlying device buffer parameters. Both the bufferSize and nBuffers parameters can be used to control stream latency though there is no guarantee that the passed values will be those used by a device (the nBuffers parameter is ignored when using the OS X CoreAudio, Linux Jack, and the Windows ASIO APIs). In general, lower values for both parameters will produce less latency but perhaps less robust performance. Both parameters can be specified with values of zero, in which case the smallest allowable values will be used. The bufferSize parameter is passed as a pointer and the actual value used by the stream is set during the device setup procedure. bufferSize values should be a power of two. Optimal and allowable buffer values tend to vary between systems and devices. Check the API Notes section for general guidelines.

      +As noted earlier, the device capabilities reported by a driver or underlying audio API are not always accurate and/or may be dependent on a combination of device settings. Because of this, RtAudio does not attempt to query a device's capabilities or use previously reported values when opening a device. Instead, RtAudio simply attempts to set the given parameters on a specified device and then checks whether the setup is successful or not.

      +Playback (blocking functionality)

      +Once the device is open for playback, there are only a few final steps necessary for realtime audio output. We'll first provide an example (blocking functionality) and then discuss the details.

      +

      // playback.cpp
      +
      +#include "RtAudio.h"
      +
      +int main()
      +{
      +  int count;
      +  int channels = 2;
      +  int sampleRate = 44100;
      +  int bufferSize = 256;  // 256 sample frames
      +  int nBuffers = 4;      // number of internal buffers used by device
      +  float *buffer;
      +  int device = 0;        // 0 indicates the default or first available device
         RtAudio *audio;
       
      -  // Open a stream during RtAudio instantiation
      -  try {
      -    audio = new RtAudio(&stream, device, channels, 0, 0, RtAudio::RTAUDIO_FLOAT32,
      -                        sample_rate, &buffer_size, n_buffers);
      +  // Open a stream during RtAudio instantiation
      +  try {
      +    audio = new RtAudio(device, channels, 0, 0, RTAUDIO_FLOAT32,
      +                        sampleRate, &bufferSize, nBuffers);
         }
      -  catch (RtError &error) {
      +  catch (RtError &error) {
           error.printMessage();
           exit(EXIT_FAILURE);
         }
       
      -  try {
      -    // Get a pointer to the stream buffer
      -    buffer = (float *) audio->getStreamBuffer(stream);
      +  try {
      +    // Get a pointer to the stream buffer
      +    buffer = (float *) audio->getStreamBuffer();
       
      -    // Start the stream
      -    audio->startStream(stream);
      +    // Start the stream
      +    audio->startStream();
         }
      -  catch (RtError &error) {
      +  catch (RtError &error) {
           error.printMessage();
      -    goto cleanup;
      +    goto cleanup;
         }
       
      -  // An example loop which runs for about 40000 sample frames
      +  // An example loop which runs for 40000 sample frames
         count = 0;
      -  while (count < 40000) {
      -    // Generate your samples and fill the buffer with buffer_size sample frames of data
      +  while (count < 40000) {
      +    // Generate your samples and fill the buffer with bufferSize sample frames of data
           ...
       
      -    // Trigger the output of the data buffer
      -    try {
      -      audio->tickStream(stream);
      +    // Trigger the output of the data buffer
      +    try {
      +      audio->tickStream();
           }
      -    catch (RtError &error) {
      +    catch (RtError &error) {
             error.printMessage();
      -      goto cleanup;
      +      goto cleanup;
           }
       
      -    count += buffer_size;
      +    count += bufferSize;
         }
       
      -  try {
      -    // Stop and close the stream
      -    audio->stopStream(stream);
      -    audio->closeStream(stream);
      +  try {
      +    // Stop and close the stream
      +    audio->stopStream();
      +    audio->closeStream();
         }
      -  catch (RtError &error) {
      +  catch (RtError &error) {
           error.printMessage();
         }
       
        cleanup:
      -  delete audio;
      -
      -  return 0;
      -}
      -

      -The first thing to notice in this example is that we attempt to open a stream during class instantiation with an overloaded constructor. This constructor simply combines the functionality of the default constructor, used earlier, and the RtAudio::openStream() method. Again, we have specified a device value of 0, indicating that the default or first available device meeting the given parameters should be used. The integer identifier of the opened stream is returned via the stream pointer value. An attempt is made to open the stream with the specified bufferSize value. However, it is possible that the device will not accept this value, in which case the closest allowable size is used and returned via the pointer value. The constructor can fail if no available devices are found, or a memory allocation or device driver error occurs. Note that you should not call the RtAudio destructor if an exception is thrown during instantiation. -

      -Because RtAudio can typically be used to simultaneously control more than a single stream, it is necessary that the stream identifier be provided to nearly all public methods. Assuming the constructor is successful, it is necessary to get a pointer to the buffer, provided by RtAudio, for use in feeding data to/from the opened stream. Note that the user should NOT attempt to deallocate the stream buffer memory ... memory management for the stream buffer will be automatically controlled by RtAudio. After starting the stream with RtAudio::startStream(), one simply fills that buffer, which is of length equal to the returned bufferSize value, with interleaved audio data (in the specified format) for playback. Finally, a call to the RtAudio::tickStream() routine triggers a blocking write call for the stream. -

      -In general, one should call the RtAudio::stopStream() and RtAudio::closeStream() methods after finishing with a stream. However, both methods will implicitly be called during object destruction if necessary. -

      -

      Playback (callback functionality)

      + delete audio; -

      -The primary difference in using RtAudio with callback functionality involves the creation of a user-defined callback function. Here is an example which produces a sawtooth waveform for playback. -

      -

      #include <iostream>
      -#include "RtAudio.h"
      -
      -// Two-channel sawtooth wave generator.
      -int sawtooth(char *buffer, int buffer_size, void *data)
      -{
      -  int i, j;
      -  double *my_buffer = (double *) buffer;
      -  double *my_data = (double *) data;
      -
      -  // Write interleaved audio data.
      -  for (i=0; i<buffer_size; i++) {
      -    for (j=0; j<2; j++) {
      +  return 0;
      +}
      +

      +The first thing to notice in this example is that we attempt to open a stream during class instantiation with an overloaded constructor. This constructor simply combines the functionality of the default constructor, used earlier, and the RtAudio::openStream() method. Again, we have specified a device value of 0, indicating that the default or first available device meeting the given parameters should be used. An attempt is made to open the stream with the specified bufferSize value. However, it is possible that the device will not accept this value, in which case the closest allowable size is used and returned via the pointer value. The constructor can fail if no available devices are found, or a memory allocation or device driver error occurs. Note that you should not call the RtAudio destructor if an exception is thrown during instantiation.

      +Assuming the constructor is successful, it is necessary to get a pointer to the buffer, provided by RtAudio, for use in feeding data to/from the opened stream. Note that the user should NOT attempt to deallocate the stream buffer memory ... memory management for the stream buffer will be automatically controlled by RtAudio. After starting the stream with RtAudio::startStream(), one simply fills that buffer, which is of length equal to the returned bufferSize value, with interleaved audio data (in the specified format) for playback. Finally, a call to the RtAudio::tickStream() routine triggers a blocking write call for the stream.

      +In general, one should call the RtAudio::stopStream() and RtAudio::closeStream() methods after finishing with a stream. However, both methods will implicitly be called during object destruction if necessary.

      +Playback (callback functionality)

      +The primary difference in using RtAudio with callback functionality involves the creation of a user-defined callback function. Here is an example which produces a sawtooth waveform for playback.

      +

      #include <iostream>
      +#include "RtAudio.h"
      +
      +// Two-channel sawtooth wave generator.
      +int sawtooth(char *buffer, int bufferSize, void *data)
      +{
      +  int i, j;
      +  double *my_buffer = (double *) buffer;
      +  double *my_data = (double *) data;
      +
      +  // Write interleaved audio data.
      +  for (i=0; i<bufferSize; i++) {
      +    for (j=0; j<2; j++) {
             *my_buffer++ = my_data[j];
       
             my_data[j] += 0.005 * (j+1+(j*0.1));
      -      if (my_data[j] >= 1.0) my_data[j] -= 2.0;
      +      if (my_data[j] >= 1.0) my_data[j] -= 2.0;
           }
         }
       
      -  return 0;
      +  return 0;
       }
       
      -int main()
      -{
      -  int channels = 2;
      -  int sample_rate = 44100;
      -  int buffer_size = 256;  // 256 sample frames
      -  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;
      +int main()
      +{
      +  int channels = 2;
      +  int sampleRate = 44100;
      +  int bufferSize = 256;  // 256 sample frames
      +  int nBuffers = 4;      // number of internal buffers used by device
      +  int device = 0;        // 0 indicates the default or first available device
      +  double data[2];
      +  char input;
         RtAudio *audio;
       
      -  // Open a stream during RtAudio instantiation
      -  try {
      -    audio = new RtAudio(&stream, device, channels, 0, 0, RtAudio::RTAUDIO_FLOAT64,
      -                        sample_rate, &buffer_size, n_buffers);
      +  // Open a stream during RtAudio instantiation
      +  try {
      +    audio = new RtAudio(device, channels, 0, 0, RTAUDIO_FLOAT64,
      +                        sampleRate, &bufferSize, nBuffers);
         }
      -  catch (RtError &error) {
      +  catch (RtError &error) {
           error.printMessage();
           exit(EXIT_FAILURE);
         }
       
      -  try {
      -    // Set the stream callback function
      -    audio->setStreamCallback(stream, &sawtooth, (void *)data);
      +  try {
      +    // Set the stream callback function
      +    audio->setStreamCallback(&sawtooth, (void *)data);
       
      -    // Start the stream
      -    audio->startStream(stream);
      +    // Start the stream
      +    audio->startStream();
         }
      -  catch (RtError &error) {
      +  catch (RtError &error) {
           error.printMessage();
      -    goto cleanup;
      +    goto cleanup;
         }
       
      -  cout << "\nPlaying ... press <enter> to quit.\n";
      -  cin.get(input);
      +  std::cout << "\nPlaying ... press <enter> to quit.\n";
      +  std::cin.get(input);
       
      -  try {
      -    // Stop and close the stream
      -    audio->stopStream(stream);
      -    audio->closeStream(stream);
      +  try {
      +    // Stop and close the stream
      +    audio->stopStream();
      +    audio->closeStream();
         }
      -  catch (RtError &error) {
      +  catch (RtError &error) {
           error.printMessage();
         }
       
        cleanup:
      -  delete audio;
      -
      -  return 0;
      -}
      -

      -After opening the device in exactly the same way as the previous example (except with a data format change), we must set our callback function for the stream using RtAudio::setStreamCallback(). When the underlying audio API uses blocking calls (OSS, ALSA, SGI, and Windows DirectSound), this method will spawn a new process (or thread) which automatically calls the callback function when more data is needed. Callback-based audio APIs (OS X CoreAudio and ASIO) implement their own event notification schemes. Note that the callback function is called only when the stream is "running" (between calls to the RtAudio::startStream() and RtAudio::stopStream() methods). The last argument to RtAudio::setStreamCallback() is a pointer to arbitrary data that you wish to access from within your callback function. -

      -In this example, we stop the stream with an explicit call to RtAudio::stopStream(). When using callback functionality, it is also possible to stop a stream by returning a non-zero value from the callback function. -

      -Once set with RtAudio::setStreamCallback, the callback process exists for the life of the stream (until the stream is closed with RtAudio::closeStream() or the RtAudio instance is deleted). It is possible to disassociate a callback function and cancel its process for an open stream using the RtAudio::cancelStreamCallback() method. The stream can then be used with blocking functionality or a new callback can be associated with it. -

      -

      Recording

      + delete audio; -

      -Using RtAudio for audio input is almost identical to the way it is used for playback. Here's the blocking playback example rewritten for recording: -

      -

      // record.cpp
      -
      -#include "RtAudio.h"
      -
      -int main()
      -{
      -  int count;
      -  int channels = 2;
      -  int sample_rate = 44100;
      -  int buffer_size = 256;  // 256 sample frames
      -  int n_buffers = 4;      // number of internal buffers used by device
      -  float *buffer;
      -  int device = 0;         // 0 indicates the default or first available device
      -  int stream;             // our stream identifier
      +  return 0;
      +}
      +

      +After opening the device in exactly the same way as the previous example (except with a data format change), we must set our callback function for the stream using RtAudio::setStreamCallback(). When the underlying audio API uses blocking calls (OSS, ALSA, SGI, and Windows DirectSound), this method will spawn a new process (or thread) which automatically calls the callback function when more data is needed. Callback-based audio APIs (OS X CoreAudio Linux Jack, and ASIO) implement their own event notification schemes. Note that the callback function is called only when the stream is "running" (between calls to the RtAudio::startStream() and RtAudio::stopStream() methods). The last argument to RtAudio::setStreamCallback() is a pointer to arbitrary data that you wish to access from within your callback function.

      +In this example, we stop the stream with an explicit call to RtAudio::stopStream(). When using callback functionality, it is also possible to stop a stream by returning a non-zero value from the callback function.

      +Once set with RtAudio::setStreamCallback, the callback process exists for the life of the stream (until the stream is closed with RtAudio::closeStream() or the RtAudio instance is deleted). It is possible to disassociate a callback function and cancel its process for an open stream using the RtAudio::cancelStreamCallback() method. The stream can then be used with blocking functionality or a new callback can be associated with it.

      +Recording

      +Using RtAudio for audio input is almost identical to the way it is used for playback. Here's the blocking playback example rewritten for recording:

      +

      // record.cpp
      +
      +#include "RtAudio.h"
      +
      +int main()
      +{
      +  int count;
      +  int channels = 2;
      +  int sampleRate = 44100;
      +  int bufferSize = 256;  // 256 sample frames
      +  int nBuffers = 4;      // number of internal buffers used by device
      +  float *buffer;
      +  int device = 0;        // 0 indicates the default or first available device
         RtAudio *audio;
       
      -  // Instantiate RtAudio and open a stream.
      -  try {
      -    audio = new RtAudio(&stream, 0, 0, device, channels,
      -                        RtAudio::RTAUDIO_FLOAT32, sample_rate, &buffer_size, n_buffers);
      +  // Instantiate RtAudio and open a stream.
      +  try {
      +    audio = new RtAudio(&stream, 0, 0, device, channels,
      +                        RTAUDIO_FLOAT32, sampleRate, &bufferSize, nBuffers);
         }
      -  catch (RtError &error) {
      +  catch (RtError &error) {
           error.printMessage();
           exit(EXIT_FAILURE);
         }
       
      -  try {
      -    // Get a pointer to the stream buffer
      -    buffer = (float *) audio->getStreamBuffer(stream);
      +  try {
      +    // Get a pointer to the stream buffer
      +    buffer = (float *) audio->getStreamBuffer();
       
      -    // Start the stream
      -    audio->startStream(stream);
      +    // Start the stream
      +    audio->startStream();
         }
      -  catch (RtError &error) {
      +  catch (RtError &error) {
           error.printMessage();
      -    goto cleanup;
      +    goto cleanup;
         }
       
      -  // An example loop which runs for about 40000 sample frames
      +  // An example loop which runs for about 40000 sample frames
         count = 0;
      -  while (count < 40000) {
      +  while (count < 40000) {
       
      -    // Read a buffer of data
      -    try {
      -      audio->tickStream(stream);
      +    // Read a buffer of data
      +    try {
      +      audio->tickStream();
           }
      -    catch (RtError &error) {
      +    catch (RtError &error) {
             error.printMessage();
      -      goto cleanup;
      +      goto cleanup;
           }
       
      -    // Process the input samples (buffer_size sample frames) that were read
      +    // Process the input samples (bufferSize sample frames) that were read
           ...
       
      -    count += buffer_size;
      +    count += bufferSize;
         }
       
      -  try {
      -    // Stop the stream
      -    audio->stopStream(stream);
      +  try {
      +    // Stop the stream
      +    audio->stopStream();
         }
      -  catch (RtError &error) {
      +  catch (RtError &error) {
           error.printMessage();
         }
       
        cleanup:
      -  delete audio;
      -
      -  return 0;
      -}
      -

      -In this example, the stream was opened for recording with a non-zero inputChannels value. The only other difference between this example and that for playback involves the order of data processing in the loop, where it is necessary to first read a buffer of input data before manipulating it. -

      -

      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 simply scale the input data before sending it back to the output. -

      -

      // duplex.cpp
      -
      -#include <iostream>
      -#include "RtAudio.h"
      -
      -// Pass-through function.
      -int scale(char *buffer, int buffer_size, void *)
      -{
      -  // Note: do nothing here for pass through.
      -  double *my_buffer = (double *) buffer;
      +  delete audio;
       
      -  // Scale input data for output.
      -  for (int i=0; i<buffer_size; i++) {
      -    // Do for two channels.
      +  return 0;
      +}
      +

      +In this example, the stream was opened for recording with a non-zero inputChannels value. The only other difference between this example and that for playback involves the order of data processing in the loop, where it is necessary to first read a buffer of input data before manipulating it.

      +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 simply scale the input data before sending it back to the output.

      +

      // duplex.cpp
      +
      +#include <iostream>
      +#include "RtAudio.h"
      +
      +// Pass-through function.
      +int scale(char *buffer, int bufferSize, void *)
      +{
      +  // Note: do nothing here for pass through.
      +  double *my_buffer = (double *) buffer;
      +
      +  // Scale input data for output.
      +  for (int i=0; i<bufferSize; i++) {
      +    // Do for two channels.
           *my_buffer++ *= 0.5;
           *my_buffer++ *= 0.5;
         }
       
      -  return 0;
      +  return 0;
       }
       
      -int main()
      -{
      -  int channels = 2;
      -  int sample_rate = 44100;
      -  int buffer_size = 256;  // 256 sample frames
      -  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
      -  char input;
      +int main()
      +{
      +  int channels = 2;
      +  int sampleRate = 44100;
      +  int bufferSize = 256;  // 256 sample frames
      +  int nBuffers = 4;      // number of internal buffers used by device
      +  int device = 0;        // 0 indicates the default or first available device
      +  char input;
         RtAudio *audio;
       
      -  // Open a stream during RtAudio instantiation
      -  try {
      -    audio = new RtAudio(&stream, device, channels, device, channels, RtAudio::RTAUDIO_FLOAT64,
      -                        sample_rate, &buffer_size, n_buffers);
      +  // Open a stream during RtAudio instantiation
      +  try {
      +    audio = new RtAudio(device, channels, device, channels, RTAUDIO_FLOAT64,
      +                        sampleRate, &bufferSize, nBuffers);
         }
      -  catch (RtError &error) {
      +  catch (RtError &error) {
           error.printMessage();
           exit(EXIT_FAILURE);
         }
       
      -  try {
      -    // Set the stream callback function
      -    audio->setStreamCallback(stream, &scale, NULL);
      +  try {
      +    // Set the stream callback function
      +    audio->setStreamCallback(&scale, NULL);
       
      -    // Start the stream
      -    audio->startStream(stream);
      +    // Start the stream
      +    audio->startStream();
         }
      -  catch (RtError &error) {
      +  catch (RtError &error) {
           error.printMessage();
      -    goto cleanup;
      +    goto cleanup;
         }
       
      -  cout << "\nRunning duplex ... press <enter> to quit.\n";
      -  cin.get(input);
      +  std::cout << "\nRunning duplex ... press <enter> to quit.\n";
      +  std::cin.get(input);
       
      -  try {
      -    // Stop and close the stream
      -    audio->stopStream(stream);
      -    audio->closeStream(stream);
      +  try {
      +    // Stop and close the stream
      +    audio->stopStream();
      +    audio->closeStream();
         }
      -  catch (RtError &error) {
      +  catch (RtError &error) {
           error.printMessage();
         }
       
        cleanup:
      -  delete audio;
      -
      -  return 0;
      -}
      -

      -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 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. -

      -

      Summary of Methods

      + delete audio; -

      -The following is short summary of public methods (not including constructors and the destructor) provided by RtAudio: -

      + return 0; +} +

      +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 scaled and played out during the next round of audio processing.

      +Note that duplex operation can also be achieved by opening one output stream instance and one input stream instance 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.

      +Using Simultaneous Multiple APIs

      +Because support for each audio API is encapsulated in a specific RtApi subclass, it is possible to compile and instantiate multiple API-specific subclasses on a given operating system. For example, one can compile both the RtApiDs and RtApiAsio classes on Windows operating systems by providing the appropriate preprocessor definitions, include files, and libraries for each. In a run-time situation, one might first attempt to determine whether any ASIO device drivers exist. This can be done by specifying the api argument RtAudio::WINDOWS_ASIO when attempting to create an instance of RtAudio. If an RtError is thrown (indicating no available drivers), then an instance of RtAudio with the api argument RtAudio::WINDOWS_DS can be created. Alternately, if no api argument is specified, RtAudio will first look for ASIO drivers and then DirectSound drivers (on Linux systems, the default API search order is Jack, Alsa, and finally OSS). In theory, it should also be possible to have separate instances of RtAudio open at the same time with different underlying audio API support, though this has not been tested. It is difficult to know how well different audio APIs can simultaneously coexist on a given operating system. In particular, it is most unlikely that the same device could be simultaneously controlled with two different audio APIs.

      +Summary of Methods

      +The following is a short summary of public methods (not including constructors and the destructor) provided by RtAudio:

        -
      • RtAudio::openStream(): opens a stream with the specified parameters.
      • RtAudio::setStreamCallback(): sets a user-defined callback function for a given stream.
      • RtAudio::cancelStreamCallback(): cancels a callback process and function for a given stream.
      • RtAudio::getDeviceCount(): returns the number of audio devices available.
      • RtAudio::getDeviceInfo(): fills a user-supplied RTAUDIO_DEVICE structure for a specified device.
      • RtAudio::getStreamBuffer(): returns a pointer to the stream buffer.
      • RtAudio::tickStream(): triggers processing of input/output data for a stream (blocking).
      • RtAudio::closeStream(): closes the specified stream (implicitly called during object destruction). Once a stream is closed, the stream identifier is invalid and should not be used in calling any other RtAudio methods.
      • RtAudio::startStream(): (re)starts the specified stream, typically after it has been stopped with either stopStream() or abortStream() or after first opening the stream.
      • RtAudio::stopStream(): stops the specified stream, allowing any remaining samples in the queue to be played out and/or read in. This does not implicitly call RtAudio::closeStream().
      • RtAudio::abortStream(): stops the specified stream, discarding any remaining samples in the queue. This does not implicitly call closeStream().
      • RtAudio::streamWillBlock(): queries a stream to determine whether a call to the tickStream() method will block. A return value of 0 indicates that the stream will NOT block. A positive return value indicates the number of sample frames that cannot yet be processed without blocking.
      - -

      -

      Compiling

      - -

      -In order to compile RtAudio for a specific OS and audio API, it is necessary to supply the appropriate preprocessor definition and library within the compiler statement: -

      - -

      - - - - - - -
      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
      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
      - -

      - -

      -The example compiler statements above could be used to compile the probe.cpp example file, assuming that probe.cpp, RtAudio.h, and RtAudio.cpp all exist in the same directory. -

      -

      Debugging

      - -

      -If you are having problems getting RtAudio to run on your system, try passing the preprocessor definition __RTAUDIO_DEBUG__ to the compiler (or uncomment the definition at the bottom of RtAudio.h). A variety of warning messages will be displayed which may help in determining the problem. -

      -

      OS Notes

      - -

      -RtAudio is designed to provide a common API across the various supported operating systems and audio libraries. Despite that, some issues need to be mentioned with regard to each. -

      -

      Linux:

      - -

      -RtAudio for Linux was developed under Redhat distributions 7.0 - 7.2. Two different audio APIs are supported on Linux platforms: OSS and ALSA. The OSS API has existed for at least 6 years and the Linux kernel is distributed with free versions of OSS audio drivers. Therefore, a generic Linux system is most likely to have OSS support. The ALSA API, although relatively new, is now part of the Linux development kernel and offers significantly better functionality than the OSS API. RtAudio provides support for the 0.9 and higher versions of ALSA. Input/output latency on the order of 15 milliseconds can typically be achieved under both OSS or ALSA by fine-tuning the RtAudio buffer parameters (without kernel modifications). Latencies on the order of 5 milliseconds or less can be achieved using a low-latency kernel patch and increasing FIFO scheduling priority. The pthread library, which is used for callback functionality, is a standard component of all Linux distributions. -

      -The ALSA library includes OSS emulation support. That means that you can run programs compiled for the OSS API even when using the ALSA drivers and library. It should be noted however that OSS emulation under ALSA is not perfect. Specifically, channel number queries seem to consistently produce invalid results. While OSS emulation is successful for the majority of RtAudio tests, it is recommended that the native ALSA implementation of RtAudio be used on systems which have ALSA drivers installed. -

      -The ALSA implementation of RtAudio makes no use of the ALSA "plug" interface. All necessary data format conversions, channel compensation, de-interleaving, and byte-swapping is handled by internal RtAudio routines. -

      -

      Macintosh OS X (CoreAudio):

      - -

      -The Apple CoreAudio API is based on a callback scheme. RtAudio provides blocking functionality, in addition to callback functionality, within the context of that behavior. CoreAudio is designed to use a separate callback procedure for each of its audio devices. A single RtAudio duplex stream using two different devices is supported, though it cannot be guaranteed to always behave correctly because we cannot synchronize these two callbacks. This same functionality can be achieved with better synchrony by opening two separate streams for the devices and using RtAudio blocking calls (i.e. RtAudio::tickStream()). The numberOfBuffers parameter to the RtAudio::openStream() function has no affect in this implementation. It is not currently possible to have multiple simultaneous RtAudio streams accessing the same device. -

      -

      Irix (SGI):

      - -

      -The Irix version of RtAudio was written and tested on an SGI Indy running Irix version 6.5.4 and the newer "al" audio library. RtAudio does not compile under Irix version 6.3, mainly because the C++ compiler is too old. Despite the relatively slow speed of the Indy, RtAudio was found to behave quite well and input/output latency was very good. No problems were found with respect to using the pthread library. -

      -

      Windows (DirectSound):

      - -

      -In order to compile RtAudio under Windows for the DirectSound API, you must have the header and source files for DirectSound version 5.0 or higher. As far as I know, there is no DirectSoundCapture support for Windows NT. Audio output latency with DirectSound can be reasonably good (on the order of 20 milliseconds). On the other hand, input audio latency tends to be terrible (100 milliseconds or more). Further, DirectSound drivers tend to crash easily when experimenting with buffer parameters. On my system, I found it necessary to use values around nBuffers = 8 and bufferSize = 512 to avoid crashes. RtAudio was developed with Visual C++ version 6.0. I was forced in several instances to modify code in order to get it to compile under the non-standard version of C++ that Microsoft so unprofessionally implemented. Unfortunately, it appears they are continuing to undermine the C++ standard with more recent compiler releases. -

      -

      Windows (ASIO):

      - -

      -The Steinberg ASIO audio API is based on a callback scheme. In addition, the API allows only a single device driver to be loaded and accessed at a time. Therefore, it is not possible to have multiple simultaneous RtAudio streams running concurrently with this API. ASIO device drivers must be supplied by audio hardware manufacturers, though ASIO emulation is possible on top of systems with DirectSound drivers. The numberOfBuffers parameter to the RtAudio::openStream() function has no affect in this implementation. -

      -A number of ASIO source and header files are required for use with RtAudio. Specifically, an RtAudio project must include the following files: asio.h,cpp; asiodrivers.h,cpp; asiolist.h,cpp; asiodrvr.h; asiosys.h; ginclude.h; iasiodrv.h. See the /tests/asio/ directory for example Visual C++ 6.0 projects. -

      -

      Acknowledgements

      - -

      -The RtAudio API incorporates many of the concepts developed in the PortAudio project by Phil Burk and Ross Bencina. Early development also incorporated ideas from Bill Schottstaedt's sndlib. The CCRMA SoundWire group provided valuable feedback during the API proposal stages. -

      -RtAudio, version 2.0, was slowly developed over the course of many months while in residence at the Institut Universitari de L'Audiovisual (IUA) in Barcelona, Spain, the Laboratory of Acoustics and Audio Signal Processing at the Helsinki University of Technology, Finland, and the Center for Computer Research in Music and Acoustics (CCRMA) at Stanford University. This work was supported in part by the United States Air Force Office of Scientific Research (grant #F49620-99-1-0293). -

      -

      License

      - -

      -RtAudio: a realtime audio i/o C++ class
      - Copyright (c) 2001-2002 Gary P. Scavone -

      -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -

      -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -

      -Any person wishing to distribute modifications to the Software is requested to send the modifications to the original developer so that they can be incorporated into the canonical version. -

      -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +

    • +RtAudio::openStream(): opens a stream with the specified parameters.
    • +
    • +RtAudio::setStreamCallback(): sets a user-defined callback function for the stream.
    • +
    • +RtAudio::cancelStreamCallback(): cancels a callback process and function for the stream.
    • +
    • +RtAudio::getDeviceCount(): returns the number of audio devices available.
    • +
    • +RtAudio::getDeviceInfo(): returns an RtAudioDeviceInfo structure for a specified device.
    • +
    • +RtAudio::getStreamBuffer(): returns a pointer to the stream buffer.
    • +
    • +RtAudio::tickStream(): triggers processing of input/output data for the stream (blocking).
    • +
    • +RtAudio::closeStream(): closes the stream (implicitly called during object destruction).
    • +
    • +RtAudio::startStream(): (re)starts the stream, typically after it has been stopped with either stopStream() or abortStream() or after first opening the stream.
    • +
    • +RtAudio::stopStream(): stops the stream, allowing any remaining samples in the queue to be played out and/or read in. This does not implicitly call RtAudio::closeStream().
    • +
    • +RtAudio::abortStream(): stops the stream, discarding any remaining samples in the queue. This does not implicitly call closeStream().
    • + +

      +Compiling

      +In order to compile RtAudio for a specific OS and audio API, it is necessary to supply the appropriate preprocessor definition and library within the compiler statement:

      + + + + + + + + + + + + + + + + + +
      OS: Audio API: C++ Class: Preprocessor Definition: Library or Framework: Example Compiler Statement:
      Linux ALSA RtApiAlsa __LINUX_ALSA__ asound, pthread g++ -Wall -D__LINUX_ALSA__ -o probe probe.cpp RtAudio.cpp -lasound -lpthread
      Linux Jack Audio Server RtApiJack __LINUX_JACK__ jack, pthread g++ -Wall -D__LINUX_JACK__ -o probe probe.cpp RtAudio.cpp `pkg-config --cflags --libs jack` -lpthread
      Linux OSS RtApiOss __LINUX_OSS__ pthread g++ -Wall -D__LINUX_OSS__ -o probe probe.cpp RtAudio.cpp -lpthread
      Macintosh OS X CoreAudio RtApiCore __MACOSX_CORE__ pthread, stdc++, CoreAudio g++ -Wall -D__MACOSX_CORE__ -o probe probe.cpp RtAudio.cpp -framework CoreAudio -lpthread
      Irix AL RtApiAl __IRIX_AL__ audio, pthread CC -Wall -D__IRIX_AL__ -o probe probe.cpp RtAudio.cpp -laudio -lpthread
      Windows Direct Sound RtApiDs __WINDOWS_DS__ dsound.lib (ver. 5.0 or higher), multithreaded compiler specific
      Windows ASIO RtApiAsio __WINDOWS_ASIO__ various ASIO header and source files compiler specific

      -


      - -
      - ©2001-2002 Gary P. Scavone, CCRMA, Stanford University. All Rights Reserved.
      - Maintained by Gary P. Scavone, gary@ccrma.stanford.edu

      +The example compiler statements above could be used to compile the probe.cpp example file, assuming that probe.cpp, RtAudio.h, RtError.h, and RtAudio.cpp all exist in the same directory.

      +Debugging

      +If you are having problems getting RtAudio to run on your system, try passing the preprocessor definition __RTAUDIO_DEBUG__ to the compiler (or uncomment the definition at the bottom of RtAudio.h). A variety of warning messages will be displayed which may help in determining the problem. Also try using the programs included in the test directory. The program info displays the queried capabilities of all hardware devices found.

      +API Notes

      +RtAudio is designed to provide a common API across the various supported operating systems and audio libraries. Despite that, some issues should be mentioned with regard to each.

      +Linux:

      +RtAudio for Linux was developed under Redhat distributions 7.0 - Fedora. Three different audio APIs are supported on Linux platforms: OSS, ALSA, and Jack. The OSS API has existed for at least 6 years and the Linux kernel is distributed with free versions of OSS audio drivers. Therefore, a generic Linux system is most likely to have OSS support (though the availability and quality of OSS drivers for new hardware is decreasing). The ALSA API, although relatively new, is now part of the Linux development kernel and offers significantly better functionality than the OSS API. RtAudio provides support for the 1.0 and higher versions of ALSA. Jack, which is still in development, is a low-latency audio server, written primarily for the GNU/Linux operating system. It can connect a number of different applications to an audio device, as well as allow them to share audio between themselves. Input/output latency on the order of 15 milliseconds can typically be achieved using any of the Linux APIs by fine-tuning the RtAudio buffer parameters (without kernel modifications). Latencies on the order of 5 milliseconds or less can be achieved using a low-latency kernel patch and increasing FIFO scheduling priority. The pthread library, which is used for callback functionality, is a standard component of all Linux distributions.

      +The ALSA library includes OSS emulation support. That means that you can run programs compiled for the OSS API even when using the ALSA drivers and library. It should be noted however that OSS emulation under ALSA is not perfect. Specifically, channel number queries seem to consistently produce invalid results. While OSS emulation is successful for the majority of RtAudio tests, it is recommended that the native ALSA implementation of RtAudio be used on systems which have ALSA drivers installed.

      +The ALSA implementation of RtAudio makes no use of the ALSA "plug" interface. All necessary data format conversions, channel compensation, de-interleaving, and byte-swapping is handled by internal RtAudio routines.

      +The Jack API is based on a callback scheme. RtAudio provides blocking functionality, in addition to callback functionality, within the context of that behavior. It should be noted, however, that the best performance is achieved when using RtAudio's callback functionality with the Jack API. At the moment, only one RtAudio instance can be connected to the Jack server. Because RtAudio does not provide a mechanism for allowing the user to specify particular channels (or ports) of a device, it simply opens the first N enumerated Jack ports for input/output.

      +Macintosh OS X (CoreAudio):

      +The Apple CoreAudio API is based on a callback scheme. RtAudio provides blocking functionality, in addition to callback functionality, within the context of that behavior. CoreAudio is designed to use a separate callback procedure for each of its audio devices. A single RtAudio duplex stream using two different devices is supported, though it cannot be guaranteed to always behave correctly because we cannot synchronize these two callbacks. This same functionality might be achieved with better synchrony by creating separate instances of RtAudio for each device and making use of RtAudio blocking calls (i.e. RtAudio::tickStream()). The numberOfBuffers parameter to the RtAudio::openStream() function has no affect in this implementation.

      +It is not possible to have multiple instances of RtAudio accessing the same CoreAudio device.

      +Irix (SGI):

      +The Irix version of RtAudio was written and tested on an SGI Indy running Irix version 6.5.4 and the newer "al" audio library. RtAudio does not compile under Irix version 6.3, mainly because the C++ compiler is too old. Despite the relatively slow speed of the Indy, RtAudio was found to behave quite well and input/output latency was very good. No problems were found with respect to using the pthread library.

      +Windows (DirectSound):

      +In order to compile RtAudio under Windows for the DirectSound API, you must have the header and source files for DirectSound version 5.0 or higher. As far as I know, there is no DirectSoundCapture support for Windows NT. Audio output latency with DirectSound can be reasonably good (on the order of 20 milliseconds). On the other hand, input audio latency tends to be terrible (100 milliseconds or more). Further, DirectSound drivers tend to crash easily when experimenting with buffer parameters. On my system, I found it necessary to use values around nBuffers = 8 and bufferSize = 512 to avoid crashes. RtAudio was originally developed with Visual C++ version 6.0.

      +Windows (ASIO):

      +The Steinberg ASIO audio API is based on a callback scheme. In addition, the API allows only a single device driver to be loaded and accessed at a time. ASIO device drivers must be supplied by audio hardware manufacturers, though ASIO emulation is possible on top of systems with DirectSound drivers. The numberOfBuffers parameter to the RtAudio::openStream() function has no affect in this implementation.

      +A number of ASIO source and header files are required for use with RtAudio. Specifically, an RtAudio project must include the following files: asio.h,cpp; asiodrivers.h,cpp; asiolist.h,cpp; asiodrvr.h; asiosys.h; ginclude.h; iasiodrv.h. The Visual C++ projects found in /tests/Windows/ compile both ASIO and DirectSound support.

      +Acknowledgements

      +The RtAudio API incorporates many of the concepts developed in the PortAudio project by Phil Burk and Ross Bencina. Early development also incorporated ideas from Bill Schottstaedt's sndlib. The CCRMA SoundWire group provided valuable feedback during the API proposal stages.

      +The early 2.0 version of RtAudio was slowly developed over the course of many months while in residence at the Institut Universitari de L'Audiovisual (IUA) in Barcelona, Spain and the Laboratory of Acoustics and Audio Signal Processing at the Helsinki University of Technology, Finland. Much subsequent development happened while working at the Center for Computer Research in Music and Acoustics (CCRMA) at Stanford University. The most recent version of RtAudio was finished while working as an assistant professor of Music Technology at McGill University. This work was supported in part by the United States Air Force Office of Scientific Research (grant #F49620-99-1-0293).

      +License

      +RtAudio: a realtime audio i/o C++ classes
      + Copyright (c) 2001-2004 Gary P. Scavone

      +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

      +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

      +Any person wishing to distribute modifications to the Software is requested to send the modifications to the original developer so that they can be incorporated into the canonical version.

      +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


      + + +
      ©2001-2004 Gary P. Scavone, McGill University. All Rights Reserved.
      + Maintained by Gary P. Scavone, gary@music.mcgill.ca
      diff --git a/doc/html/structRtAudioDeviceInfo-members.html b/doc/html/structRtAudioDeviceInfo-members.html new file mode 100644 index 0000000..41f4924 --- /dev/null +++ b/doc/html/structRtAudioDeviceInfo-members.html @@ -0,0 +1,28 @@ + + +The RtAudio Tutorial + + + +
      +Tutorial   Class/Enum List   File List   Compound Members  
      +
      + +

      RtAudioDeviceInfo Member List

      This is the complete list of members for RtAudioDeviceInfo, including all inherited members. + + + + + + + + +
      duplexChannelsRtAudioDeviceInfo
      inputChannelsRtAudioDeviceInfo
      isDefaultRtAudioDeviceInfo
      nameRtAudioDeviceInfo
      nativeFormatsRtAudioDeviceInfo
      outputChannelsRtAudioDeviceInfo
      probedRtAudioDeviceInfo
      sampleRatesRtAudioDeviceInfo

      + + + +
      ©2001-2004 Gary P. Scavone, McGill University. All Rights Reserved.
      + Maintained by Gary P. Scavone, gary@music.mcgill.ca
      + + + diff --git a/doc/html/structRtAudioDeviceInfo.html b/doc/html/structRtAudioDeviceInfo.html new file mode 100644 index 0000000..9039a18 --- /dev/null +++ b/doc/html/structRtAudioDeviceInfo.html @@ -0,0 +1,226 @@ + + +The RtAudio Tutorial + + + +
      +Tutorial   Class/Enum List   File List   Compound Members  
      +
      + +

      RtAudioDeviceInfo Struct Reference

      The public device information structure for returning queried values. +More... +

      +#include <RtAudio.h> +

      +List of all members. + + + + + + + + + + + + + + + + + + +

      Public Attributes

      std::string name
      bool probed
      int outputChannels
      int inputChannels
      int duplexChannels
      bool isDefault
      std::vector< int > sampleRates
      RtAudioFormat nativeFormats
      +


      Detailed Description

      +The public device information structure for returning queried values. +

      +


      Member Data Documentation

      +

      + + + + +
      + + +
      std::string RtAudioDeviceInfo::name +
      +
      + + + + + +
      +   + + +

      +Character string device identifier.

      +

      + + + + +
      + + +
      bool RtAudioDeviceInfo::probed +
      +
      + + + + + +
      +   + + +

      +true if the device capabilities were successfully probed.

      +

      + + + + +
      + + +
      int RtAudioDeviceInfo::outputChannels +
      +
      + + + + + +
      +   + + +

      +Maximum output channels supported by device.

      +

      + + + + +
      + + +
      int RtAudioDeviceInfo::inputChannels +
      +
      + + + + + +
      +   + + +

      +Maximum input channels supported by device.

      +

      + + + + +
      + + +
      int RtAudioDeviceInfo::duplexChannels +
      +
      + + + + + +
      +   + + +

      +Maximum simultaneous input/output channels supported by device.

      +

      + + + + +
      + + +
      bool RtAudioDeviceInfo::isDefault +
      +
      + + + + + +
      +   + + +

      +true if this is the default output or input device.

      +

      + + + + +
      + + +
      std::vector<int> RtAudioDeviceInfo::sampleRates +
      +
      + + + + + +
      +   + + +

      +Supported sample rates (queried from list of standard rates).

      +

      + + + + +
      + + +
      RtAudioFormat RtAudioDeviceInfo::nativeFormats +
      +
      + + + + + +
      +   + + +

      +Bit mask of supported data formats.

      +


      The documentation for this struct was generated from the following file: +
      + + + +
      ©2001-2004 Gary P. Scavone, McGill University. All Rights Reserved.
      + Maintained by Gary P. Scavone, gary@music.mcgill.ca
      + + + diff --git a/doc/html/structRtAudio_1_1RTAUDIO__DEVICE-members.html b/doc/html/structRtAudio_1_1RTAUDIO__DEVICE-members.html deleted file mode 100644 index 21141e9..0000000 --- a/doc/html/structRtAudio_1_1RTAUDIO__DEVICE-members.html +++ /dev/null @@ -1,34 +0,0 @@ - - -The RtAudio Tutorial - - - -
      -Tutorial   Class/Enum List   File List   Compound Members  
      -
      - -

      RtAudio::RTAUDIO_DEVICE Member List

      This is the complete list of members for RtAudio::RTAUDIO_DEVICE, including all inherited members. -
      - -
      - ©2001-2002 Gary P. Scavone, CCRMA, Stanford University. All Rights Reserved.
      - Maintained by Gary P. Scavone, gary@ccrma.stanford.edu

      -

      - - - diff --git a/doc/html/structRtAudio_1_1RTAUDIO__DEVICE.html b/doc/html/structRtAudio_1_1RTAUDIO__DEVICE.html deleted file mode 100644 index 837c218..0000000 --- a/doc/html/structRtAudio_1_1RTAUDIO__DEVICE.html +++ /dev/null @@ -1,384 +0,0 @@ - - -The RtAudio Tutorial - - - -
      -Tutorial   Class/Enum List   File List   Compound Members  
      -
      - -

      RtAudio::RTAUDIO_DEVICE Struct Reference

      The public device information structure for passing queried values. -More... -

      -#include <RtAudio.h> -

      -List of all members. - - - - - - - - - - - - - - -

      Public Attributes

      char name [128]
      bool probed
      int maxOutputChannels
      int maxInputChannels
      int maxDuplexChannels
      int minOutputChannels
      int minInputChannels
      int minDuplexChannels
      bool hasDuplexSupport
      bool isDefault
      int nSampleRates
      int sampleRates [MAX_SAMPLE_RATES]
      RTAUDIO_FORMAT nativeFormats
      -


      Detailed Description

      -The public device information structure for passing queried values. -

      -


      Member Data Documentation

      -

      - - - - -
      - - - - - -
      -char RtAudio::RTAUDIO_DEVICE::name -
      -
      - - - - - -
      -   - - -

      -Character string device identifier.

      -

      - - - - -
      - - - - - -
      -bool RtAudio::RTAUDIO_DEVICE::probed -
      -
      - - - - - -
      -   - - -

      -true if the device capabilities were successfully probed.

      -

      - - - - -
      - - - - - -
      -int RtAudio::RTAUDIO_DEVICE::maxOutputChannels -
      -
      - - - - - -
      -   - - -

      -Maximum output channels supported by device.

      -

      - - - - -
      - - - - - -
      -int RtAudio::RTAUDIO_DEVICE::maxInputChannels -
      -
      - - - - - -
      -   - - -

      -Maximum input channels supported by device.

      -

      - - - - -
      - - - - - -
      -int RtAudio::RTAUDIO_DEVICE::maxDuplexChannels -
      -
      - - - - - -
      -   - - -

      -Maximum simultaneous input/output channels supported by device.

      -

      - - - - -
      - - - - - -
      -int RtAudio::RTAUDIO_DEVICE::minOutputChannels -
      -
      - - - - - -
      -   - - -

      -Minimum output channels supported by device.

      -

      - - - - -
      - - - - - -
      -int RtAudio::RTAUDIO_DEVICE::minInputChannels -
      -
      - - - - - -
      -   - - -

      -Minimum input channels supported by device.

      -

      - - - - -
      - - - - - -
      -int RtAudio::RTAUDIO_DEVICE::minDuplexChannels -
      -
      - - - - - -
      -   - - -

      -Minimum simultaneous input/output channels supported by device.

      -

      - - - - -
      - - - - - -
      -bool RtAudio::RTAUDIO_DEVICE::hasDuplexSupport -
      -
      - - - - - -
      -   - - -

      -true if device supports duplex mode.

      -

      - - - - -
      - - - - - -
      -bool RtAudio::RTAUDIO_DEVICE::isDefault -
      -
      - - - - - -
      -   - - -

      -true if this is the default output or input device.

      -

      - - - - -
      - - - - - -
      -int RtAudio::RTAUDIO_DEVICE::nSampleRates -
      -
      - - - - - -
      -   - - -

      -Number of discrete rates or -1 if range supported.

      -

      - - - - -
      - - - - - -
      -int RtAudio::RTAUDIO_DEVICE::sampleRates -
      -
      - - - - - -
      -   - - -

      -Supported rates or (min, max) if range.

      -

      - - - - -
      - - - - - -
      -RTAUDIO_FORMAT RtAudio::RTAUDIO_DEVICE::nativeFormats -
      -
      - - - - - -
      -   - - -

      -Bit mask of supported data formats.

      -


      The documentation for this struct was generated from the following file: -
      - -
      - ©2001-2002 Gary P. Scavone, CCRMA, Stanford University. All Rights Reserved.
      - Maintained by Gary P. Scavone, gary@ccrma.stanford.edu

      -

      - - - -- cgit v1.2.3