From be2eb99b37cd017fcab00c1704f794cb1bc85ee1 Mon Sep 17 00:00:00 2001 From: Gary Scavone Date: Fri, 11 Oct 2013 01:58:40 +0200 Subject: Release 4.0.7 tarball --- doc/html/RtAudio_8h.html | 148 +++-- doc/html/RtAudio_8h_source.html | 641 +++++++++++++++++++++ doc/html/RtError_8h_source.html | 65 +++ doc/html/acknowledge.html | 15 +- doc/html/annotated.html | 10 +- doc/html/apinotes.html | 41 +- doc/html/bugs.html | 2 +- doc/html/classRtAudio-members.html | 62 +- doc/html/classRtAudio.html | 497 ++++++++-------- doc/html/classRtError-members.html | 42 +- doc/html/classRtError.html | 181 +++--- doc/html/classes.html | 12 +- doc/html/compiling.html | 22 +- doc/html/doxygen.css | 91 +++ doc/html/duplex.html | 46 +- doc/html/errors.html | 9 +- doc/html/files.html | 8 +- doc/html/functions.html | 257 ++++++--- doc/html/functions_enum.html | 14 +- doc/html/functions_eval.html | 64 +- doc/html/functions_func.html | 83 ++- doc/html/functions_vars.html | 56 +- doc/html/globals.html | 20 +- doc/html/globals_type.html | 20 +- doc/html/index.html | 51 +- doc/html/license.html | 19 +- doc/html/multi.html | 11 +- doc/html/pages.html | 26 +- doc/html/playback.html | 44 +- doc/html/probe.html | 56 +- doc/html/recording.html | 44 +- doc/html/settings.html | 36 +- doc/html/structRtAudio_1_1DeviceInfo-members.html | 24 +- doc/html/structRtAudio_1_1DeviceInfo.html | 141 ++--- .../structRtAudio_1_1StreamOptions-members.html | 14 +- doc/html/structRtAudio_1_1StreamOptions.html | 99 ++-- .../structRtAudio_1_1StreamParameters-members.html | 12 +- doc/html/structRtAudio_1_1StreamParameters.html | 65 +-- doc/html/tabs.css | 2 +- 39 files changed, 1998 insertions(+), 1052 deletions(-) create mode 100644 doc/html/RtAudio_8h_source.html create mode 100644 doc/html/RtError_8h_source.html (limited to 'doc/html') diff --git a/doc/html/RtAudio_8h.html b/doc/html/RtAudio_8h.html index 5ffc249..bf3d222 100644 --- a/doc/html/RtAudio_8h.html +++ b/doc/html/RtAudio_8h.html @@ -8,125 +8,119 @@
Home   Class/Enum List   File List   Compound Members  

- +
-

RtAudio.h File Reference

#include <string>
-#include <vector>
-#include "RtError.h"
-#include <sstream>
- -

-Go to the source code of this file. - - - - - - - - - - - - - - - - - - - - - - - - - - - +

RtAudio.h File Reference

#include <string>
+#include <vector>
+#include "RtError.h"
+#include <sstream>
+ +

Go to the source code of this file.

+

Classes

class  RtAudio
 Realtime audio i/o C++ classes. More...
struct  RtAudio::RtAudio::DeviceInfo
 The public device information structure for returning queried values. More...
struct  RtAudio::RtAudio::StreamParameters
 The structure for specifying input or ouput stream parameters. More...
struct  RtAudio::RtAudio::StreamOptions
 The structure for specifying stream options. More...

Typedefs

typedef unsigned long RtAudioFormat
 RtAudio data format type.
typedef unsigned int RtAudioStreamFlags
 RtAudio stream option flags.
typedef unsigned int RtAudioStreamStatus
 RtAudio stream status (over- or underflow) flags.
typedef int(* RtAudioCallback )(void *outputBuffer, void *inputBuffer, unsigned int nFrames, double streamTime, RtAudioStreamStatus status, void *userData)
 RtAudio callback function prototype.
+ + + + + + + + + + + + + + + + + +

Classes

class  RtAudio
 Realtime audio i/o C++ classes. More...
struct  RtAudio::DeviceInfo
 The public device information structure for returning queried values. More...
struct  RtAudio::StreamParameters
 The structure for specifying input or ouput stream parameters. More...
struct  RtAudio::StreamOptions
 The structure for specifying stream options. More...

Typedefs

typedef unsigned long RtAudioFormat
 RtAudio data format type.
typedef unsigned int RtAudioStreamFlags
 RtAudio stream option flags.
typedef unsigned int RtAudioStreamStatus
 RtAudio stream status (over- or underflow) flags.
typedef int(* RtAudioCallback )(void *outputBuffer, void *inputBuffer, unsigned int nFrames, double streamTime, RtAudioStreamStatus status, void *userData)
 RtAudio callback function prototype.
-


Detailed Description

-

Typedef Documentation

- +

Detailed Description

+

Typedef Documentation

+
- +
typedef unsigned long RtAudioFormat typedef unsigned long RtAudioFormat
-

-RtAudio data format type. -

-Support for signed integers and floats. Audio data fed to/from an RtAudio stream is assumed to ALWAYS be in host byte order. The internal routines will automatically take care of any necessary byte-swapping between the host format and the soundcard. Thus, endian-ness is not a concern in the following format definitions.

+

RtAudio data format type.

+

Support for signed integers and floats. Audio data fed to/from an RtAudio stream is assumed to ALWAYS be in host byte order. The internal routines will automatically take care of any necessary byte-swapping between the host format and the soundcard. Thus, endian-ness is not a concern in the following format definitions.

    -
  • RTAUDIO_SINT8: 8-bit signed integer.
  • RTAUDIO_SINT16: 16-bit signed integer.
  • RTAUDIO_SINT24: Upper 3 bytes of 32-bit signed integer.
  • RTAUDIO_SINT32: 32-bit signed integer.
  • RTAUDIO_FLOAT32: Normalized between plus/minus 1.0.
  • RTAUDIO_FLOAT64: Normalized between plus/minus 1.0.
+
  • RTAUDIO_SINT8: 8-bit signed integer.
  • +
  • RTAUDIO_SINT16: 16-bit signed integer.
  • +
  • RTAUDIO_SINT24: Upper 3 bytes of 32-bit signed integer.
  • +
  • RTAUDIO_SINT32: 32-bit signed integer.
  • +
  • RTAUDIO_FLOAT32: Normalized between plus/minus 1.0.
  • +
  • RTAUDIO_FLOAT64: Normalized between plus/minus 1.0.
  • +
    -

    - +

    +
    - +
    typedef unsigned long RtAudioStreamFlags typedef unsigned long RtAudioStreamFlags
    -

    -RtAudio stream option flags. -

    -The following flags can be OR'ed together to allow a client to make changes to the default stream behavior:

    +

    RtAudio stream option flags.

    +

    The following flags can be OR'ed together to allow a client to make changes to the default stream behavior:

      -
    • RTAUDIO_NONINTERLEAVED: Use non-interleaved buffers (default = interleaved).
    • RTAUDIO_MINIMIZE_LATENCY: Attempt to set stream parameters for lowest possible latency.
    • RTAUDIO_HOG_DEVICE: Attempt grab device for exclusive use.
    -

    -By default, RtAudio streams pass and receive audio data from the client in an interleaved format. By passing the RTAUDIO_NONINTERLEAVED flag to the openStream() function, audio data will instead be presented in non-interleaved buffers. In this case, each buffer argument in the RtAudioCallback function will point to a single array of data, with nFrames samples for each channel concatenated back-to-back. For example, the first sample of data for the second channel would be located at index nFrames (assuming the buffer pointer was recast to the correct data type for the stream).

    -Certain audio APIs offer a number of parameters that influence the I/O latency of a stream. By default, RtAudio will attempt to set these parameters internally for robust (glitch-free) performance (though some APIs, like Windows Direct Sound, make this difficult). By passing the RTAUDIO_MINIMIZE_LATENCY flag to the openStream() function, internal stream settings will be influenced in an attempt to minimize stream latency, though possibly at the expense of stream performance.

    -If the RTAUDIO_HOG_DEVICE flag is set, RtAudio will attempt to open the input and/or output stream device(s) for exclusive use. Note that this is not possible with all supported audio APIs.

    -If the RTAUDIO_SCHEDULE_REALTIME flag is set, RtAudio will attempt to select realtime scheduling (round-robin) for the callback thread. +

  • RTAUDIO_NONINTERLEAVED: Use non-interleaved buffers (default = interleaved).
  • +
  • RTAUDIO_MINIMIZE_LATENCY: Attempt to set stream parameters for lowest possible latency.
  • +
  • RTAUDIO_HOG_DEVICE: Attempt grab device for exclusive use.
  • + +

    By default, RtAudio streams pass and receive audio data from the client in an interleaved format. By passing the RTAUDIO_NONINTERLEAVED flag to the openStream() function, audio data will instead be presented in non-interleaved buffers. In this case, each buffer argument in the RtAudioCallback function will point to a single array of data, with nFrames samples for each channel concatenated back-to-back. For example, the first sample of data for the second channel would be located at index nFrames (assuming the buffer pointer was recast to the correct data type for the stream).

    +

    Certain audio APIs offer a number of parameters that influence the I/O latency of a stream. By default, RtAudio will attempt to set these parameters internally for robust (glitch-free) performance (though some APIs, like Windows Direct Sound, make this difficult). By passing the RTAUDIO_MINIMIZE_LATENCY flag to the openStream() function, internal stream settings will be influenced in an attempt to minimize stream latency, though possibly at the expense of stream performance.

    +

    If the RTAUDIO_HOG_DEVICE flag is set, RtAudio will attempt to open the input and/or output stream device(s) for exclusive use. Note that this is not possible with all supported audio APIs.

    +

    If the RTAUDIO_SCHEDULE_REALTIME flag is set, RtAudio will attempt to select realtime scheduling (round-robin) for the callback thread.

    + +
    -

    - +

    - +
    typedef unsigned long RtAudioStreamStatus typedef unsigned long RtAudioStreamStatus
    -

    -RtAudio stream status (over- or underflow) flags. -

    -Notification of a stream over- or underflow is indicated by a non-zero stream status argument in the RtAudioCallback function. The stream status can be one of the following two options, depending on whether the stream is open for output and/or input:

    +

    RtAudio stream status (over- or underflow) flags.

    +

    Notification of a stream over- or underflow is indicated by a non-zero stream status argument in the RtAudioCallback function. The stream status can be one of the following two options, depending on whether the stream is open for output and/or input:

      -
    • RTAUDIO_INPUT_OVERFLOW: Input data was discarded because of an overflow condition at the driver.
    • RTAUDIO_OUTPUT_UNDERFLOW: The output buffer ran low, likely producing a break in the output sound.
    +
  • RTAUDIO_INPUT_OVERFLOW: Input data was discarded because of an overflow condition at the driver.
  • +
  • RTAUDIO_OUTPUT_UNDERFLOW: The output buffer ran low, likely producing a break in the output sound.
  • +
    -

    - + +

    - +
    typedef int(* RtAudioCallback)(void *outputBuffer, void *inputBuffer, unsigned int nFrames, double streamTime, RtAudioStreamStatus status, void *userData) typedef int(* RtAudioCallback)(void *outputBuffer, void *inputBuffer, unsigned int nFrames, double streamTime, RtAudioStreamStatus status, void *userData)
    -

    -RtAudio callback function prototype. -

    -All RtAudio clients must create a function of type RtAudioCallback to read and/or write data from/to the audio stream. When the underlying audio system is ready for new input or output data, this function will be invoked.

    -

    Parameters:
    +

    RtAudio callback function prototype.

    +

    All RtAudio clients must create a function of type RtAudioCallback to read and/or write data from/to the audio stream. When the underlying audio system is ready for new input or output data, this function will be invoked.

    +
    Parameters:
    @@ -135,15 +129,17 @@ All
    outputBuffer For output (or duplex) streams, the client should write nFrames of audio sample frames into this buffer. This argument should be recast to the datatype specified when the stream was opened. For input-only streams, this argument will be NULL.
    inputBuffer For input (or duplex) streams, this buffer will hold nFrames of input audio sample frames. This argument should be recast to the datatype specified when the stream was opened. For output-only streams, this argument will be NULL.
    status If non-zero, this argument indicates a data overflow or underflow condition for the stream. The particular condition can be determined by comparison with the RtAudioStreamStatus flags.
    userData A pointer to optional data provided by the client when opening the stream (default = NULL).
    +
    -To continue normal stream operation, the RtAudioCallback function should return a value of zero. To stop the stream and drain the output buffer, the function should return a value of one. To abort the stream immediately, the client should return a value of two. +

    To continue normal stream operation, the RtAudioCallback function should return a value of zero. To stop the stream and drain the output buffer, the function should return a value of one. To abort the stream immediately, the client should return a value of two.

    + +
    -


    - +
    ©2001-2009 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    ©2001-2010 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    diff --git a/doc/html/RtAudio_8h_source.html b/doc/html/RtAudio_8h_source.html new file mode 100644 index 0000000..b1bd2a6 --- /dev/null +++ b/doc/html/RtAudio_8h_source.html @@ -0,0 +1,641 @@ + + +The RtAudio Home Page + + + + +
    +Home   Class/Enum List   File List   Compound Members  
    +
    + +

    RtAudio.h

    Go to the documentation of this file.
    00001 /************************************************************************/
    +00039 /************************************************************************/
    +00040 
    +00045 // RtAudio: Version 4.0.7
    +00046 
    +00047 #ifndef __RTAUDIO_H
    +00048 #define __RTAUDIO_H
    +00049 
    +00050 #include <string>
    +00051 #include <vector>
    +00052 #include "RtError.h"
    +00053 
    +00070 typedef unsigned long RtAudioFormat;
    +00071 static const RtAudioFormat RTAUDIO_SINT8 = 0x1;    // 8-bit signed integer.
    +00072 static const RtAudioFormat RTAUDIO_SINT16 = 0x2;   // 16-bit signed integer.
    +00073 static const RtAudioFormat RTAUDIO_SINT24 = 0x4;   // Lower 3 bytes of 32-bit signed integer.
    +00074 static const RtAudioFormat RTAUDIO_SINT32 = 0x8;   // 32-bit signed integer.
    +00075 static const RtAudioFormat RTAUDIO_FLOAT32 = 0x10; // Normalized between plus/minus 1.0.
    +00076 static const RtAudioFormat RTAUDIO_FLOAT64 = 0x20; // Normalized between plus/minus 1.0.
    +00077 
    +00115 typedef unsigned int RtAudioStreamFlags;
    +00116 static const RtAudioStreamFlags RTAUDIO_NONINTERLEAVED = 0x1;    // Use non-interleaved buffers (default = interleaved).
    +00117 static const RtAudioStreamFlags RTAUDIO_MINIMIZE_LATENCY = 0x2;  // Attempt to set stream parameters for lowest possible latency.
    +00118 static const RtAudioStreamFlags RTAUDIO_HOG_DEVICE = 0x4;        // Attempt grab device and prevent use by others.
    +00119 static const RtAudioStreamFlags RTAUDIO_SCHEDULE_REALTIME = 0x8; // Try to select realtime scheduling for callback thread.
    +00120 
    +00132 typedef unsigned int RtAudioStreamStatus;
    +00133 static const RtAudioStreamStatus RTAUDIO_INPUT_OVERFLOW = 0x1;    // Input data was discarded because of an overflow condition at the driver.
    +00134 static const RtAudioStreamStatus RTAUDIO_OUTPUT_UNDERFLOW = 0x2;  // The output buffer ran low, likely causing a gap in the output sound.
    +00135 
    +00137 
    +00175 typedef int (*RtAudioCallback)( void *outputBuffer, void *inputBuffer,
    +00176                                 unsigned int nFrames,
    +00177                                 double streamTime,
    +00178                                 RtAudioStreamStatus status,
    +00179                                 void *userData );
    +00180 
    +00181 
    +00182 // **************************************************************** //
    +00183 //
    +00184 // RtAudio class declaration.
    +00185 //
    +00186 // RtAudio is a "controller" used to select an available audio i/o
    +00187 // interface.  It presents a common API for the user to call but all
    +00188 // functionality is implemented by the class RtApi and its
    +00189 // subclasses.  RtAudio creates an instance of an RtApi subclass
    +00190 // based on the user's API choice.  If no choice is made, RtAudio
    +00191 // attempts to make a "logical" API selection.
    +00192 //
    +00193 // **************************************************************** //
    +00194 
    +00195 class RtApi;
    +00196 
    +00197 class RtAudio
    +00198 {
    +00199  public:
    +00200 
    +00202   enum Api {
    +00203     UNSPECIFIED,    
    +00204     LINUX_ALSA,     
    +00205     LINUX_OSS,      
    +00206     UNIX_JACK,      
    +00207     MACOSX_CORE,    
    +00208     WINDOWS_ASIO,   
    +00209     WINDOWS_DS,     
    +00210     RTAUDIO_DUMMY   
    +00211   };
    +00212 
    +00214   struct DeviceInfo {
    +00215     bool probed;                  
    +00216     std::string name;             
    +00217     unsigned int outputChannels;  
    +00218     unsigned int inputChannels;   
    +00219     unsigned int duplexChannels;  
    +00220     bool isDefaultOutput;         
    +00221     bool isDefaultInput;          
    +00222     std::vector<unsigned int> sampleRates; 
    +00223     RtAudioFormat nativeFormats;  
    +00225     // Default constructor.
    +00226     DeviceInfo()
    +00227       :probed(false), outputChannels(0), inputChannels(0), duplexChannels(0),
    +00228        isDefaultOutput(false), isDefaultInput(false), nativeFormats(0) {}
    +00229   };
    +00230 
    +00232   struct StreamParameters {
    +00233     unsigned int deviceId;     
    +00234     unsigned int nChannels;    
    +00235     unsigned int firstChannel; 
    +00237     // Default constructor.
    +00238     StreamParameters()
    +00239       : deviceId(0), nChannels(0), firstChannel(0) {}
    +00240   };
    +00241 
    +00243 
    +00294   struct StreamOptions {
    +00295     RtAudioStreamFlags flags;      
    +00296     unsigned int numberOfBuffers;  
    +00297     std::string streamName;        
    +00298     int priority;                  
    +00300     // Default constructor.
    +00301     StreamOptions()
    +00302     : flags(0), numberOfBuffers(0), priority(0) {}
    +00303   };
    +00304 
    +00306 
    +00311   static void getCompiledApi( std::vector<RtAudio::Api> &apis ) throw();
    +00312 
    +00314 
    +00322   RtAudio( RtAudio::Api api=UNSPECIFIED ) throw();
    +00323 
    +00325 
    +00329   ~RtAudio() throw();
    +00330 
    +00332   RtAudio::Api getCurrentApi( void ) throw();
    +00333 
    +00335 
    +00340   unsigned int getDeviceCount( void ) throw();
    +00341 
    +00343 
    +00353   RtAudio::DeviceInfo getDeviceInfo( unsigned int device );
    +00354 
    +00356 
    +00363   unsigned int getDefaultOutputDevice( void ) throw();
    +00364 
    +00366 
    +00373   unsigned int getDefaultInputDevice( void ) throw();
    +00374 
    +00376 
    +00413   void openStream( RtAudio::StreamParameters *outputParameters,
    +00414                    RtAudio::StreamParameters *inputParameters,
    +00415                    RtAudioFormat format, unsigned int sampleRate,
    +00416                    unsigned int *bufferFrames, RtAudioCallback callback,
    +00417                    void *userData = NULL, RtAudio::StreamOptions *options = NULL );
    +00418 
    +00420 
    +00424   void closeStream( void ) throw();
    +00425 
    +00427 
    +00433   void startStream( void );
    +00434 
    +00436 
    +00442   void stopStream( void );
    +00443 
    +00445 
    +00451   void abortStream( void );
    +00452 
    +00454   bool isStreamOpen( void ) const throw();
    +00455 
    +00457   bool isStreamRunning( void ) const throw();
    +00458 
    +00460 
    +00463   double getStreamTime( void );
    +00464 
    +00466 
    +00474   long getStreamLatency( void );
    +00475 
    +00477 
    +00482   unsigned int getStreamSampleRate( void );
    +00483 
    +00485   void showWarnings( bool value = true ) throw();
    +00486 
    +00487  protected:
    +00488 
    +00489   void openRtApi( RtAudio::Api api );
    +00490   RtApi *rtapi_;
    +00491 };
    +00492 
    +00493 // Operating system dependent thread functionality.
    +00494 #if defined(__WINDOWS_DS__) || defined(__WINDOWS_ASIO__)
    +00495   #include <windows.h>
    +00496   #include <process.h>
    +00497 
    +00498   typedef unsigned long ThreadHandle;
    +00499   typedef CRITICAL_SECTION StreamMutex;
    +00500 
    +00501 #elif defined(__LINUX_ALSA__) || defined(__UNIX_JACK__) || defined(__LINUX_OSS__) || defined(__MACOSX_CORE__)
    +00502   // Using pthread library for various flavors of unix.
    +00503   #include <pthread.h>
    +00504 
    +00505   typedef pthread_t ThreadHandle;
    +00506   typedef pthread_mutex_t StreamMutex;
    +00507 
    +00508 #else // Setup for "dummy" behavior
    +00509 
    +00510   #define __RTAUDIO_DUMMY__
    +00511   typedef int ThreadHandle;
    +00512   typedef int StreamMutex;
    +00513 
    +00514 #endif
    +00515 
    +00516 // This global structure type is used to pass callback information
    +00517 // between the private RtAudio stream structure and global callback
    +00518 // handling functions.
    +00519 struct CallbackInfo {
    +00520   void *object;    // Used as a "this" pointer.
    +00521   ThreadHandle thread;
    +00522   void *callback;
    +00523   void *userData;
    +00524   void *apiInfo;   // void pointer for API specific callback information
    +00525   bool isRunning;
    +00526 
    +00527   // Default constructor.
    +00528   CallbackInfo()
    +00529     :object(0), callback(0), userData(0), apiInfo(0), isRunning(false) {}
    +00530 };
    +00531 
    +00532 // **************************************************************** //
    +00533 //
    +00534 // RtApi class declaration.
    +00535 //
    +00536 // Subclasses of RtApi contain all API- and OS-specific code necessary
    +00537 // to fully implement the RtAudio API.
    +00538 //
    +00539 // Note that RtApi is an abstract base class and cannot be
    +00540 // explicitly instantiated.  The class RtAudio will create an
    +00541 // instance of an RtApi subclass (RtApiOss, RtApiAlsa,
    +00542 // RtApiJack, RtApiCore, RtApiAl, RtApiDs, or RtApiAsio).
    +00543 //
    +00544 // **************************************************************** //
    +00545 
    +00546 #if defined( HAVE_GETTIMEOFDAY )
    +00547   #include <sys/time.h>
    +00548 #endif
    +00549 
    +00550 #include <sstream>
    +00551 
    +00552 class RtApi
    +00553 {
    +00554 public:
    +00555 
    +00556   RtApi();
    +00557   virtual ~RtApi();
    +00558   virtual RtAudio::Api getCurrentApi( void ) = 0;
    +00559   virtual unsigned int getDeviceCount( void ) = 0;
    +00560   virtual RtAudio::DeviceInfo getDeviceInfo( unsigned int device ) = 0;
    +00561   virtual unsigned int getDefaultInputDevice( void );
    +00562   virtual unsigned int getDefaultOutputDevice( void );
    +00563   void openStream( RtAudio::StreamParameters *outputParameters,
    +00564                    RtAudio::StreamParameters *inputParameters,
    +00565                    RtAudioFormat format, unsigned int sampleRate,
    +00566                    unsigned int *bufferFrames, RtAudioCallback callback,
    +00567                    void *userData, RtAudio::StreamOptions *options );
    +00568   virtual void closeStream( void );
    +00569   virtual void startStream( void ) = 0;
    +00570   virtual void stopStream( void ) = 0;
    +00571   virtual void abortStream( void ) = 0;
    +00572   long getStreamLatency( void );
    +00573   unsigned int getStreamSampleRate( void );
    +00574   virtual double getStreamTime( void );
    +00575   bool isStreamOpen( void ) const { return stream_.state != STREAM_CLOSED; };
    +00576   bool isStreamRunning( void ) const { return stream_.state == STREAM_RUNNING; };
    +00577   void showWarnings( bool value ) { showWarnings_ = value; };
    +00578 
    +00579 
    +00580 protected:
    +00581 
    +00582   static const unsigned int MAX_SAMPLE_RATES;
    +00583   static const unsigned int SAMPLE_RATES[];
    +00584 
    +00585   enum { FAILURE, SUCCESS };
    +00586 
    +00587   enum StreamState {
    +00588     STREAM_STOPPED,
    +00589     STREAM_RUNNING,
    +00590     STREAM_CLOSED = -50
    +00591   };
    +00592 
    +00593   enum StreamMode {
    +00594     OUTPUT,
    +00595     INPUT,
    +00596     DUPLEX,
    +00597     UNINITIALIZED = -75
    +00598   };
    +00599 
    +00600   // A protected structure used for buffer conversion.
    +00601   struct ConvertInfo {
    +00602     int channels;
    +00603     int inJump, outJump;
    +00604     RtAudioFormat inFormat, outFormat;
    +00605     std::vector<int> inOffset;
    +00606     std::vector<int> outOffset;
    +00607   };
    +00608 
    +00609   // A protected structure for audio streams.
    +00610   struct RtApiStream {
    +00611     unsigned int device[2];    // Playback and record, respectively.
    +00612     void *apiHandle;           // void pointer for API specific stream handle information
    +00613     StreamMode mode;           // OUTPUT, INPUT, or DUPLEX.
    +00614     StreamState state;         // STOPPED, RUNNING, or CLOSED
    +00615     char *userBuffer[2];       // Playback and record, respectively.
    +00616     char *deviceBuffer;
    +00617     bool doConvertBuffer[2];   // Playback and record, respectively.
    +00618     bool userInterleaved;
    +00619     bool deviceInterleaved[2]; // Playback and record, respectively.
    +00620     bool doByteSwap[2];        // Playback and record, respectively.
    +00621     unsigned int sampleRate;
    +00622     unsigned int bufferSize;
    +00623     unsigned int nBuffers;
    +00624     unsigned int nUserChannels[2];    // Playback and record, respectively.
    +00625     unsigned int nDeviceChannels[2];  // Playback and record channels, respectively.
    +00626     unsigned int channelOffset[2];    // Playback and record, respectively.
    +00627     unsigned long latency[2];         // Playback and record, respectively.
    +00628     RtAudioFormat userFormat;
    +00629     RtAudioFormat deviceFormat[2];    // Playback and record, respectively.
    +00630     StreamMutex mutex;
    +00631     CallbackInfo callbackInfo;
    +00632     ConvertInfo convertInfo[2];
    +00633     double streamTime;         // Number of elapsed seconds since the stream started.
    +00634 
    +00635 #if defined(HAVE_GETTIMEOFDAY)
    +00636     struct timeval lastTickTimestamp;
    +00637 #endif
    +00638 
    +00639     RtApiStream()
    +00640       :apiHandle(0), deviceBuffer(0) { device[0] = 11111; device[1] = 11111; }
    +00641   };
    +00642 
    +00643   typedef signed short Int16;
    +00644   typedef signed int Int32;
    +00645   typedef float Float32;
    +00646   typedef double Float64;
    +00647 
    +00648   std::ostringstream errorStream_;
    +00649   std::string errorText_;
    +00650   bool showWarnings_;
    +00651   RtApiStream stream_;
    +00652 
    +00660   virtual bool probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels, 
    +00661                                 unsigned int firstChannel, unsigned int sampleRate,
    +00662                                 RtAudioFormat format, unsigned int *bufferSize,
    +00663                                 RtAudio::StreamOptions *options );
    +00664 
    +00666   void tickStreamTime( void );
    +00667 
    +00669   void clearStreamInfo();
    +00670 
    +00675   void verifyStream( void );
    +00676 
    +00678   void error( RtError::Type type );
    +00679 
    +00684   void convertBuffer( char *outBuffer, char *inBuffer, ConvertInfo &info );
    +00685 
    +00687   void byteSwapBuffer( char *buffer, unsigned int samples, RtAudioFormat format );
    +00688 
    +00690   unsigned int formatBytes( RtAudioFormat format );
    +00691 
    +00693   void setConvertInfo( StreamMode mode, unsigned int firstChannel );
    +00694 };
    +00695 
    +00696 // **************************************************************** //
    +00697 //
    +00698 // Inline RtAudio definitions.
    +00699 //
    +00700 // **************************************************************** //
    +00701 
    +00702 inline RtAudio::Api RtAudio :: getCurrentApi( void ) throw() { return rtapi_->getCurrentApi(); }
    +00703 inline unsigned int RtAudio :: getDeviceCount( void ) throw() { return rtapi_->getDeviceCount(); }
    +00704 inline RtAudio::DeviceInfo RtAudio :: getDeviceInfo( unsigned int device ) { return rtapi_->getDeviceInfo( device ); }
    +00705 inline unsigned int RtAudio :: getDefaultInputDevice( void ) throw() { return rtapi_->getDefaultInputDevice(); }
    +00706 inline unsigned int RtAudio :: getDefaultOutputDevice( void ) throw() { return rtapi_->getDefaultOutputDevice(); }
    +00707 inline void RtAudio :: closeStream( void ) throw() { return rtapi_->closeStream(); }
    +00708 inline void RtAudio :: startStream( void ) { return rtapi_->startStream(); }
    +00709 inline void RtAudio :: stopStream( void )  { return rtapi_->stopStream(); }
    +00710 inline void RtAudio :: abortStream( void ) { return rtapi_->abortStream(); }
    +00711 inline bool RtAudio :: isStreamOpen( void ) const throw() { return rtapi_->isStreamOpen(); }
    +00712 inline bool RtAudio :: isStreamRunning( void ) const throw() { return rtapi_->isStreamRunning(); }
    +00713 inline long RtAudio :: getStreamLatency( void ) { return rtapi_->getStreamLatency(); }
    +00714 inline unsigned int RtAudio :: getStreamSampleRate( void ) { return rtapi_->getStreamSampleRate(); };
    +00715 inline double RtAudio :: getStreamTime( void ) { return rtapi_->getStreamTime(); }
    +00716 inline void RtAudio :: showWarnings( bool value ) throw() { rtapi_->showWarnings( value ); }
    +00717 
    +00718 // RtApi Subclass prototypes.
    +00719 
    +00720 #if defined(__MACOSX_CORE__)
    +00721 
    +00722 #include <CoreAudio/AudioHardware.h>
    +00723 
    +00724 class RtApiCore: public RtApi
    +00725 {
    +00726 public:
    +00727 
    +00728   RtApiCore();
    +00729   ~RtApiCore();
    +00730   RtAudio::Api getCurrentApi( void ) { return RtAudio::MACOSX_CORE; };
    +00731   unsigned int getDeviceCount( void );
    +00732   RtAudio::DeviceInfo getDeviceInfo( unsigned int device );
    +00733   unsigned int getDefaultOutputDevice( void );
    +00734   unsigned int getDefaultInputDevice( void );
    +00735   void closeStream( void );
    +00736   void startStream( void );
    +00737   void stopStream( void );
    +00738   void abortStream( void );
    +00739   long getStreamLatency( void );
    +00740 
    +00741   // This function is intended for internal use only.  It must be
    +00742   // public because it is called by the internal callback handler,
    +00743   // which is not a member of RtAudio.  External use of this function
    +00744   // will most likely produce highly undesireable results!
    +00745   bool callbackEvent( AudioDeviceID deviceId,
    +00746                       const AudioBufferList *inBufferList,
    +00747                       const AudioBufferList *outBufferList );
    +00748 
    +00749   private:
    +00750 
    +00751   bool probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels, 
    +00752                         unsigned int firstChannel, unsigned int sampleRate,
    +00753                         RtAudioFormat format, unsigned int *bufferSize,
    +00754                         RtAudio::StreamOptions *options );
    +00755   static const char* getErrorCode( OSStatus code );
    +00756 };
    +00757 
    +00758 #endif
    +00759 
    +00760 #if defined(__UNIX_JACK__)
    +00761 
    +00762 class RtApiJack: public RtApi
    +00763 {
    +00764 public:
    +00765 
    +00766   RtApiJack();
    +00767   ~RtApiJack();
    +00768   RtAudio::Api getCurrentApi( void ) { return RtAudio::UNIX_JACK; };
    +00769   unsigned int getDeviceCount( void );
    +00770   RtAudio::DeviceInfo getDeviceInfo( unsigned int device );
    +00771   void closeStream( void );
    +00772   void startStream( void );
    +00773   void stopStream( void );
    +00774   void abortStream( void );
    +00775   long getStreamLatency( void );
    +00776 
    +00777   // This function is intended for internal use only.  It must be
    +00778   // public because it is called by the internal callback handler,
    +00779   // which is not a member of RtAudio.  External use of this function
    +00780   // will most likely produce highly undesireable results!
    +00781   bool callbackEvent( unsigned long nframes );
    +00782 
    +00783   private:
    +00784 
    +00785   bool probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels, 
    +00786                         unsigned int firstChannel, unsigned int sampleRate,
    +00787                         RtAudioFormat format, unsigned int *bufferSize,
    +00788                         RtAudio::StreamOptions *options );
    +00789 };
    +00790 
    +00791 #endif
    +00792 
    +00793 #if defined(__WINDOWS_ASIO__)
    +00794 
    +00795 class RtApiAsio: public RtApi
    +00796 {
    +00797 public:
    +00798 
    +00799   RtApiAsio();
    +00800   ~RtApiAsio();
    +00801   RtAudio::Api getCurrentApi( void ) { return RtAudio::WINDOWS_ASIO; };
    +00802   unsigned int getDeviceCount( void );
    +00803   RtAudio::DeviceInfo getDeviceInfo( unsigned int device );
    +00804   void closeStream( void );
    +00805   void startStream( void );
    +00806   void stopStream( void );
    +00807   void abortStream( void );
    +00808   long getStreamLatency( void );
    +00809 
    +00810   // This function is intended for internal use only.  It must be
    +00811   // public because it is called by the internal callback handler,
    +00812   // which is not a member of RtAudio.  External use of this function
    +00813   // will most likely produce highly undesireable results!
    +00814   bool callbackEvent( long bufferIndex );
    +00815 
    +00816   private:
    +00817 
    +00818   std::vector<RtAudio::DeviceInfo> devices_;
    +00819   void saveDeviceInfo( void );
    +00820   bool coInitialized_;
    +00821   bool probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels, 
    +00822                         unsigned int firstChannel, unsigned int sampleRate,
    +00823                         RtAudioFormat format, unsigned int *bufferSize,
    +00824                         RtAudio::StreamOptions *options );
    +00825 };
    +00826 
    +00827 #endif
    +00828 
    +00829 #if defined(__WINDOWS_DS__)
    +00830 
    +00831 class RtApiDs: public RtApi
    +00832 {
    +00833 public:
    +00834 
    +00835   RtApiDs();
    +00836   ~RtApiDs();
    +00837   RtAudio::Api getCurrentApi( void ) { return RtAudio::WINDOWS_DS; };
    +00838   unsigned int getDeviceCount( void );
    +00839   unsigned int getDefaultOutputDevice( void );
    +00840   unsigned int getDefaultInputDevice( void );
    +00841   RtAudio::DeviceInfo getDeviceInfo( unsigned int device );
    +00842   void closeStream( void );
    +00843   void startStream( void );
    +00844   void stopStream( void );
    +00845   void abortStream( void );
    +00846   long getStreamLatency( void );
    +00847 
    +00848   // This function is intended for internal use only.  It must be
    +00849   // public because it is called by the internal callback handler,
    +00850   // which is not a member of RtAudio.  External use of this function
    +00851   // will most likely produce highly undesireable results!
    +00852   void callbackEvent( void );
    +00853 
    +00854   private:
    +00855 
    +00856   bool coInitialized_;
    +00857   bool buffersRolling;
    +00858   long duplexPrerollBytes;
    +00859   bool probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels, 
    +00860                         unsigned int firstChannel, unsigned int sampleRate,
    +00861                         RtAudioFormat format, unsigned int *bufferSize,
    +00862                         RtAudio::StreamOptions *options );
    +00863 };
    +00864 
    +00865 #endif
    +00866 
    +00867 #if defined(__LINUX_ALSA__)
    +00868 
    +00869 class RtApiAlsa: public RtApi
    +00870 {
    +00871 public:
    +00872 
    +00873   RtApiAlsa();
    +00874   ~RtApiAlsa();
    +00875   RtAudio::Api getCurrentApi() { return RtAudio::LINUX_ALSA; };
    +00876   unsigned int getDeviceCount( void );
    +00877   RtAudio::DeviceInfo getDeviceInfo( unsigned int device );
    +00878   void closeStream( void );
    +00879   void startStream( void );
    +00880   void stopStream( void );
    +00881   void abortStream( void );
    +00882 
    +00883   // This function is intended for internal use only.  It must be
    +00884   // public because it is called by the internal callback handler,
    +00885   // which is not a member of RtAudio.  External use of this function
    +00886   // will most likely produce highly undesireable results!
    +00887   void callbackEvent( void );
    +00888 
    +00889   private:
    +00890 
    +00891   std::vector<RtAudio::DeviceInfo> devices_;
    +00892   void saveDeviceInfo( void );
    +00893   bool probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels, 
    +00894                         unsigned int firstChannel, unsigned int sampleRate,
    +00895                         RtAudioFormat format, unsigned int *bufferSize,
    +00896                         RtAudio::StreamOptions *options );
    +00897 };
    +00898 
    +00899 #endif
    +00900 
    +00901 #if defined(__LINUX_OSS__)
    +00902 
    +00903 class RtApiOss: public RtApi
    +00904 {
    +00905 public:
    +00906 
    +00907   RtApiOss();
    +00908   ~RtApiOss();
    +00909   RtAudio::Api getCurrentApi() { return RtAudio::LINUX_OSS; };
    +00910   unsigned int getDeviceCount( void );
    +00911   RtAudio::DeviceInfo getDeviceInfo( unsigned int device );
    +00912   void closeStream( void );
    +00913   void startStream( void );
    +00914   void stopStream( void );
    +00915   void abortStream( void );
    +00916 
    +00917   // This function is intended for internal use only.  It must be
    +00918   // public because it is called by the internal callback handler,
    +00919   // which is not a member of RtAudio.  External use of this function
    +00920   // will most likely produce highly undesireable results!
    +00921   void callbackEvent( void );
    +00922 
    +00923   private:
    +00924 
    +00925   bool probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels, 
    +00926                         unsigned int firstChannel, unsigned int sampleRate,
    +00927                         RtAudioFormat format, unsigned int *bufferSize,
    +00928                         RtAudio::StreamOptions *options );
    +00929 };
    +00930 
    +00931 #endif
    +00932 
    +00933 #if defined(__RTAUDIO_DUMMY__)
    +00934 
    +00935 class RtApiDummy: public RtApi
    +00936 {
    +00937 public:
    +00938 
    +00939   RtApiDummy() { errorText_ = "RtApiDummy: This class provides no functionality."; error( RtError::WARNING ); };
    +00940   RtAudio::Api getCurrentApi( void ) { return RtAudio::RTAUDIO_DUMMY; };
    +00941   unsigned int getDeviceCount( void ) { return 0; };
    +00942   RtAudio::DeviceInfo getDeviceInfo( unsigned int device ) { RtAudio::DeviceInfo info; return info; };
    +00943   void closeStream( void ) {};
    +00944   void startStream( void ) {};
    +00945   void stopStream( void ) {};
    +00946   void abortStream( void ) {};
    +00947 
    +00948   private:
    +00949 
    +00950   bool probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels, 
    +00951                         unsigned int firstChannel, unsigned int sampleRate,
    +00952                         RtAudioFormat format, unsigned int *bufferSize,
    +00953                         RtAudio::StreamOptions *options ) { return false; };
    +00954 };
    +00955 
    +00956 #endif
    +00957 
    +00958 #endif
    +00959 
    +00960 // Indentation settings for Vim and Emacs
    +00961 //
    +00962 // Local Variables:
    +00963 // c-basic-offset: 2
    +00964 // indent-tabs-mode: nil
    +00965 // End:
    +00966 //
    +00967 // vim: et sts=2 sw=2
    +
    +
    + + + +
    ©2001-2010 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    + + + diff --git a/doc/html/RtError_8h_source.html b/doc/html/RtError_8h_source.html new file mode 100644 index 0000000..2a208f7 --- /dev/null +++ b/doc/html/RtError_8h_source.html @@ -0,0 +1,65 @@ + + +The RtAudio Home Page + + + + +
    +Home   Class/Enum List   File List   Compound Members  
    +
    + +

    RtError.h

    00001 /************************************************************************/
    +00010 /************************************************************************/
    +00011 
    +00012 #ifndef RTERROR_H
    +00013 #define RTERROR_H
    +00014 
    +00015 #include <exception>
    +00016 #include <iostream>
    +00017 #include <string>
    +00018 
    +00019 class RtError : public std::exception
    +00020 {
    +00021  public:
    +00023   enum Type {
    +00024     WARNING,           
    +00025     DEBUG_WARNING,     
    +00026     UNSPECIFIED,       
    +00027     NO_DEVICES_FOUND,  
    +00028     INVALID_DEVICE,    
    +00029     MEMORY_ERROR,      
    +00030     INVALID_PARAMETER, 
    +00031     INVALID_USE,       
    +00032     DRIVER_ERROR,      
    +00033     SYSTEM_ERROR,      
    +00034     THREAD_ERROR       
    +00035   };
    +00036 
    +00038   RtError( const std::string& message, Type type = RtError::UNSPECIFIED ) throw() : message_(message), type_(type) {}
    +00039  
    +00041   virtual ~RtError( void ) throw() {}
    +00042 
    +00044   virtual void printMessage( void ) throw() { std::cerr << '\n' << message_ << "\n\n"; }
    +00045 
    +00047   virtual const Type& getType(void) throw() { return type_; }
    +00048 
    +00050   virtual const std::string& getMessage(void) throw() { return message_; }
    +00051 
    +00053   virtual const char* what( void ) const throw() { return message_.c_str(); }
    +00054 
    +00055  protected:
    +00056   std::string message_;
    +00057   Type type_;
    +00058 };
    +00059 
    +00060 #endif
    +
    +
    + + + +
    ©2001-2010 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    + + + diff --git a/doc/html/acknowledge.html b/doc/html/acknowledge.html index 697c578..0dc714b 100644 --- a/doc/html/acknowledge.html +++ b/doc/html/acknowledge.html @@ -8,9 +8,12 @@
    Home   Class/Enum List   File List   Compound Members  

    - +
    -

    Acknowledgements

    Many thanks to the following people for providing bug fixes and improvements:
    +

    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. All recent versions of RtAudio have been completed while working as an assistant / associate 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).

    +
    - +
    ©2001-2009 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    ©2001-2010 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    diff --git a/doc/html/annotated.html b/doc/html/annotated.html index 0e3670e..7564a45 100644 --- a/doc/html/annotated.html +++ b/doc/html/annotated.html @@ -8,20 +8,20 @@
    Home   Class/Enum List   File List   Compound Members  

    - +

    Class List

    Here are the classes, structs, unions and interfaces with brief descriptions: + - - - + +
    RtAudio::DeviceInfoThe public device information structure for returning queried values
    RtAudioRealtime audio i/o C++ classes
    RtAudio::RtAudio::DeviceInfoThe public device information structure for returning queried values
    RtAudio::RtAudio::StreamOptionsThe structure for specifying stream options
    RtAudio::RtAudio::StreamParametersThe structure for specifying input or ouput stream parameters
    RtErrorException handling class for RtAudio & RtMidi
    RtAudio::StreamOptionsThe structure for specifying stream options
    RtAudio::StreamParametersThe structure for specifying input or ouput stream parameters

    - +
    ©2001-2009 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    ©2001-2010 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    diff --git a/doc/html/apinotes.html b/doc/html/apinotes.html index 7404ac4..c3909bc 100644 --- a/doc/html/apinotes.html +++ b/doc/html/apinotes.html @@ -8,31 +8,38 @@
    Home   Class/Enum List   File List   Compound Members  

    - +
    -

    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.

    + + +

    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 (versions >= 4.0), ALSA, and Jack. Note that RtAudio now only supports the newer version 4.0 OSS API. The ALSA API is now part of the Linux kernel and offers significantly better functionality than the OSS API. RtAudio provides support for the 1.0 and higher versions of ALSA. Jack 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.

    -At the moment, only one RtAudio instance can be connected to the Jack server.

    +

    RtAudio for Linux was developed under Redhat distributions 7.0 - Fedora. Three different audio APIs are supported on Linux platforms: OSS (versions >= 4.0), ALSA, and Jack. Note that RtAudio now only supports the newer version 4.0 OSS API. The ALSA API is now part of the Linux kernel and offers significantly better functionality than the OSS API. RtAudio provides support for the 1.0 and higher versions of ALSA. Jack 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.

    +

    At the moment, only one RtAudio instance can be connected to the Jack server.

    +

    Macintosh OS-X (CoreAudio and Jack):

    -The Apple CoreAudio API 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. 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.

    -The RtAudio Jack support can be compiled on Macintosh OS-X systems, as well as in Linux.

    +

    The Apple CoreAudio API 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. 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.

    +

    The RtAudio Jack support can be compiled on Macintosh OS-X systems, as well as in Linux.

    +

    Windows (DirectSound):

    -The configure script provides support for the MinGW compiler. DirectSound support is specified with the "--with-ds" flag.

    -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, especially since RtAudio version 3.0.2. Input audio latency still tends to be bad but better since version 3.0.2. RtAudio was originally developed with Visual C++ version 6.0 but has been tested with .NET.

    -The DirectSound version of RtAudio can be compiled with or without the UNICODE preprocessor definition.

    +

    The configure script provides support for the MinGW compiler. DirectSound support is specified with the "--with-ds" flag.

    +

    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, especially since RtAudio version 3.0.2. Input audio latency still tends to be bad but better since version 3.0.2. RtAudio was originally developed with Visual C++ version 6.0 but has been tested with .NET.

    +

    The DirectSound version of RtAudio can be compiled with or without the UNICODE preprocessor definition.

    +

    Windows (ASIO):

    -ASIO support using MinGW and the configure script is specified with the "--with-asio" flag.

    -The Steinberg ASIO audio 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; iasiothiscallresolver.h,cpp. The Visual C++ projects found in /tests/Windows/ compile both ASIO and DirectSound support.

    -The Steinberg provided asiolist class does not compile when the preprocessor definition UNICODE is defined. Note that this could be an issue when using RtAudio with Qt, though Qt programs appear to compile without the UNICODE definition (try DEFINES -= UNICODE in your .pro file). RtAudio with ASIO support has been tested using the MinGW compiler under Windows XP, as well as in the Visual Studio environment.

    +

    ASIO support using MinGW and the configure script is specified with the "--with-asio" flag.

    +

    The Steinberg ASIO audio 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; iasiothiscallresolver.h,cpp. The Visual C++ projects found in /tests/Windows/ compile both ASIO and DirectSound support.

    +

    The Steinberg provided asiolist class does not compile when the preprocessor definition UNICODE is defined. Note that this could be an issue when using RtAudio with Qt, though Qt programs appear to compile without the UNICODE definition (try DEFINES -= UNICODE in your .pro file). RtAudio with ASIO support has been tested using the MinGW compiler under Windows XP, as well as in the Visual Studio environment.

    +
    - +
    ©2001-2009 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    ©2001-2010 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    diff --git a/doc/html/bugs.html b/doc/html/bugs.html index 493ff03..686bc7a 100644 --- a/doc/html/bugs.html +++ b/doc/html/bugs.html @@ -12,7 +12,7 @@ - +
    #VersionAPIDescriptionStatus
    14.0.7Windows ASIO using gcc4.4 (MinGW)Functions to set and query supported sample rates fail

    Confirmed Bugs (Unfixed):

    diff --git a/doc/html/classRtAudio-members.html b/doc/html/classRtAudio-members.html index c7169c0..ed75476 100644 --- a/doc/html/classRtAudio-members.html +++ b/doc/html/classRtAudio-members.html @@ -8,42 +8,42 @@
    Home   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(void)RtAudio [inline]
    Api enum nameRtAudio
    closeStream(void)RtAudio [inline]
    getCompiledApi(std::vector< RtAudio::Api > &apis)RtAudio [static]
    getCurrentApi(void)RtAudio [inline]
    getDefaultInputDevice(void)RtAudio [inline]
    getDefaultOutputDevice(void)RtAudio [inline]
    getDeviceCount(void)RtAudio [inline]
    getDeviceInfo(unsigned int device)RtAudio [inline]
    getStreamLatency(void)RtAudio [inline]
    getStreamSampleRate(void)RtAudio [inline]
    getStreamTime(void)RtAudio [inline]
    isStreamOpen(void) const RtAudio [inline]
    isStreamRunning(void) const RtAudio [inline]
    LINUX_ALSA enum valueRtAudio
    LINUX_OSS enum valueRtAudio
    MACOSX_CORE enum valueRtAudio
    openStream(RtAudio::StreamParameters *outputParameters, RtAudio::StreamParameters *inputParameters, RtAudioFormat format, unsigned int sampleRate, unsigned int *bufferFrames, RtAudioCallback callback, void *userData=NULL, RtAudio::StreamOptions *options=NULL)RtAudio
    RtAudio(RtAudio::Api api=UNSPECIFIED)RtAudio
    RTAUDIO_DUMMY enum valueRtAudio
    showWarnings(bool value=true)RtAudio [inline]
    startStream(void)RtAudio [inline]
    stopStream(void)RtAudio [inline]
    UNIX_JACK enum valueRtAudio
    UNSPECIFIED enum valueRtAudio
    WINDOWS_ASIO enum valueRtAudio
    WINDOWS_DS enum valueRtAudio
    ~RtAudio()RtAudio
    + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    abortStream(void)RtAudio [inline]
    Api enum nameRtAudio
    closeStream(void)RtAudio [inline]
    getCompiledApi(std::vector< RtAudio::Api > &apis)RtAudio [static]
    getCurrentApi(void)RtAudio [inline]
    getDefaultInputDevice(void)RtAudio [inline]
    getDefaultOutputDevice(void)RtAudio [inline]
    getDeviceCount(void)RtAudio [inline]
    getDeviceInfo(unsigned int device)RtAudio [inline]
    getStreamLatency(void)RtAudio [inline]
    getStreamSampleRate(void)RtAudio [inline]
    getStreamTime(void)RtAudio [inline]
    isStreamOpen(void) const RtAudio [inline]
    isStreamRunning(void) const RtAudio [inline]
    LINUX_ALSA enum valueRtAudio
    LINUX_OSS enum valueRtAudio
    MACOSX_CORE enum valueRtAudio
    openStream(RtAudio::StreamParameters *outputParameters, RtAudio::StreamParameters *inputParameters, RtAudioFormat format, unsigned int sampleRate, unsigned int *bufferFrames, RtAudioCallback callback, void *userData=NULL, RtAudio::StreamOptions *options=NULL)RtAudio
    RtAudio(RtAudio::Api api=UNSPECIFIED)RtAudio
    RTAUDIO_DUMMY enum valueRtAudio
    showWarnings(bool value=true)RtAudio [inline]
    startStream(void)RtAudio [inline]
    stopStream(void)RtAudio [inline]
    UNIX_JACK enum valueRtAudio
    UNSPECIFIED enum valueRtAudio
    WINDOWS_ASIO enum valueRtAudio
    WINDOWS_DS enum valueRtAudio
    ~RtAudio()RtAudio


    - +
    ©2001-2009 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    ©2001-2010 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    diff --git a/doc/html/classRtAudio.html b/doc/html/classRtAudio.html index f0d62a1..2038c91 100644 --- a/doc/html/classRtAudio.html +++ b/doc/html/classRtAudio.html @@ -8,163 +8,146 @@
    Home   Class/Enum List   File List   Compound Members  

    - +
    -

    RtAudio Class Reference

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

    -#include <RtAudio.h> -

    - -

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

    Classes

    struct  DeviceInfo
     The public device information structure for returning queried values. More...
    struct  StreamOptions
     The structure for specifying stream options. More...
    struct  StreamParameters
     The structure for specifying input or ouput stream parameters. More...

    Public Types

    enum  Api {
    -  UNSPECIFIED, -LINUX_ALSA, -LINUX_OSS, -UNIX_JACK, -
    -  MACOSX_CORE, -WINDOWS_ASIO, -WINDOWS_DS, -RTAUDIO_DUMMY -
    +

    RtAudio Class Reference

    +

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

    + +

    #include <RtAudio.h>

    + +

    List of all members.

    + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Classes

    struct  DeviceInfo
     The public device information structure for returning queried values. More...
    struct  StreamOptions
     The structure for specifying stream options. More...
    struct  StreamParameters
     The structure for specifying input or ouput stream parameters. More...

    Public Types

    enum  Api {
    +  UNSPECIFIED, +LINUX_ALSA, +LINUX_OSS, +UNIX_JACK, +
    +  MACOSX_CORE, +WINDOWS_ASIO, +WINDOWS_DS, +RTAUDIO_DUMMY +
    }
     Audio API specifier arguments. More...

    Public Member Functions

     RtAudio (RtAudio::Api api=UNSPECIFIED) throw ()
     The class constructor.
     ~RtAudio () throw ()
     The destructor.
    -RtAudio::Api getCurrentApi (void) throw ()
     Returns the audio API specifier for the current instance of RtAudio.
    unsigned int getDeviceCount (void) throw ()
     A public function that queries for the number of audio devices available.
    RtAudio::DeviceInfo getDeviceInfo (unsigned int device)
     Return an RtAudio::DeviceInfo structure for a specified device number.
    unsigned int getDefaultOutputDevice (void) throw ()
     A function that returns the index of the default output device.
    unsigned int getDefaultInputDevice (void) throw ()
     A function that returns the index of the default input device.
    void openStream (RtAudio::StreamParameters *outputParameters, RtAudio::StreamParameters *inputParameters, RtAudioFormat format, unsigned int sampleRate, unsigned int *bufferFrames, RtAudioCallback callback, void *userData=NULL, RtAudio::StreamOptions *options=NULL)
     A public function for opening a stream with the specified parameters.
    void closeStream (void) throw ()
     A function that closes a stream and frees any associated stream memory.
    void startStream (void)
     A function that starts a stream.
    void stopStream (void)
     Stop a stream, allowing any samples remaining in the output queue to be played.
    void abortStream (void)
     Stop a stream, discarding any samples remaining in the input/output queue.
    -bool isStreamOpen (void) const throw ()
     Returns true if a stream is open and false if not.
    -bool isStreamRunning (void) const throw ()
     Returns true if the stream is running and false if it is stopped or not open.
    double getStreamTime (void)
     Returns the number of elapsed seconds since the stream was started.
    long getStreamLatency (void)
     Returns the internal stream latency in sample frames.
    unsigned int getStreamSampleRate (void)
     Returns actual sample rate in use by the stream.
    -void showWarnings (bool value=true) throw ()
     Specify whether warning messages should be printed to stderr.

    Static Public Member Functions

    static void getCompiledApi (std::vector< RtAudio::Api > &apis) throw ()
     A static function to determine the available compiled audio APIs.
     

    Audio API specifier arguments.

    + More...

    Public Member Functions

     RtAudio (RtAudio::Api api=UNSPECIFIED) throw ()
     The class constructor.
     ~RtAudio () throw ()
     The destructor.
    +RtAudio::Api getCurrentApi (void) throw ()
     Returns the audio API specifier for the current instance of RtAudio.
    unsigned int getDeviceCount (void) throw ()
     A public function that queries for the number of audio devices available.
    RtAudio::DeviceInfo getDeviceInfo (unsigned int device)
     Return an RtAudio::DeviceInfo structure for a specified device number.
    unsigned int getDefaultOutputDevice (void) throw ()
     A function that returns the index of the default output device.
    unsigned int getDefaultInputDevice (void) throw ()
     A function that returns the index of the default input device.
    void openStream (RtAudio::StreamParameters *outputParameters, RtAudio::StreamParameters *inputParameters, RtAudioFormat format, unsigned int sampleRate, unsigned int *bufferFrames, RtAudioCallback callback, void *userData=NULL, RtAudio::StreamOptions *options=NULL)
     A public function for opening a stream with the specified parameters.
    void closeStream (void) throw ()
     A function that closes a stream and frees any associated stream memory.
    void startStream (void)
     A function that starts a stream.
    void stopStream (void)
     Stop a stream, allowing any samples remaining in the output queue to be played.
    void abortStream (void)
     Stop a stream, discarding any samples remaining in the input/output queue.
    +bool isStreamOpen (void) const throw ()
     Returns true if a stream is open and false if not.
    +bool isStreamRunning (void) const throw ()
     Returns true if the stream is running and false if it is stopped or not open.
    double getStreamTime (void)
     Returns the number of elapsed seconds since the stream was started.
    long getStreamLatency (void)
     Returns the internal stream latency in sample frames.
    unsigned int getStreamSampleRate (void)
     Returns actual sample rate in use by the stream.
    +void showWarnings (bool value=true) throw ()
     Specify whether warning messages should be printed to stderr.

    Static Public Member Functions

    static void getCompiledApi (std::vector< RtAudio::Api > &apis) throw ()
     A static function to determine the available compiled audio APIs.
    -

    Detailed Description

    -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), Macintosh OS X (CoreAudio and Jack), and Windows (DirectSound and ASIO) operating systems.

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

    -RtAudio: realtime audio i/o C++ classes Copyright (c) 2001-2009 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 asked to send the modifications to the original developer so that they can be incorporated into the canonical version. This is, however, not a binding provision of this license.

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


    Member Enumeration Documentation

    - +

    Detailed Description

    +

    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), Macintosh OS X (CoreAudio and Jack), and Windows (DirectSound and ASIO) operating systems.

    +

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

    +

    RtAudio: realtime audio i/o C++ classes Copyright (c) 2001-2010 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 asked to send the modifications to the original developer so that they can be incorporated into the canonical version. This is, however, not a binding provision of this license.

    +

    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.

    +

    Member Enumeration Documentation

    +
    - +
    enum RtAudio::Api enum RtAudio::Api
    -

    -Audio API specifier arguments. -

    -

    Enumerator:
    - - - - - - - - - +

    Audio API specifier arguments.

    +
    Enumerator:
    UNSPECIFIED  -Search for a working compiled API.
    LINUX_ALSA  -The Advanced Linux Sound Architecture API.
    LINUX_OSS  -The Linux Open Sound System API.
    UNIX_JACK  -The Jack Low-Latency Audio Server API.
    MACOSX_CORE  -Macintosh OS-X Core Audio API.
    WINDOWS_ASIO  -The Steinberg Audio Stream I/O API.
    WINDOWS_DS  -The Microsoft Direct Sound API.
    RTAUDIO_DUMMY  -A compilable but non-functional API.
    + + + + + + + +
    UNSPECIFIED  +

    Search for a working compiled API.

    +
    LINUX_ALSA  +

    The Advanced Linux Sound Architecture API.

    +
    LINUX_OSS  +

    The Linux Open Sound System API.

    +
    UNIX_JACK  +

    The Jack Low-Latency Audio Server API.

    +
    MACOSX_CORE  +

    Macintosh OS-X Core Audio API.

    +
    WINDOWS_ASIO  +

    The Steinberg Audio Stream I/O API.

    +
    WINDOWS_DS  +

    The Microsoft Direct Sound API.

    +
    RTAUDIO_DUMMY  +

    A compilable but non-functional API.

    +
    +
    -

    -


    Constructor & Destructor Documentation

    - + +

    Constructor & Destructor Documentation

    +
    - + - - + + @@ -172,21 +155,20 @@ A compilable but non-functional API.
    -

    -The class constructor. -

    -The constructor performs minor initialization tasks. No exceptions can be thrown.

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

    The class constructor.

    +

    The constructor performs minor initialization tasks. No exceptions can be thrown.

    +

    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 (RtAudio::Api  api = UNSPECIFIED RtAudio::Api  api = UNSPECIFIED  )  throw ()
    - + - + @@ -194,22 +176,21 @@ If no API argument is specified and multiple API support has been compiled, the
    -

    -The destructor. -

    -If a stream is running or open, it will be stopped and closed automatically. +

    The destructor.

    +

    If a stream is running or open, it will be stopped and closed automatically.

    + +
    -

    -


    Member Function Documentation

    - +

    Member Function Documentation

    +
    RtAudio::~RtAudio RtAudio::~RtAudio (  )  throw ()
    - + - - + + @@ -217,21 +198,20 @@ If a stream is running or open, it will be stopped and closed automatically.
    -

    -A static function to determine the available compiled audio APIs. -

    -The values returned in the std::vector can be compared against the enumerated list values. Note that there can be more than one API compiled for certain operating systems. +

    A static function to determine the available compiled audio APIs.

    +

    The values returned in the std::vector can be compared against the enumerated list values. Note that there can be more than one API compiled for certain operating systems.

    + +
    -

    - +

    static void RtAudio::getCompiledApi static void RtAudio::getCompiledApi (std::vector< RtAudio::Api > &  apis std::vector< RtAudio::Api > &  apis  )  throw () [static]
    - + - + @@ -239,21 +219,20 @@ The values returned in the std::vector can be compared against the enumerated li
    -

    -A public function that queries for the number of audio devices available. -

    -This function performs a system query of available devices each time it is called, thus supporting devices connected after instantiation. If a system error occurs during processing, a warning will be issued. +

    A public function that queries for the number of audio devices available.

    +

    This function performs a system query of available devices each time it is called, thus supporting devices connected after instantiation. If a system error occurs during processing, a warning will be issued.

    + +
    -

    - +

    unsigned int RtAudio::getDeviceCount unsigned int RtAudio::getDeviceCount ( void   )  throw () [inline]
    - + - + @@ -261,21 +240,20 @@ This function performs a system query of available devices each time it is calle
    -

    -Return an RtAudio::DeviceInfo structure for a specified device number. -

    -Any device integer between 0 and getDeviceCount() - 1 is valid. If an invalid argument is provided, an RtError (type = INVALID_USE) will be thrown. 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 corresponding "isDefault" member will have a value of "true". +

    Return an RtAudio::DeviceInfo structure for a specified device number.

    +

    Any device integer between 0 and getDeviceCount() - 1 is valid. If an invalid argument is provided, an RtError (type = INVALID_USE) will be thrown. 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 corresponding "isDefault" member will have a value of "true".

    + +
    -

    - +

    RtAudio::DeviceInfo RtAudio::getDeviceInfo RtAudio::DeviceInfo RtAudio::getDeviceInfo ( unsigned int  device device  )  [inline]
    - + - + @@ -283,21 +261,21 @@ Any device integer between 0 and -

    -A function that returns the index of the default output device. -

    -If the underlying audio API does not provide a "default device", or if no devices are available, the return value will be 0. Note that this is a valid device identifier and it is the client's responsibility to verify that a device is available before attempting to open a stream. +

    A function that returns the index of the default output device.

    +

    If the underlying audio API does not provide a "default + device", or if no devices are available, the return value will be 0. Note that this is a valid device identifier and it is the client's responsibility to verify that a device is available before attempting to open a stream.

    + -

    - + +

    unsigned int RtAudio::getDefaultOutputDevice unsigned int RtAudio::getDefaultOutputDevice ( void   )  throw () [inline]
    - + - + @@ -305,18 +283,18 @@ If the underlying audio API does not provide a "default device", or if no device
    -

    -A function that returns the index of the default input device. -

    -If the underlying audio API does not provide a "default device", or if no devices are available, the return value will be 0. Note that this is a valid device identifier and it is the client's responsibility to verify that a device is available before attempting to open a stream. +

    A function that returns the index of the default input device.

    +

    If the underlying audio API does not provide a "default + device", or if no devices are available, the return value will be 0. Note that this is a valid device identifier and it is the client's responsibility to verify that a device is available before attempting to open a stream.

    + +
    -

    - +

    unsigned int RtAudio::getDefaultInputDevice unsigned int RtAudio::getDefaultInputDevice ( void   )  throw () [inline]
    - + @@ -330,7 +308,7 @@ If the underlying audio API does not provide a "default device", or if no device - + @@ -348,7 +326,7 @@ If the underlying audio API does not provide a "default device", or if no device - + @@ -372,14 +350,12 @@ If the underlying audio API does not provide a "default device", or if no device
    -

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

    -An RtError (type = SYSTEM_ERROR) is thrown if a stream cannot be opened with the specified parameters or an error occurs during processing. An RtError (type = INVALID_USE) is thrown if any invalid device ID or channel number parameters are specified.

    -

    Parameters:
    +

    A public function for opening a stream with the specified parameters.

    +

    An RtError (type = SYSTEM_ERROR) is thrown if a stream cannot be opened with the specified parameters or an error occurs during processing. An RtError (type = INVALID_USE) is thrown if any invalid device ID or channel number parameters are specified.

    +
    Parameters:
    void RtAudio::openStream void RtAudio::openStream ( RtAudio::StreamParameters outputParameters,
    RtAudioFormat RtAudioFormat  format,
    RtAudioCallback RtAudioCallback  callback,
    - - + + @@ -387,19 +363,20 @@ An
    outputParameters Specifies output stream parameters to use when opening a stream, including a device ID, number of channels, and starting channel number. For input-only streams, this argument should be NULL. The device ID is an index value between 0 and getDeviceCount() - 1.
    inputParameters Specifies input stream parameters to use when opening a stream, including a device ID, number of channels, and starting channel number. For output-only streams, this argument should be NULL. The device ID is an index value between 0 and getDeviceCount() - 1.
    outputParameters Specifies output stream parameters to use when opening a stream, including a device ID, number of channels, and starting channel number. For input-only streams, this argument should be NULL. The device ID is an index value between 0 and getDeviceCount() - 1.
    inputParameters Specifies input stream parameters to use when opening a stream, including a device ID, number of channels, and starting channel number. For output-only streams, this argument should be NULL. The device ID is an index value between 0 and getDeviceCount() - 1.
    format An RtAudioFormat specifying the desired sample data format.
    sampleRate The desired sample rate (sample frames per second).
    *bufferFrames A pointer to a 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.
    userData An optional pointer to data that can be accessed from within the callback function.
    options An optional pointer to a structure containing various global stream options, including a list of OR'ed RtAudioStreamFlags and a suggested number of stream buffers that can be used to control stream latency. More buffers typically result in more robust performance, though at a cost of greater latency. If a value of zero is specified, a system-specific median value is chosen. If the RTAUDIO_MINIMIZE_LATENCY flag bit is set, the lowest allowable value is used. The actual value used is returned via the structure argument. The parameter is API dependent.
    +
    -

    - + +

    - + - + @@ -407,21 +384,20 @@ An -

    -A function that closes a stream and frees any associated stream memory. -

    -If a stream is not open, this function issues a warning and returns (no exception is thrown). +

    A function that closes a stream and frees any associated stream memory.

    +

    If a stream is not open, this function issues a warning and returns (no exception is thrown).

    + + -

    - +

    void RtAudio::closeStream void RtAudio::closeStream ( void   )  throw () [inline]
    - + - + @@ -429,21 +405,20 @@ If a stream is not open, this function issues a warning and returns (no exceptio
    -

    -A function that starts a stream. -

    -An RtError (type = SYSTEM_ERROR) is thrown if an error occurs during processing. An RtError (type = INVALID_USE) is thrown if a stream is not open. A warning is issued if the stream is already running. +

    A function that starts a stream.

    +

    An RtError (type = SYSTEM_ERROR) is thrown if an error occurs during processing. An RtError (type = INVALID_USE) is thrown if a stream is not open. A warning is issued if the stream is already running.

    + +
    -

    - +

    void RtAudio::startStream void RtAudio::startStream ( void   )  [inline]
    - + - + @@ -451,21 +426,20 @@ An -

    -Stop a stream, allowing any samples remaining in the output queue to be played. -

    -An RtError (type = SYSTEM_ERROR) is thrown if an error occurs during processing. An RtError (type = INVALID_USE) is thrown if a stream is not open. A warning is issued if the stream is already stopped. +

    Stop a stream, allowing any samples remaining in the output queue to be played.

    +

    An RtError (type = SYSTEM_ERROR) is thrown if an error occurs during processing. An RtError (type = INVALID_USE) is thrown if a stream is not open. A warning is issued if the stream is already stopped.

    + -

    - + +

    void RtAudio::stopStream void RtAudio::stopStream ( void   )  [inline]
    - + - + @@ -473,21 +447,20 @@ An -

    -Stop a stream, discarding any samples remaining in the input/output queue. -

    -An RtError (type = SYSTEM_ERROR) is thrown if an error occurs during processing. An RtError (type = INVALID_USE) is thrown if a stream is not open. A warning is issued if the stream is already stopped. +

    Stop a stream, discarding any samples remaining in the input/output queue.

    +

    An RtError (type = SYSTEM_ERROR) is thrown if an error occurs during processing. An RtError (type = INVALID_USE) is thrown if a stream is not open. A warning is issued if the stream is already stopped.

    + + -

    - +

    void RtAudio::abortStream void RtAudio::abortStream ( void   )  [inline]
    - + - + @@ -495,21 +468,20 @@ An -

    -Returns the number of elapsed seconds since the stream was started. -

    -If a stream is not open, an RtError (type = INVALID_USE) will be thrown. +

    Returns the number of elapsed seconds since the stream was started.

    +

    If a stream is not open, an RtError (type = INVALID_USE) will be thrown.

    + + -

    - +

    double RtAudio::getStreamTime double RtAudio::getStreamTime ( void   )  [inline]
    - + - + @@ -517,21 +489,20 @@ If a stream is not open, an -

    -Returns the internal stream latency in sample frames. -

    -The stream latency refers to delay in audio input and/or output caused by internal buffering by the audio system and/or hardware. For duplex streams, the returned value will represent the sum of the input and output latencies. If a stream is not open, an RtError (type = INVALID_USE) will be thrown. If the API does not report latency, the return value will be zero. +

    Returns the internal stream latency in sample frames.

    +

    The stream latency refers to delay in audio input and/or output caused by internal buffering by the audio system and/or hardware. For duplex streams, the returned value will represent the sum of the input and output latencies. If a stream is not open, an RtError (type = INVALID_USE) will be thrown. If the API does not report latency, the return value will be zero.

    + -

    - + +

    long RtAudio::getStreamLatency long RtAudio::getStreamLatency ( void   )  [inline]
    - + - + @@ -539,19 +510,19 @@ The stream latency refers to delay in audio input and/or output caused by intern
    -

    -Returns actual sample rate in use by the stream. -

    -On some systems, the sample rate used may be slightly different than that specified in the stream parameters. If a stream is not open, an RtError (type = INVALID_USE) will be thrown. +

    Returns actual sample rate in use by the stream.

    +

    On some systems, the sample rate used may be slightly different than that specified in the stream parameters. If a stream is not open, an RtError (type = INVALID_USE) will be thrown.

    + +
    -

    -


    The documentation for this class was generated from the following file: +
    The documentation for this class was generated from the following file:
    unsigned int RtAudio::getStreamSampleRate unsigned int RtAudio::getStreamSampleRate ( void   )  [inline]
    - +
    ©2001-2009 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    ©2001-2010 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    diff --git a/doc/html/classRtError-members.html b/doc/html/classRtError-members.html index c81d2a3..a1604e8 100644 --- a/doc/html/classRtError-members.html +++ b/doc/html/classRtError-members.html @@ -8,32 +8,32 @@
    Home   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]
    getType(void)RtError [inline, virtual]
    INVALID_DEVICE enum valueRtError
    INVALID_PARAMETER enum valueRtError
    INVALID_USE 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
    what(void) const RtError [inline, virtual]
    ~RtError(void)RtError [inline, virtual]
    + + + + + + + + + + + + + + + + + +
    DEBUG_WARNING enum valueRtError
    DRIVER_ERROR enum valueRtError
    getMessage(void)RtError [inline, virtual]
    getType(void)RtError [inline, virtual]
    INVALID_DEVICE enum valueRtError
    INVALID_PARAMETER enum valueRtError
    INVALID_USE 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
    what(void) const RtError [inline, virtual]
    ~RtError(void)RtError [inline, virtual]


    - +
    ©2001-2009 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    ©2001-2010 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    diff --git a/doc/html/classRtError.html b/doc/html/classRtError.html index e90dcf1..29fd564 100644 --- a/doc/html/classRtError.html +++ b/doc/html/classRtError.html @@ -8,116 +8,119 @@
    Home   Class/Enum List   File List   Compound Members  

    - +
    -

    RtError Class Reference

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

    -#include <RtError.h> -

    +

    RtError Class Reference

    +

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

    -

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

    #include <RtError.h>

    - - - - - - - +

    List of all members.

    +

    Public Types

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

    Public Member Functions

    RtError (const std::string &message, Type type=RtError::UNSPECIFIED) throw ()
     The constructor.
    -virtual ~RtError (void) throw ()
     The destructor.
    -virtual void printMessage (void) throw ()
     Prints thrown error message to stderr.
    -virtual const TypegetType (void) throw ()
     Returns the thrown error message type.
    -virtual const std::string & getMessage (void) throw ()
     Returns the thrown error message string.
    -virtual const char * what (void) const throw ()
     Returns the thrown error message as a c-style string.
    + + + + + + + + + + + + + + + +

    Public Types

    enum  Type {
    +  WARNING, +DEBUG_WARNING, +UNSPECIFIED, +NO_DEVICES_FOUND, +
    +  INVALID_DEVICE, +MEMORY_ERROR, +INVALID_PARAMETER, +INVALID_USE, +
    +  DRIVER_ERROR, +SYSTEM_ERROR, +THREAD_ERROR +
    + }
     

    Defined RtError types.

    + More...

    Public Member Functions

    RtError (const std::string &message, Type type=RtError::UNSPECIFIED) throw ()
     The constructor.
    +virtual ~RtError (void) throw ()
     The destructor.
    +virtual void printMessage (void) throw ()
     Prints thrown error message to stderr.
    +virtual const TypegetType (void) throw ()
     Returns the thrown error message type.
    +virtual const std::string & getMessage (void) throw ()
     Returns the thrown error message string.
    +virtual const char * what (void) const throw ()
     Returns the thrown error message as a c-style string.
    -


    Detailed Description

    -Exception handling class for RtAudio & RtMidi. -

    -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

    - +

    Detailed Description

    +

    Exception handling class for RtAudio & RtMidi.

    +

    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

    +
    -

    -Defined RtError types. -

    -

    Enumerator:
    - - - - - - - - - - - - +

    Defined RtError types.

    +
    Enumerator:
    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.
    MEMORY_ERROR  -An error occured during memory allocation.
    INVALID_PARAMETER  -An invalid parameter was specified to a function.
    INVALID_USE  -The function was called incorrectly.
    DRIVER_ERROR  -A system driver error occured.
    SYSTEM_ERROR  -A system error occured.
    THREAD_ERROR  -A thread error occured.
    + + + + + + + + + + +
    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.

    +
    MEMORY_ERROR  +

    An error occured during memory allocation.

    +
    INVALID_PARAMETER  +

    An invalid parameter was specified to a function.

    +
    INVALID_USE  +

    The function was called incorrectly.

    +
    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: +
    +
    The documentation for this class was generated from the following file:

    - +
    ©2001-2009 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    ©2001-2010 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    diff --git a/doc/html/classes.html b/doc/html/classes.html index 0e20935..ca47b03 100644 --- a/doc/html/classes.html +++ b/doc/html/classes.html @@ -8,17 +8,19 @@
    Home   Class/Enum List   File List   Compound Members  

    - +
    -

    Class Index

    +

    Class Index

    D | R | S
    -
      R  
    -
    RtAudio::DeviceInfo   RtAudio::StreamOptions   RtAudio::StreamParameters   RtError   
    RtAudio   

    +

      D  
    +
      R  
    +
    RtError   RtAudio::StreamOptions   RtAudio::StreamParameters   
    RtAudio::DeviceInfo   RtAudio   
      S  
    +

    D | R | S

    - +
    ©2001-2009 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    ©2001-2010 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    diff --git a/doc/html/compiling.html b/doc/html/compiling.html index c055362..39cde7b 100644 --- a/doc/html/compiling.html +++ b/doc/html/compiling.html @@ -8,14 +8,17 @@
    Home   Class/Enum List   File List   Compound Members  

    - +
    -

    Debugging & Compiling

    + + +

    Debugging & Compiling

    Debugging

    -If you are having problems getting RtAudio to run on your system, make sure to pass a value of true to the RtAudio::showWarnings() function (this is the default setting). A variety of warning messages will be displayed which may help in determining the problem. Also, try using the programs included in the tests directory. The program audioprobe displays the queried capabilities of all hardware devices found for all APIs compiled. When using the ALSA and JACK APIs, further information can be displayed by defining the preprocessor definition __RTAUDIO_DEBUG__.

    +

    If you are having problems getting RtAudio to run on your system, make sure to pass a value of true to the RtAudio::showWarnings() function (this is the default setting). A variety of warning messages will be displayed which may help in determining the problem. Also, try using the programs included in the tests directory. The program audioprobe displays the queried capabilities of all hardware devices found for all APIs compiled. When using the ALSA and JACK APIs, further information can be displayed by defining the preprocessor definition __RTAUDIO_DEBUG__.

    +

    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:

    - +

    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:

    +
    @@ -23,7 +26,8 @@ In order to compile g++ -Wall -D__UNIX_JACK__ -o audioprobe audioprobe.cpp RtAudio.cpp `pkg-config --cflags --libs jack` -lpthread

    +

    @@ -32,12 +36,12 @@ In order to compile RtAudio.h, RtError.h, and RtAudio.cpp all exist in the same directory. +

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

    +
    OS: Audio API: C++ Class: Preprocessor Definition: Library or Framework: Example Compiler Statement:
    Macintosh OS-X CoreAudio RtApiCore __MACOSX_CORE__ pthread, CoreAudio g++ -Wall -D__MACOSX_CORE__ -o audioprobe audioprobe.cpp RtAudio.cpp -framework CoreAudio -lpthread
    - +
    ©2001-2009 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    ©2001-2010 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    diff --git a/doc/html/doxygen.css b/doc/html/doxygen.css index 3767dc9..b057a92 100644 --- a/doc/html/doxygen.css +++ b/doc/html/doxygen.css @@ -1,3 +1,5 @@ +/* The standard CSS for doxygen */ + body, table, div, p, dl { font-family: Lucida Grande, Verdana, Geneva, Arial, sans-serif; font-size: 12px; @@ -18,12 +20,49 @@ h3 { font-size: 100%; } +dt { + font-weight: bold; +} + +div.multicol { + -moz-column-gap: 1em; + -webkit-column-gap: 1em; + -moz-column-count: 3; + -webkit-column-count: 3; +} + +p.startli, p.startdd, p.starttd { + margin-top: 2px; +} + +p.endli { + margin-bottom: 0px; +} + +p.enddd { + margin-bottom: 4px; +} + +p.endtd { + margin-bottom: 2px; +} + /* @end */ caption { font-weight: bold; } +span.legend { + font-size: 70%; + text-align: center; +} + +h3.version { + font-size: 90%; + text-align: center; +} + div.qindex, div.navtab{ background-color: #e8eef2; border: 1px solid #84b0c7; @@ -80,9 +119,11 @@ a.elRef { } a.code { + color: #3030f0; } a.codeRef { + color: #3030f0; } /* @end */ @@ -101,6 +142,10 @@ pre.fragment { background-color: #f5f5f5; padding: 4px 6px; margin: 4px 8px 4px 2px; + overflow: auto; + word-wrap: break-word; + font-size: 9pt; + line-height: 125%; } div.ah { @@ -161,6 +206,22 @@ img.formulaInl { vertical-align: middle; } +div.center { + text-align: center; + margin-top: 0px; + margin-bottom: 0px; + padding: 0px; +} + +div.center img { + border: 0px; +} + +img.footer { + border: 0px; + vertical-align: middle; +} + /* @group Code Colorization */ span.keyword { @@ -267,8 +328,13 @@ hr { border-top: 1px solid #ccc; } +.memItemLeft, .memTemplItemLeft { + white-space: nowrap; +} + .memTemplParams { color: #606060; + white-space: nowrap; } /* @end */ @@ -295,6 +361,7 @@ hr { .memitem { padding: 0; + margin-bottom: 10px; } .memname { @@ -312,8 +379,11 @@ hr { font-weight: bold; -webkit-border-top-left-radius: 8px; -webkit-border-top-right-radius: 8px; + -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); -moz-border-radius-topleft: 8px; -moz-border-radius-topright: 8px; + -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; + } .memdoc { @@ -322,8 +392,10 @@ hr { border-top-width: 0; -webkit-border-bottom-left-radius: 8px; -webkit-border-bottom-right-radius: 8px; + -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); -moz-border-radius-bottomleft: 8px; -moz-border-radius-bottomright: 8px; + -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; } .paramkey { @@ -439,3 +511,22 @@ address { font-style: normal; color: #333; } + +table.doxtable { + border-collapse:collapse; +} + +table.doxtable td, table.doxtable th { + border: 1px solid #153788; + padding: 3px 7px 2px; +} + +table.doxtable th { + background-color: #254798; + color: #FFFFFF; + font-size: 110%; + padding-bottom: 4px; + padding-top: 5px; + text-align:left; +} + diff --git a/doc/html/duplex.html b/doc/html/duplex.html index 7bfdb64..6e85d69 100644 --- a/doc/html/duplex.html +++ b/doc/html/duplex.html @@ -8,21 +8,23 @@

    Home   Class/Enum List   File List   Compound Members  

    - +
    -

    Duplex Mode

    Finally, it is easy to use RtAudio for simultaneous audio input/output, or duplex operation. In this example, we simply pass the input data back to the output.

    -

    #include "RtAudio.h"
    +
    +
    +

    Duplex Mode

    Finally, it is easy to use RtAudio for simultaneous audio input/output, or duplex operation. In this example, we simply pass the input data back to the output.

    +
    #include "RtAudio.h"
     #include <iostream>
     #include <cstdlib>
     #include <cstring>
     
     // Pass-through function.
     int inout( void *outputBuffer, void *inputBuffer, unsigned int nBufferFrames,
    -           double streamTime, RtAudioStreamStatus status, void *data )
    +           double streamTime, RtAudioStreamStatus status, void *data )
     {
       // Since the number of input and output channels is equal, we can do
       // a simple buffer copy operation here.
    -  if ( status ) std::cout << "Stream over/underflow detected." << std::endl;
    +  if ( status ) std::cout << "Stream over/underflow detected." << std::endl;
     
       unsigned long *bytes = (unsigned long *) data;
       memcpy( outputBuffer, inputBuffer, *bytes );
    @@ -32,56 +34,56 @@
     int main()
     {
      RtAudio adac;
    -  if ( adac.getDeviceCount() < 1 ) {
    -    std::cout << "\nNo audio devices found!\n";
    +  if ( adac.getDeviceCount() < 1 ) {
    +    std::cout << "\nNo audio devices found!\n";
         exit( 0 );
       }
     
       // Set the same number of channels for both input and output.
       unsigned int bufferBytes, bufferFrames = 512;
       RtAudio::StreamParameters iParams, oParams;
    -  iParams.deviceId = 0; // first available device
    -  iParams.nChannels = 2;
    -  oParams.deviceId = 0; // first available device
    -  oParams.nChannels = 2;
    +  iParams.deviceId = 0; // first available device
    +  iParams.nChannels = 2;
    +  oParams.deviceId = 0; // first available device
    +  oParams.nChannels = 2;
     
       try {
    -    adac.openStream( &oParams, &iParams, RTAUDIO_SINT32, 44100, &bufferFrames, &inout, (void *)&bufferBytes );
    +    adac.openStream( &oParams, &iParams, RTAUDIO_SINT32, 44100, &bufferFrames, &inout, (void *)&bufferBytes );
       }
       catch ( RtError& e ) {
    -    e.printMessage();
    +    e.printMessage();
         exit( 0 );
       }
     
       bufferBytes = bufferFrames * 2 * 4;
     
       try {
    -    adac.startStream();
    +    adac.startStream();
     
         char input;
    -    std::cout << "\nRunning ... press <enter> to quit.\n";
    +    std::cout << "\nRunning ... press <enter> to quit.\n";
         std::cin.get(input);
     
         // Stop the stream.
    -    adac.stopStream();
    +    adac.stopStream();
       }
       catch ( RtError& e ) {
    -    e.printMessage();
    +    e.printMessage();
         goto cleanup;
       }
     
      cleanup:
    -  if ( adac.isStreamOpen() ) adac.closeStream();
    +  if ( adac.isStreamOpen() ) adac.closeStream();
     
       return 0;
     }
    -

    -In this example, audio recorded by the stream input will be played out during the next round of audio processing.

    -Note that a duplex stream can make use of two different devices (except when using the Linux Jack and Windows ASIO APIs). However, this may cause timing problems due to possible device clock variations, unless a common external "sync" is provided.

    +

    In this example, audio recorded by the stream input will be played out during the next round of audio processing.

    +

    Note that a duplex stream can make use of two different devices (except when using the Linux Jack and Windows ASIO APIs). However, this may cause timing problems due to possible device clock variations, unless a common external "sync" is provided.

    +

    - +
    ©2001-2009 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    ©2001-2010 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    diff --git a/doc/html/errors.html b/doc/html/errors.html index bbd5805..1d434d3 100644 --- a/doc/html/errors.html +++ b/doc/html/errors.html @@ -8,13 +8,16 @@
    Home   Class/Enum List   File List   Compound Members  

    - +
    -

    Error Handling

    RtAudio makes restrained use of C++ exceptions. That is, exceptions are thrown only when system errors occur that prevent further class operation or when the user makes invalid function calls. In other cases, a warning message may be displayed and an appropriate value is returned. For example, if a system error occurs when processing the RtAudio::getDeviceCount() function, the return value is zero. In such a case, the user cannot expect to make use of most other RtAudio functions because no devices are available (and thus a stream cannot be opened). A client can call the function RtAudio::showWarnings() with a boolean argument to enable or disable the printing of warning messages to stderr. By default, warning messages are displayed. There is a protected RtAudio method, error(), that can be modified to globally control how these messages are handled and reported.
    + + +

    Error Handling

    RtAudio makes restrained use of C++ exceptions. That is, exceptions are thrown only when system errors occur that prevent further class operation or when the user makes invalid function calls. In other cases, a warning message may be displayed and an appropriate value is returned. For example, if a system error occurs when processing the RtAudio::getDeviceCount() function, the return value is zero. In such a case, the user cannot expect to make use of most other RtAudio functions because no devices are available (and thus a stream cannot be opened). A client can call the function RtAudio::showWarnings() with a boolean argument to enable or disable the printing of warning messages to stderr. By default, warning messages are displayed. There is a protected RtAudio method, error(), that can be modified to globally control how these messages are handled and reported.

    +
    - +
    ©2001-2009 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    ©2001-2010 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    diff --git a/doc/html/files.html b/doc/html/files.html index 4505706..92314be 100644 --- a/doc/html/files.html +++ b/doc/html/files.html @@ -8,17 +8,17 @@
    Home   Class/Enum List   File List   Compound Members  

    - +

    File List

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

    - +
    ©2001-2009 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    ©2001-2010 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    diff --git a/doc/html/functions.html b/doc/html/functions.html index 89fca6e..611ba70 100644 --- a/doc/html/functions.html +++ b/doc/html/functions.html @@ -8,7 +8,7 @@
    Home   Class/Enum List   File List   Compound Members  

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

    -

    - a -


    - +
    ©2001-2009 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    ©2001-2010 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    diff --git a/doc/html/functions_enum.html b/doc/html/functions_enum.html index 007c4f6..e8b38d8 100644 --- a/doc/html/functions_enum.html +++ b/doc/html/functions_enum.html @@ -8,7 +8,7 @@
    Home   Class/Enum List   File List   Compound Members  

    - +
    -  -

    -


    - +
    ©2001-2009 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    ©2001-2010 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    diff --git a/doc/html/functions_eval.html b/doc/html/functions_eval.html index 92c8793..ab5a68f 100644 --- a/doc/html/functions_eval.html +++ b/doc/html/functions_eval.html @@ -8,7 +8,7 @@
    Home   Class/Enum List   File List   Compound Members  

    - +
    -  -

    -


    - +
    ©2001-2009 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    ©2001-2010 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    diff --git a/doc/html/functions_func.html b/doc/html/functions_func.html index c5520d9..1ef9c06 100644 --- a/doc/html/functions_func.html +++ b/doc/html/functions_func.html @@ -8,7 +8,7 @@
    Home   Class/Enum List   File List   Compound Members  

    - +
    -  -

    -


    - +
    ©2001-2009 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    ©2001-2010 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    diff --git a/doc/html/functions_vars.html b/doc/html/functions_vars.html index d28575c..1f5d092 100644 --- a/doc/html/functions_vars.html +++ b/doc/html/functions_vars.html @@ -8,7 +8,7 @@
    Home   Class/Enum List   File List   Compound Members  

    - +
    -  -

    -


    - +
    ©2001-2009 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    ©2001-2010 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    diff --git a/doc/html/globals.html b/doc/html/globals.html index 4140e96..62a95b7 100644 --- a/doc/html/globals.html +++ b/doc/html/globals.html @@ -8,7 +8,7 @@
    Home   Class/Enum List   File List   Compound Members  

    - +
    -Here is a list of all documented file members with links to the documentation: -

    -


    - +
    ©2001-2009 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    ©2001-2010 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    diff --git a/doc/html/globals_type.html b/doc/html/globals_type.html index eb3207e..9207899 100644 --- a/doc/html/globals_type.html +++ b/doc/html/globals_type.html @@ -8,7 +8,7 @@
    Home   Class/Enum List   File List   Compound Members  

    - +
    -  -

    -


    - +
    ©2001-2009 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    ©2001-2010 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    diff --git a/doc/html/index.html b/doc/html/index.html index 5767cdc..531fc6a 100644 --- a/doc/html/index.html +++ b/doc/html/index.html @@ -8,11 +8,9 @@
    Home   Class/Enum List   File List   Compound Members  

    - +
    -

    The RtAudio Home Page

    -

    -

    4.0.6

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

    +

    The RtAudio Home Page

    4.0.7

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

    -

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

    +

    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.

    +

    What's New (Version 4.0)

    -RtAudio V4 represents a significant rewrite of the code and includes a number of API and functionality changes from previous versions. A partial list of the changes includes: -

    -Devices are now re-enumerated every time the RtAudio::getDeviceCount(), RtAudio::getDeviceInfo(), and RtAudio::openStream() functions are called. This allows for the proper identification of hot-pluggable (USB, Firewire, ...) devices that are connected after an RtAudio instance is created.

    +

    RtAudio V4 represents a significant rewrite of the code and includes a number of API and functionality changes from previous versions. A partial list of the changes includes:

    +
      +
    • new support for non-interleaved user data
    • +
    • additional input/output parameter specifications, including channel offset
    • +
    • new support for dynamic connection of devices
    • +
    • new support for stream time
    • +
    • revised callback arguments, including separate input and output buffer arguments
    • +
    • revised C++ exception handling
    • +
    • updated support for OSS version 4.0
    • +
    • discontinued support of blocking functionality
    • +
    • discontinued support of SGI
    • +
    +

    Devices are now re-enumerated every time the RtAudio::getDeviceCount(), RtAudio::getDeviceInfo(), and RtAudio::openStream() functions are called. This allows for the proper identification of hot-pluggable (USB, Firewire, ...) devices that are connected after an RtAudio instance is created.

    +

    Download

    -Latest Release (3 June 2009): Version 4.0.6

    +

    Latest Release (4 February 2010): Version 4.0.7

    +

    Documentation Links

    -
      -
    1. Error Handling
    2. Probing Device Capabilities
    3. Device Settings
    4. Playback
    5. Recording
    6. Duplex Mode
    7. Using Simultaneous Multiple APIs
    8. Debugging & Compiling
    9. API Notes
    10. Acknowledgements
    11. License
    12. Bug Tracker
    13. Possible Updates
    14. RtAudio at SourceForge
    +
      +
    1. Error Handling
    2. +
    3. Probing Device Capabilities
    4. +
    5. Device Settings
    6. +
    7. Playback
    8. +
    9. Recording
    10. +
    11. Duplex Mode
    12. +
    13. Using Simultaneous Multiple APIs
    14. +
    15. Debugging & Compiling
    16. +
    17. API Notes
    18. +
    19. Acknowledgements
    20. +
    21. License
    22. +
    23. Bug Tracker
    24. +
    25. Possible Updates
    26. +
    27. RtAudio at SourceForge
    28. +

    - +
    ©2001-2009 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    ©2001-2010 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    diff --git a/doc/html/license.html b/doc/html/license.html index 80a7408..2e6a981 100644 --- a/doc/html/license.html +++ b/doc/html/license.html @@ -8,18 +8,21 @@
    Home   Class/Enum List   File List   Compound Members  

    - +
    -

    License

    RtAudio: a set of realtime audio i/o C++ classes
    - Copyright (c) 2001-2009 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 asked to send the modifications to the original developer so that they can be incorporated into the canonical version. This is, however, not a binding provision of this license.

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

    + + +

    License

    RtAudio: a set of realtime audio i/o C++ classes
    + Copyright (c) 2001-2010 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 asked to send the modifications to the original developer so that they can be incorporated into the canonical version. This is, however, not a binding provision of this license.

    +

    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-2009 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    ©2001-2010 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    diff --git a/doc/html/multi.html b/doc/html/multi.html index acc6088..bbcd278 100644 --- a/doc/html/multi.html +++ b/doc/html/multi.html @@ -8,14 +8,17 @@
    Home   Class/Enum List   File List   Compound Members  

    - +
    -

    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 no available devices are found, 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 an ASIO instance and then a DirectSound instance (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 unlikely that the same device could be simultaneously controlled with two different audio APIs.

    -The static function RtAudio::getCompiledApi() is provided to determine the available compiled API support. The function RtAudio::getCurrentApi() indicates the API selected for a given RtAudio instance.

    + + +

    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 no available devices are found, 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 an ASIO instance and then a DirectSound instance (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 unlikely that the same device could be simultaneously controlled with two different audio APIs.

    +

    The static function RtAudio::getCompiledApi() is provided to determine the available compiled API support. The function RtAudio::getCurrentApi() indicates the API selected for a given RtAudio instance.

    +
    - +
    ©2001-2009 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    ©2001-2010 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    diff --git a/doc/html/pages.html b/doc/html/pages.html index b417146..4d8bc83 100644 --- a/doc/html/pages.html +++ b/doc/html/pages.html @@ -8,37 +8,37 @@
    Home   Class/Enum List   File List   Compound Members  

    - +

    Related Pages

    Here is a list of all related documentation pages:

    - +
    ©2001-2009 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    ©2001-2010 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    diff --git a/doc/html/playback.html b/doc/html/playback.html index 0dbcab1..0af9ebb 100644 --- a/doc/html/playback.html +++ b/doc/html/playback.html @@ -8,23 +8,25 @@
    Home   Class/Enum List   File List   Compound Members  

    - +
    -

    Playback

    In this example, we provide a complete program that demonstrates the use of RtAudio for audio playback. Our program produces a two-channel sawtooth waveform for output.

    -

    #include "RtAudio.h"
    +
    +
    +

    Playback

    In this example, we provide a complete program that demonstrates the use of RtAudio for audio playback. Our program produces a two-channel sawtooth waveform for output.

    +
    #include "RtAudio.h"
     #include <iostream>
     #include <cstdlib>
     
     // Two-channel sawtooth wave generator.
     int saw( void *outputBuffer, void *inputBuffer, unsigned int nBufferFrames,
    -         double streamTime, RtAudioStreamStatus status, void *userData )
    +         double streamTime, RtAudioStreamStatus status, void *userData )
     {
       unsigned int i, j;
       double *buffer = (double *) outputBuffer;
       double *lastValues = (double *) userData;
     
       if ( status )
    -    std::cout << "Stream underflow detected!" << std::endl;
    +    std::cout << "Stream underflow detected!" << std::endl;
     
       // Write interleaved audio data.
       for ( i=0; i<nBufferFrames; i++ ) {
    @@ -42,52 +44,52 @@
     int main()
     {
       RtAudio dac;
    -  if ( dac.getDeviceCount() < 1 ) {
    -    std::cout << "\nNo audio devices found!\n";
    +  if ( dac.getDeviceCount() < 1 ) {
    +    std::cout << "\nNo audio devices found!\n";
         exit( 0 );
       }
     
       RtAudio::StreamParameters parameters;
    -  parameters.deviceId = dac.getDefaultOutputDevice();
    -  parameters.nChannels = 2;
    -  parameters.firstChannel = 0;
    +  parameters.deviceId = dac.getDefaultOutputDevice();
    +  parameters.nChannels = 2;
    +  parameters.firstChannel = 0;
       unsigned int sampleRate = 44100;
       unsigned int bufferFrames = 256; // 256 sample frames
       double data[2];
     
       try {
    -    dac.openStream( &parameters, NULL, RTAUDIO_FLOAT64,
    +    dac.openStream( &parameters, NULL, RTAUDIO_FLOAT64,
                         sampleRate, &bufferFrames, &saw, (void *)&data );
    -    dac.startStream();
    +    dac.startStream();
       }
       catch ( RtError& e ) {
    -    e.printMessage();
    +    e.printMessage();
         exit( 0 );
       }
       
       char input;
    -  std::cout << "\nPlaying ... press <enter> to quit.\n";
    +  std::cout << "\nPlaying ... press <enter> to quit.\n";
       std::cin.get( input );
     
       try {
         // Stop the stream
    -    dac.stopStream();
    +    dac.stopStream();
       }
       catch (RtError& e) {
    -    e.printMessage();
    +    e.printMessage();
       }
     
    -  if ( dac.isStreamOpen() ) dac.closeStream();
    +  if ( dac.isStreamOpen() ) dac.closeStream();
     
       return 0;
     }
    -

    -We open the stream in exactly the same way as the previous example (except with a data format change) and specify the address of our callback function "saw()". The callback function will automatically be invoked when the underlying audio system needs data for output. Note that the callback function is called only when the stream is "running" (between calls to the RtAudio::startStream() and RtAudio::stopStream() functions). We can also pass a pointer value to the RtAudio::openStream() function that is made available in the callback function. In this way, it is possible to gain access to arbitrary data created in our main() function from within the globally defined callback function.

    -In this example, we stop the stream with an explicit call to RtAudio::stopStream(). It is also possible to stop a stream by returning a non-zero value from the callback function. A return value of 1 will cause the stream to finish draining its internal buffers and then halt (equivalent to calling the RtAudio::stopStream() function). A return value of 2 will cause the stream to stop immediately (equivalent to calling the RtAudio::abortStream() function).

    +

    We open the stream in exactly the same way as the previous example (except with a data format change) and specify the address of our callback function "saw()". The callback function will automatically be invoked when the underlying audio system needs data for output. Note that the callback function is called only when the stream is "running" (between calls to the RtAudio::startStream() and RtAudio::stopStream() functions). We can also pass a pointer value to the RtAudio::openStream() function that is made available in the callback function. In this way, it is possible to gain access to arbitrary data created in our main() function from within the globally defined callback function.

    +

    In this example, we stop the stream with an explicit call to RtAudio::stopStream(). It is also possible to stop a stream by returning a non-zero value from the callback function. A return value of 1 will cause the stream to finish draining its internal buffers and then halt (equivalent to calling the RtAudio::stopStream() function). A return value of 2 will cause the stream to stop immediately (equivalent to calling the RtAudio::abortStream() function).

    +
    - +
    ©2001-2009 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    ©2001-2010 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    diff --git a/doc/html/probe.html b/doc/html/probe.html index ef7ba41..3f5d2c9 100644 --- a/doc/html/probe.html +++ b/doc/html/probe.html @@ -8,66 +8,66 @@
    Home   Class/Enum List   File List   Compound Members  

    - +
    -

    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.

    + + +

    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.

    // audioprobe.cpp
     
     #include <iostream>
    -#include "RtAudio.h"
    +#include "RtAudio.h"
     
     int main()
     {
       RtAudio audio;
     
       // Determine the number of devices available
    -  unsigned int devices = audio.getDeviceCount();
    +  unsigned int devices = audio.getDeviceCount();
     
       // Scan through devices for various capabilities
       RtAudio::DeviceInfo info;
    -  for ( unsigned int i=1; i<=devices; i++ ) {
    +  for ( unsigned int i=0; i<=devices; i++ ) {
     
    -    info = audio.getDeviceInfo( i );
    +    info = audio.getDeviceInfo( i );
     
    -    if ( info.probed == true ) {
    +    if ( info.probed == true ) {
           // Print, for example, the maximum number of output channels for each device
    -      std::cout << "device = " << i;
    -      std::cout << ": maximum output channels = " << info.outputChannels << "\n";
    +      std::cout << "device = " << i;
    +      std::cout << ": maximum output channels = " << info.outputChannels << "\n";
         }
       }
     
       return 0;
     }
    -

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

    +

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

      typedef struct RtAudio::DeviceInfo {
    -    bool probed;                           // true if the device capabilities were successfully probed.
    -    std::string name;                      // Character string device identifier.
    -    unsigned int outputChannels;           // Maximum output channels supported by device.
    -    unsigned int inputChannels;            // Maximum input channels supported by device.
    -    unsigned int duplexChannels;           // Maximum simultaneous input/output channels supported by device.
    -    bool isDefaultOutput;                  // true if this is the default output device.
    -    bool isDefaultInput;                   // true if this is the default input device.
    -    std::vector<unsigned int> sampleRates; // Supported sample rates.
    -    RtAudioFormat nativeFormats;           // Bit mask of supported data formats.
    +    bool probed;                           // true if the device capabilities were successfully probed.
    +    std::string name;                      // Character string device identifier.
    +    unsigned int outputChannels;           // Maximum output channels supported by device.
    +    unsigned int inputChannels;            // Maximum input channels supported by device.
    +    unsigned int duplexChannels;           // Maximum simultaneous input/output channels supported by device.
    +    bool isDefaultOutput;                  // true if this is the default output device.
    +    bool isDefaultInput;                   // true if this is the default input device.
    +    std::vector<unsigned 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;
    +

    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 (lower 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 RtAudio::DeviceInfo 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::DeviceInfo structure is false, the remaining structure members are undefined and the device is probably unusable.

    -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 rely on the queried values when attempting to open a stream. +

    The nativeFormats member of the RtAudio::DeviceInfo 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::DeviceInfo structure is false, the remaining structure members are undefined and the device is probably unusable.

    +

    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 rely on the queried values when attempting to open a stream.

    +
    - +
    ©2001-2009 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    ©2001-2010 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    diff --git a/doc/html/recording.html b/doc/html/recording.html index c7772bf..3e86db4 100644 --- a/doc/html/recording.html +++ b/doc/html/recording.html @@ -8,21 +8,23 @@
    Home   Class/Enum List   File List   Compound Members  

    - +
    -

    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:

    -

    #include "RtAudio.h"
    +
    +
    +

    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:

    +
    #include "RtAudio.h"
     #include <iostream>
     #include <cstdlib>
     #include <cstring>
     
     int record( void *outputBuffer, void *inputBuffer, unsigned int nBufferFrames,
    -         double streamTime, RtAudioStreamStatus status, void *userData )
    +         double streamTime, RtAudioStreamStatus status, void *userData )
     {
       if ( status )
    -    std::cout << "Stream overflow detected!" << std::endl;
    +    std::cout << "Stream overflow detected!" << std::endl;
     
    -  // Do something with the data in the "inputBuffer" buffer.
    +  // Do something with the data in the "inputBuffer" buffer.
     
       return 0;
     }
    @@ -30,50 +32,50 @@
     int main()
     {
       RtAudio adc;
    -  if ( adc.getDeviceCount() < 1 ) {
    -    std::cout << "\nNo audio devices found!\n";
    +  if ( adc.getDeviceCount() < 1 ) {
    +    std::cout << "\nNo audio devices found!\n";
         exit( 0 );
       }
     
       RtAudio::StreamParameters parameters;
    -  parameters.deviceId = adc.getDefaultInputDevice();
    -  parameters.nChannels = 2;
    -  parameters.firstChannel = 0;
    +  parameters.deviceId = adc.getDefaultInputDevice();
    +  parameters.nChannels = 2;
    +  parameters.firstChannel = 0;
       unsigned int sampleRate = 44100;
       unsigned int bufferFrames = 256; // 256 sample frames
     
       try {
    -    adc.openStream( NULL, &parameters, RTAUDIO_SINT16,
    +    adc.openStream( NULL, &parameters, RTAUDIO_SINT16,
                         sampleRate, &bufferFrames, &record );
    -    adc.startStream();
    +    adc.startStream();
       }
       catch ( RtError& e ) {
    -    e.printMessage();
    +    e.printMessage();
         exit( 0 );
       }
       
       char input;
    -  std::cout << "\nRecording ... press <enter> to quit.\n";
    +  std::cout << "\nRecording ... press <enter> to quit.\n";
       std::cin.get( input );
     
       try {
         // Stop the stream
    -    adc.stopStream();
    +    adc.stopStream();
       }
       catch (RtError& e) {
    -    e.printMessage();
    +    e.printMessage();
       }
     
    -  if ( adc.isStreamOpen() ) adc.closeStream();
    +  if ( adc.isStreamOpen() ) adc.closeStream();
     
       return 0;
     }
    -

    -In this example, we pass the address of the stream parameter structure as the second argument of the RtAudio::openStream() function and pass a NULL value for the output stream parameters. In this example, the record() callback function performs no specific operations.

    +

    In this example, we pass the address of the stream parameter structure as the second argument of the RtAudio::openStream() function and pass a NULL value for the output stream parameters. In this example, the record() callback function performs no specific operations.

    +
    - +
    ©2001-2009 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    ©2001-2010 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    diff --git a/doc/html/settings.html b/doc/html/settings.html index cb62dc9..2813a1d 100644 --- a/doc/html/settings.html +++ b/doc/html/settings.html @@ -8,47 +8,49 @@
    Home   Class/Enum List   File List   Compound Members  

    - +
    -

    Device Settings

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

    -

    #include "RtAudio.h"
    +
    +
    +

    Device Settings

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

    +
    #include "RtAudio.h"
     
     int main()
     {
       RtAudio dac;
    -  if ( dac.getDeviceCount() == 0 ) exit( 0 );
    +  if ( dac.getDeviceCount() == 0 ) exit( 0 );
     
       RtAudio::StreamParameters parameters;
    -  parameters.deviceId = dac.getDefaultOutputDevice();
    -  parameters.nChannels = 2;
    +  parameters.deviceId = dac.getDefaultOutputDevice();
    +  parameters.nChannels = 2;
       unsigned int sampleRate = 44100;
       unsigned int bufferFrames = 256; // 256 sample frames
     
       RtAudio::StreamOptions options;
    -  options.flags = RTAUDIO_NONINTERLEAVED;
    +  options.flags = RTAUDIO_NONINTERLEAVED;
     
       try {
    -    dac.openStream( &parameters, NULL, RTAUDIO_FLOAT32,
    +    dac.openStream( &parameters, NULL, RTAUDIO_FLOAT32,
                         sampleRate, &bufferFrames, &myCallback, NULL, &options );
       }
       catch ( RtError& e ) {
    -    std::cout << '\n' << e.getMessage() << '\n' << std::endl;
    +    std::cout << '\n' << e.getMessage() << '\n' << std::endl;
         exit( 0 );
       }
       
       return 0;
     }
    -

    -The RtAudio::openStream() function attempts to open a stream with a specified set of parameter values. In the above example, we attempt to open a two channel playback stream using the default output device, 32-bit floating point data, a sample rate of 44100 Hz, and a frame rate of 256 sample frames per output buffer. If the user specifies an invalid parameter value (such as a device id greater than or equal to the number of enumerated devices), an RtError is thrown of type = INVALID_USE. If a system error occurs or the device does not support the specified parameter values, an RtError of type = SYSTEM_ERROR is thrown. In either case, a descriptive error message is bundled with the exception and can be queried with the RtError::getMessage() or RtError::what() functions.

    -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 bufferFrames parameter specifies the desired number of sample frames that will be written to and/or read from a device per write/read operation. This parameter can be used to control stream latency though there is no guarantee that the passed value will be that used by a device. In general, a lower bufferFrames value will produce less latency but perhaps less robust performance. A value of zero can be specified, in which case the smallest allowable value will be used. The bufferFrames parameter is passed as a pointer and the actual value used by the stream is set during the device setup procedure. bufferFrames values should be a power of two. Optimal and allowable buffer values tend to vary between systems and devices. Stream latency can also be controlled via the optional RtAudio::StreamOptions member numberOfBuffers (not used in the example above), though this tends to be more system dependent. In particular, the numberOfBuffers parameter is ignored when using the OS-X Core Audio, Jack, and the Windows ASIO APIs.

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

    -The RtAudioCallback parameter above is a pointer to a user-defined function that will be called whenever the audio system is ready for new output data or has new input data to be read. Further details on the use of a callback function are provided in the next section.

    -Several stream options are available to fine-tune the behavior of an audio stream. In the example above, we specify that data will be written by the user in a non-interleaved format via the RtAudio::StreamOptions member flags. That is, all bufferFrames of the first channel should be written consecutively, followed by all bufferFrames of the second channel. By default (when no option is specified), RtAudio expects data to be written in an interleaved format.

    +

    The RtAudio::openStream() function attempts to open a stream with a specified set of parameter values. In the above example, we attempt to open a two channel playback stream using the default output device, 32-bit floating point data, a sample rate of 44100 Hz, and a frame rate of 256 sample frames per output buffer. If the user specifies an invalid parameter value (such as a device id greater than or equal to the number of enumerated devices), an RtError is thrown of type = INVALID_USE. If a system error occurs or the device does not support the specified parameter values, an RtError of type = SYSTEM_ERROR is thrown. In either case, a descriptive error message is bundled with the exception and can be queried with the RtError::getMessage() or RtError::what() functions.

    +

    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 bufferFrames parameter specifies the desired number of sample frames that will be written to and/or read from a device per write/read operation. This parameter can be used to control stream latency though there is no guarantee that the passed value will be that used by a device. In general, a lower bufferFrames value will produce less latency but perhaps less robust performance. A value of zero can be specified, in which case the smallest allowable value will be used. The bufferFrames parameter is passed as a pointer and the actual value used by the stream is set during the device setup procedure. bufferFrames values should be a power of two. Optimal and allowable buffer values tend to vary between systems and devices. Stream latency can also be controlled via the optional RtAudio::StreamOptions member numberOfBuffers (not used in the example above), though this tends to be more system dependent. In particular, the numberOfBuffers parameter is ignored when using the OS-X Core Audio, Jack, and the Windows ASIO APIs.

    +

    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.

    +

    The RtAudioCallback parameter above is a pointer to a user-defined function that will be called whenever the audio system is ready for new output data or has new input data to be read. Further details on the use of a callback function are provided in the next section.

    +

    Several stream options are available to fine-tune the behavior of an audio stream. In the example above, we specify that data will be written by the user in a non-interleaved format via the RtAudio::StreamOptions member flags. That is, all bufferFrames of the first channel should be written consecutively, followed by all bufferFrames of the second channel. By default (when no option is specified), RtAudio expects data to be written in an interleaved format.

    +
    - +
    ©2001-2009 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    ©2001-2010 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    diff --git a/doc/html/structRtAudio_1_1DeviceInfo-members.html b/doc/html/structRtAudio_1_1DeviceInfo-members.html index a8bfa72..3fef735 100644 --- a/doc/html/structRtAudio_1_1DeviceInfo-members.html +++ b/doc/html/structRtAudio_1_1DeviceInfo-members.html @@ -8,23 +8,23 @@
    Home   Class/Enum List   File List   Compound Members  

    - +
    -

    RtAudio::RtAudio::DeviceInfo Member List

    This is the complete list of members for RtAudio::RtAudio::DeviceInfo, including all inherited members.

    - - - - - - - - - +

    RtAudio::DeviceInfo Member List

    This is the complete list of members for RtAudio::DeviceInfo, including all inherited members.
    duplexChannelsRtAudio::RtAudio::DeviceInfo
    inputChannelsRtAudio::RtAudio::DeviceInfo
    isDefaultInputRtAudio::RtAudio::DeviceInfo
    isDefaultOutputRtAudio::RtAudio::DeviceInfo
    nameRtAudio::RtAudio::DeviceInfo
    nativeFormatsRtAudio::RtAudio::DeviceInfo
    outputChannelsRtAudio::RtAudio::DeviceInfo
    probedRtAudio::RtAudio::DeviceInfo
    sampleRatesRtAudio::RtAudio::DeviceInfo
    + + + + + + + + +
    duplexChannelsRtAudio::DeviceInfo
    inputChannelsRtAudio::DeviceInfo
    isDefaultInputRtAudio::DeviceInfo
    isDefaultOutputRtAudio::DeviceInfo
    nameRtAudio::DeviceInfo
    nativeFormatsRtAudio::DeviceInfo
    outputChannelsRtAudio::DeviceInfo
    probedRtAudio::DeviceInfo
    sampleRatesRtAudio::DeviceInfo


    - +
    ©2001-2009 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    ©2001-2010 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    diff --git a/doc/html/structRtAudio_1_1DeviceInfo.html b/doc/html/structRtAudio_1_1DeviceInfo.html index f32ae40..59feb30 100644 --- a/doc/html/structRtAudio_1_1DeviceInfo.html +++ b/doc/html/structRtAudio_1_1DeviceInfo.html @@ -8,183 +8,166 @@
    Home   Class/Enum List   File List   Compound Members  

    - +
    -

    RtAudio::RtAudio::DeviceInfo Struct Reference

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

    -#include <RtAudio.h> -

    - -

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

    RtAudio::DeviceInfo Struct Reference

    +

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

    + +

    #include <RtAudio.h>

    + +

    List of all members.

    +

    Public Attributes

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

    Public Attributes

    bool probed
    std::string name
    unsigned int outputChannels
    unsigned int inputChannels
    unsigned int duplexChannels
    bool isDefaultOutput
    bool isDefaultInput
    std::vector< unsigned int > sampleRates
    RtAudioFormat nativeFormats
    -


    Detailed Description

    -The public device information structure for returning queried values.

    Member Data Documentation

    - +

    Detailed Description

    +

    The public device information structure for returning queried values.

    +

    Member Data Documentation

    +
    - +
    bool RtAudio::RtAudio::DeviceInfo::probed bool RtAudio::DeviceInfo::probed
    +

    true if the device capabilities were successfully probed.

    -

    -true if the device capabilities were successfully probed.

    -

    - +

    +
    - +
    std::string RtAudio::RtAudio::DeviceInfo::name std::string RtAudio::DeviceInfo::name
    +

    Character string device identifier.

    -

    -Character string device identifier.

    -

    - + +

    - +
    unsigned int RtAudio::RtAudio::DeviceInfo::outputChannels unsigned int RtAudio::DeviceInfo::outputChannels
    +

    Maximum output channels supported by device.

    -

    -Maximum output channels supported by device.

    -

    - + +

    - +
    unsigned int RtAudio::RtAudio::DeviceInfo::inputChannels unsigned int RtAudio::DeviceInfo::inputChannels
    +

    Maximum input channels supported by device.

    -

    -Maximum input channels supported by device.

    -

    - + +

    - +
    unsigned int RtAudio::RtAudio::DeviceInfo::duplexChannels unsigned int RtAudio::DeviceInfo::duplexChannels
    +

    Maximum simultaneous input/output channels supported by device.

    -

    -Maximum simultaneous input/output channels supported by device.

    -

    - + +

    - +
    bool RtAudio::RtAudio::DeviceInfo::isDefaultOutput bool RtAudio::DeviceInfo::isDefaultOutput
    +

    true if this is the default output device.

    -

    -true if this is the default output device.

    -

    - + +

    - +
    bool RtAudio::RtAudio::DeviceInfo::isDefaultInput bool RtAudio::DeviceInfo::isDefaultInput
    +

    true if this is the default input device.

    -

    -true if this is the default input device.

    -

    - + +

    - +
    std::vector<unsigned int> RtAudio::RtAudio::DeviceInfo::sampleRates std::vector<unsigned int> RtAudio::DeviceInfo::sampleRates
    +

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

    -

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

    -

    - + +

    - +
    RtAudioFormat RtAudio::RtAudio::DeviceInfo::nativeFormats RtAudioFormat RtAudio::DeviceInfo::nativeFormats
    +

    Bit mask of supported data formats.

    -

    -Bit mask of supported data formats.

    -

    -


    The documentation for this struct was generated from the following file: + +
    The documentation for this struct was generated from the following file:
    - +
    ©2001-2009 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    ©2001-2010 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    diff --git a/doc/html/structRtAudio_1_1StreamOptions-members.html b/doc/html/structRtAudio_1_1StreamOptions-members.html index 56a03cd..f17637e 100644 --- a/doc/html/structRtAudio_1_1StreamOptions-members.html +++ b/doc/html/structRtAudio_1_1StreamOptions-members.html @@ -8,18 +8,18 @@
    Home   Class/Enum List   File List   Compound Members  

    - +
    -

    RtAudio::RtAudio::StreamOptions Member List

    This is the complete list of members for RtAudio::RtAudio::StreamOptions, including all inherited members.

    - - - - +

    RtAudio::StreamOptions Member List

    This is the complete list of members for RtAudio::StreamOptions, including all inherited members.
    flagsRtAudio::RtAudio::StreamOptions
    numberOfBuffersRtAudio::RtAudio::StreamOptions
    priorityRtAudio::RtAudio::StreamOptions
    streamNameRtAudio::RtAudio::StreamOptions
    + + + +
    flagsRtAudio::StreamOptions
    numberOfBuffersRtAudio::StreamOptions
    priorityRtAudio::StreamOptions
    streamNameRtAudio::StreamOptions


    - +
    ©2001-2009 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    ©2001-2010 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    diff --git a/doc/html/structRtAudio_1_1StreamOptions.html b/doc/html/structRtAudio_1_1StreamOptions.html index 47a09ca..336c876 100644 --- a/doc/html/structRtAudio_1_1StreamOptions.html +++ b/doc/html/structRtAudio_1_1StreamOptions.html @@ -8,109 +8,104 @@
    Home   Class/Enum List   File List   Compound Members  

    - +
    -

    RtAudio::RtAudio::StreamOptions Struct Reference

    The structure for specifying stream options. -More... -

    -#include <RtAudio.h> -

    +

    RtAudio::StreamOptions Struct Reference

    +

    The structure for specifying stream options. +More...

    -

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

    #include <RtAudio.h>

    +

    List of all members.

    +

    Public Attributes

    RtAudioStreamFlags flags
    unsigned int numberOfBuffers
    std::string streamName
    int priority
    + + + + +

    Public Attributes

    RtAudioStreamFlags flags
    unsigned int numberOfBuffers
    std::string streamName
    int priority
    -


    Detailed Description

    -The structure for specifying stream options. -

    -The following flags can be OR'ed together to allow a client to make changes to the default stream behavior:

    +


    Detailed Description

    +

    The structure for specifying stream options.

    +

    The following flags can be OR'ed together to allow a client to make changes to the default stream behavior:

    -

    -By default, RtAudio streams pass and receive audio data from the client in an interleaved format. By passing the RTAUDIO_NONINTERLEAVED flag to the openStream() function, audio data will instead be presented in non-interleaved buffers. In this case, each buffer argument in the RtAudioCallback function will point to a single array of data, with nFrames samples for each channel concatenated back-to-back. For example, the first sample of data for the second channel would be located at index nFrames (assuming the buffer pointer was recast to the correct data type for the stream).

    -Certain audio APIs offer a number of parameters that influence the I/O latency of a stream. By default, RtAudio will attempt to set these parameters internally for robust (glitch-free) performance (though some APIs, like Windows Direct Sound, make this difficult). By passing the RTAUDIO_MINIMIZE_LATENCY flag to the openStream() function, internal stream settings will be influenced in an attempt to minimize stream latency, though possibly at the expense of stream performance.

    -If the RTAUDIO_HOG_DEVICE flag is set, RtAudio will attempt to open the input and/or output stream device(s) for exclusive use. Note that this is not possible with all supported audio APIs.

    -If the RTAUDIO_SCHEDULE_REALTIME flag is set, RtAudio will attempt to select realtime scheduling (round-robin) for the callback thread. The priority parameter will only be used if the RTAUDIO_SCHEDULE_REALTIME flag is set. It defines the thread's realtime priority.

    -The numberOfBuffers parameter can be used to control stream latency in the Windows DirectSound, Linux OSS, and Linux Alsa APIs only. A value of two is usually the smallest allowed. Larger numbers can potentially result in more robust stream performance, though likely at the cost of stream latency. The value set by the user is replaced during execution of the RtAudio::openStream() function by the value actually used by the system.

    -The streamName parameter can be used to set the client name when using the Jack API. By default, the client name is set to RtApiJack. However, if you wish to create multiple instances of RtAudio with Jack, each instance must have a unique client name.


    Member Data Documentation

    - +
  • RTAUDIO_NONINTERLEAVED: Use non-interleaved buffers (default = interleaved).
  • +
  • RTAUDIO_MINIMIZE_LATENCY: Attempt to set stream parameters for lowest possible latency.
  • +
  • RTAUDIO_HOG_DEVICE: Attempt grab device for exclusive use.
  • +
  • RTAUDIO_SCHEDULE_REALTIME: Attempt to select realtime scheduling for callback thread.
  • + +

    By default, RtAudio streams pass and receive audio data from the client in an interleaved format. By passing the RTAUDIO_NONINTERLEAVED flag to the openStream() function, audio data will instead be presented in non-interleaved buffers. In this case, each buffer argument in the RtAudioCallback function will point to a single array of data, with nFrames samples for each channel concatenated back-to-back. For example, the first sample of data for the second channel would be located at index nFrames (assuming the buffer pointer was recast to the correct data type for the stream).

    +

    Certain audio APIs offer a number of parameters that influence the I/O latency of a stream. By default, RtAudio will attempt to set these parameters internally for robust (glitch-free) performance (though some APIs, like Windows Direct Sound, make this difficult). By passing the RTAUDIO_MINIMIZE_LATENCY flag to the openStream() function, internal stream settings will be influenced in an attempt to minimize stream latency, though possibly at the expense of stream performance.

    +

    If the RTAUDIO_HOG_DEVICE flag is set, RtAudio will attempt to open the input and/or output stream device(s) for exclusive use. Note that this is not possible with all supported audio APIs.

    +

    If the RTAUDIO_SCHEDULE_REALTIME flag is set, RtAudio will attempt to select realtime scheduling (round-robin) for the callback thread. The priority parameter will only be used if the RTAUDIO_SCHEDULE_REALTIME flag is set. It defines the thread's realtime priority.

    +

    The numberOfBuffers parameter can be used to control stream latency in the Windows DirectSound, Linux OSS, and Linux Alsa APIs only. A value of two is usually the smallest allowed. Larger numbers can potentially result in more robust stream performance, though likely at the cost of stream latency. The value set by the user is replaced during execution of the RtAudio::openStream() function by the value actually used by the system.

    +

    The streamName parameter can be used to set the client name when using the Jack API. By default, the client name is set to RtApiJack. However, if you wish to create multiple instances of RtAudio with Jack, each instance must have a unique client name.

    +

    Member Data Documentation

    +
    - +
    RtAudioStreamFlags RtAudio::RtAudio::StreamOptions::flags RtAudioStreamFlags RtAudio::StreamOptions::flags
    +

    A bit-mask of stream flags (RTAUDIO_NONINTERLEAVED, RTAUDIO_MINIMIZE_LATENCY, RTAUDIO_HOG_DEVICE).

    -

    -A bit-mask of stream flags (RTAUDIO_NONINTERLEAVED, RTAUDIO_MINIMIZE_LATENCY, RTAUDIO_HOG_DEVICE).

    -

    - +

    +
    - +
    unsigned int RtAudio::RtAudio::StreamOptions::numberOfBuffers unsigned int RtAudio::StreamOptions::numberOfBuffers
    +

    Number of stream buffers.

    -

    -Number of stream buffers.

    -

    - + +

    - +
    std::string RtAudio::RtAudio::StreamOptions::streamName std::string RtAudio::StreamOptions::streamName
    +

    A stream name (currently used only in Jack).

    -

    -A stream name (currently used only in Jack).

    -

    - + +

    - +
    int RtAudio::RtAudio::StreamOptions::priority int RtAudio::StreamOptions::priority
    +

    Scheduling priority of callback thread (only used with flag RTAUDIO_SCHEDULE_REALTIME).

    -

    -Scheduling priority of callback thread (only used with flag RTAUDIO_SCHEDULE_REALTIME).

    -

    -


    The documentation for this struct was generated from the following file: + +
    The documentation for this struct was generated from the following file:
    - +
    ©2001-2009 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    ©2001-2010 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    diff --git a/doc/html/structRtAudio_1_1StreamParameters-members.html b/doc/html/structRtAudio_1_1StreamParameters-members.html index ab67bfb..b0a7c2d 100644 --- a/doc/html/structRtAudio_1_1StreamParameters-members.html +++ b/doc/html/structRtAudio_1_1StreamParameters-members.html @@ -8,17 +8,17 @@
    Home   Class/Enum List   File List   Compound Members  

    - +
    -

    RtAudio::RtAudio::StreamParameters Member List

    This is the complete list of members for RtAudio::RtAudio::StreamParameters, including all inherited members.

    - - - +

    RtAudio::StreamParameters Member List

    This is the complete list of members for RtAudio::StreamParameters, including all inherited members.
    deviceIdRtAudio::RtAudio::StreamParameters
    firstChannelRtAudio::RtAudio::StreamParameters
    nChannelsRtAudio::RtAudio::StreamParameters
    + + +
    deviceIdRtAudio::StreamParameters
    firstChannelRtAudio::StreamParameters
    nChannelsRtAudio::StreamParameters


    - +
    ©2001-2009 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    ©2001-2010 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    diff --git a/doc/html/structRtAudio_1_1StreamParameters.html b/doc/html/structRtAudio_1_1StreamParameters.html index 71f2853..7498652 100644 --- a/doc/html/structRtAudio_1_1StreamParameters.html +++ b/doc/html/structRtAudio_1_1StreamParameters.html @@ -8,81 +8,76 @@
    Home   Class/Enum List   File List   Compound Members  

    - +
    -

    RtAudio::RtAudio::StreamParameters Struct Reference

    The structure for specifying input or ouput stream parameters. -More... -

    -#include <RtAudio.h> -

    +

    RtAudio::StreamParameters Struct Reference

    +

    The structure for specifying input or ouput stream parameters. +More...

    -

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

    #include <RtAudio.h>

    +

    List of all members.

    +

    Public Attributes

    unsigned int deviceId
    unsigned int nChannels
    unsigned int firstChannel
    + + + +

    Public Attributes

    unsigned int deviceId
    unsigned int nChannels
    unsigned int firstChannel
    -


    Detailed Description

    -The structure for specifying input or ouput stream parameters.

    Member Data Documentation

    - +

    Detailed Description

    +

    The structure for specifying input or ouput stream parameters.

    +

    Member Data Documentation

    +
    - +
    unsigned int RtAudio::RtAudio::StreamParameters::deviceId unsigned int RtAudio::StreamParameters::deviceId
    +

    Device index (0 to getDeviceCount() - 1).

    -

    -Device index (0 to getDeviceCount() - 1).

    -

    - +

    +
    - +
    unsigned int RtAudio::RtAudio::StreamParameters::nChannels unsigned int RtAudio::StreamParameters::nChannels
    +

    Number of channels.

    -

    -Number of channels.

    -

    - + +

    - +
    unsigned int RtAudio::RtAudio::StreamParameters::firstChannel unsigned int RtAudio::StreamParameters::firstChannel
    +

    First channel index on device (default = 0).

    -

    -First channel index on device (default = 0).

    -

    -


    The documentation for this struct was generated from the following file: + +
    The documentation for this struct was generated from the following file:
    - +
    ©2001-2009 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    ©2001-2010 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    diff --git a/doc/html/tabs.css b/doc/html/tabs.css index ab02c62..a444163 100644 --- a/doc/html/tabs.css +++ b/doc/html/tabs.css @@ -57,7 +57,7 @@ DIV.tabs SPAN white-space : nowrap; } -DIV.tabs INPUT +DIV.tabs #MSearchBox { float : right; display : inline; -- cgit v1.2.3