1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-01-12 07:35:51 +01:00

remove the obsolete and probably undistributable rtaudio source, not usable since 2007

This commit is contained in:
RichardAsh1981@gmail.com
2013-07-09 19:12:40 +00:00
parent 4fb4a9b08b
commit 41be5788cb
69 changed files with 0 additions and 25642 deletions

View File

@@ -148,12 +148,6 @@ portmixer-recursive:
libportmixer.a: portmixer-recursive
ln -sf portmixer/libportmixer.a libportmixer.a
# RTAudio not supported 23/08/2007 R.A.
# librtaudio-recursive:
# $(MAKE) -C rtaudio
#rtaudio/librtaudio.a: librtaudio-recursive
# ln -sf rtaudio/librtaudio.a .
# Utility rules
clean:
-$(MAKE) -C portsmf clean

View File

@@ -226,12 +226,6 @@ Version in Audacity SVN: 1.0.8
Patches:
audacity_build_tweaks.patch Patches the configure scripts to turn off parsers, storage models and query languages not used by Audacity as well as using Expat instead of libxml2 for XML parsing. No need to integrate with upstream.
rtaudio
-------
http://www.music.mcgill.ca/~gary/rtaudio/
Another cross-platform audio I/O library that was at one point available as an
alternative to portaudio.
sbsms
-----
http://sbsms.sourceforge.net/

View File

@@ -1,43 +0,0 @@
### RtAudio library Makefile
RM = /bin/rm
OBJECTS = RtAudio.o
LIBRARY = librtaudio.a
CC = @CXX@
AR = @AR@
RANLIB = @RANLIB@
DEFS = @debug@
DEFS += @audio_apis@
CFLAGS = @cflags@
CFLAGS += @warn@
all : $(LIBRARY)
tests:
cd tests && $(MAKE) all
$(LIBRARY): $(OBJECTS)
$(AR) ruv $(LIBRARY) $(OBJECTS)
ranlib $(LIBRARY)
%.o : %.cpp
$(CC) $(CFLAGS) $(DEFS) -c $(<) -o $@
clean :
-rm -f $(LIBRARY)
-rm -f $(OBJECTS)
-rm -f *~
cd tests && $(MAKE) clean
distclean: clean
-rm -rf config.log autom4te.cache Makefile rtaudio-config
cd tests && $(MAKE) distclean
strip :
strip $(LIBRARY)
ranlib $(LIBRARY)
cd tests && $(MAKE) strip

File diff suppressed because it is too large Load Diff

View File

@@ -1,752 +0,0 @@
/************************************************************************/
/*! \class RtAudio
\brief Realtime audio i/o C++ classes.
RtAudio provides a common API (Application Programming Interface)
for realtime audio input/output across Linux (native ALSA, Jack,
and OSS), SGI, Macintosh OS X (CoreAudio), and Windows
(DirectSound and ASIO) operating systems.
RtAudio WWW site: http://music.mcgill.ca/~gary/rtaudio/
RtAudio: a realtime audio i/o C++ class
Copyright (c) 2001-2004 Gary P. Scavone
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
Any person wishing to distribute modifications to the Software is
requested to send the modifications to the original developer so that
they can be incorporated into the canonical version.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/************************************************************************/
// RtAudio: Version 3.0.1, 22 March 2004
#ifndef __RTAUDIO_H
#define __RTAUDIO_H
#include "RtError.h"
#include <string>
#include <vector>
// Operating system dependent thread functionality.
#if defined(__WINDOWS_DS__) || defined(__WINDOWS_ASIO__)
#include <windows.h>
#include <process.h>
typedef unsigned long ThreadHandle;
typedef CRITICAL_SECTION StreamMutex;
#else // Various unix flavors with pthread support.
#include <pthread.h>
typedef pthread_t ThreadHandle;
typedef pthread_mutex_t StreamMutex;
#endif
#if defined(LINUX_ALSA) || defined(LINUX_OSS) || defined(LINUX_JACK) || defined(MACOSX_CORE)
#include <sys/time.h>
#define HAVE_GETTIMEOFDAY 1
#endif
// This global structure type is used to pass callback information
// between the private RtAudio stream structure and global callback
// handling functions.
struct CallbackInfo {
void *object; // Used as a "this" pointer.
ThreadHandle thread;
bool usingCallback;
void *callback;
void *userData;
void *apiInfo; // void pointer for API specific callback information
// Default constructor.
CallbackInfo()
:object(0), usingCallback(false), callback(0),
userData(0), apiInfo(0) {}
};
// Support for signed integers and floats. Audio data fed to/from
// the tickStream() routine 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.
typedef unsigned long RtAudioFormat;
static const RtAudioFormat RTAUDIO_SINT8 = 0x1; /*!< 8-bit signed integer. */
static const RtAudioFormat RTAUDIO_SINT16 = 0x2; /*!< 16-bit signed integer. */
static const RtAudioFormat RTAUDIO_SINT24 = 0x4; /*!< Upper 3 bytes of 32-bit signed integer. */
static const RtAudioFormat RTAUDIO_SINT32 = 0x8; /*!< 32-bit signed integer. */
static const RtAudioFormat RTAUDIO_FLOAT32 = 0x10; /*!< Normalized between plus/minus 1.0. */
static const RtAudioFormat RTAUDIO_FLOAT64 = 0x20; /*!< Normalized between plus/minus 1.0. */
typedef int (*RtAudioCallback)(char *buffer, int bufferSize, void *userData);
//! The public device information structure for returning queried values.
struct RtAudioDeviceInfo {
std::string name; /*!< Character string device identifier. */
bool probed; /*!< true if the device capabilities were successfully probed. */
int outputChannels; /*!< Maximum output channels supported by device. */
int inputChannels; /*!< Maximum input channels supported by device. */
int duplexChannels; /*!< Maximum simultaneous input/output channels supported by device. */
bool isDefault; /*!< true if this is the default output or input device. */
std::vector<int> sampleRates; /*!< Supported sample rates (queried from list of standard rates). */
RtAudioFormat nativeFormats; /*!< Bit mask of supported data formats. */
// Default constructor.
RtAudioDeviceInfo()
:probed(false), outputChannels(0), inputChannels(0),
duplexChannels(0), isDefault(false), nativeFormats(0) {}
};
// **************************************************************** //
//
// RtApi class declaration.
//
// Note that RtApi is an abstract base class and cannot be
// explicitly instantiated. The class RtAudio will create an
// instance of an RtApi subclass (RtApiOss, RtApiAlsa,
// RtApiJack, RtApiCore, RtApiAl, RtApiDs, or RtApiAsio).
//
// **************************************************************** //
class RtApi
{
public:
RtApi();
virtual ~RtApi();
void openStream( int outputDevice, int outputChannels,
int inputDevice, int inputChannels,
RtAudioFormat format, int sampleRate,
int *bufferSize, int numberOfBuffers );
virtual void setStreamCallback( RtAudioCallback callback, void *userData ) = 0;
virtual void cancelStreamCallback() = 0;
int getDeviceCount(void);
RtAudioDeviceInfo getDeviceInfo( int device );
char * const getStreamBuffer();
virtual void tickStream();
virtual void closeStream();
virtual void startStream() = 0;
virtual void stopStream() = 0;
virtual void abortStream() = 0;
virtual bool isStreamRunning();
virtual double getStreamTime();
protected:
static const unsigned int MAX_SAMPLE_RATES;
static const unsigned int SAMPLE_RATES[];
enum { FAILURE, SUCCESS };
enum StreamMode {
OUTPUT,
INPUT,
DUPLEX,
UNINITIALIZED = -75
};
enum StreamState {
STREAM_STOPPED,
STREAM_RUNNING
};
// A protected structure for audio streams.
struct RtApiStream {
int device[2]; // Playback and record, respectively.
void *apiHandle; // void pointer for API specific stream handle information
StreamMode mode; // OUTPUT, INPUT, or DUPLEX.
StreamState state; // STOPPED or RUNNING
char *userBuffer;
char *deviceBuffer;
bool doConvertBuffer[2]; // Playback and record, respectively.
bool deInterleave[2]; // Playback and record, respectively.
bool doByteSwap[2]; // Playback and record, respectively.
int sampleRate;
int bufferSize;
int nBuffers;
int nUserChannels[2]; // Playback and record, respectively.
int nDeviceChannels[2]; // Playback and record channels, respectively.
RtAudioFormat userFormat;
RtAudioFormat deviceFormat[2]; // Playback and record, respectively.
StreamMutex mutex;
CallbackInfo callbackInfo;
double streamTime; // Number of elapsed seconds since the
// stream started
#if defined(HAVE_GETTIMEOFDAY)
struct timeval lastTickTimestamp;
#endif
RtApiStream()
:apiHandle(0), userBuffer(0), deviceBuffer(0) {}
// mode(UNINITIALIZED), state(STREAM_STOPPED),
};
// A protected device structure for audio devices.
struct RtApiDevice {
std::string name; /*!< Character string device identifier. */
bool probed; /*!< true if the device capabilities were successfully probed. */
void *apiDeviceId; // void pointer for API specific device information
int maxOutputChannels; /*!< Maximum output channels supported by device. */
int maxInputChannels; /*!< Maximum input channels supported by device. */
int maxDuplexChannels; /*!< Maximum simultaneous input/output channels supported by device. */
int minOutputChannels; /*!< Minimum output channels supported by device. */
int minInputChannels; /*!< Minimum input channels supported by device. */
int minDuplexChannels; /*!< Minimum simultaneous input/output channels supported by device. */
bool hasDuplexSupport; /*!< true if device supports duplex mode. */
bool isDefault; /*!< true if this is the default output or input device. */
std::vector<int> sampleRates; /*!< Supported sample rates. */
RtAudioFormat nativeFormats; /*!< Bit mask of supported data formats. */
// Default constructor.
RtApiDevice()
:probed(false), apiDeviceId(0), maxOutputChannels(0), maxInputChannels(0),
maxDuplexChannels(0), minOutputChannels(0), minInputChannels(0),
minDuplexChannels(0), isDefault(false), nativeFormats(0) {}
};
typedef signed short Int16;
typedef signed int Int32;
typedef float Float32;
typedef double Float64;
char message_[256];
int nDevices_;
std::vector<RtApiDevice> devices_;
RtApiStream stream_;
/*!
Protected, api-specific method to count and identify the system
audio devices. This function MUST be implemented by all subclasses.
*/
virtual void initialize(void) = 0;
/*!
Protected, api-specific method which attempts to fill an
RtAudioDevice structure for a given device. This function MUST be
implemented by all subclasses. If an error is encountered during
the probe, a "warning" message is reported and the value of
"probed" remains false (no exception is thrown). A successful
probe is indicated by probed = true.
*/
virtual void probeDeviceInfo( RtApiDevice *info );
/*!
Protected, api-specific method which attempts to open a device
with the given parameters. This function MUST be implemented by
all subclasses. If an error is encountered during the probe, a
"warning" message is reported and FAILURE is returned (no
exception is thrown). A successful probe is indicated by a return
value of SUCCESS.
*/
virtual bool probeDeviceOpen( int device, StreamMode mode, int channels,
int sampleRate, RtAudioFormat format,
int *bufferSize, int numberOfBuffers );
/*!
Protected method which returns the index in the devices array to
the default input device.
*/
virtual int getDefaultInputDevice(void);
/*!
Protected method which returns the index in the devices array to
the default output device.
*/
virtual int getDefaultOutputDevice(void);
//! Protected common method to clear an RtApiDevice structure.
void clearDeviceInfo( RtApiDevice *info );
//! Protected common method to clear an RtApiStream structure.
void clearStreamInfo();
//! Protected common error method to allow global control over error handling.
void error( RtError::Type type );
/*!
Protected common method used to check whether a stream is open.
If not, an "invalid identifier" exception is thrown.
*/
void verifyStream();
/*!
Protected method used to perform format, channel number, and/or interleaving
conversions between the user and device buffers.
*/
void convertStreamBuffer( StreamMode mode );
//! Protected common method used to perform byte-swapping on buffers.
void byteSwapBuffer( char *buffer, int samples, RtAudioFormat format );
//! Protected common method which returns the number of bytes for a given format.
int formatBytes( RtAudioFormat format );
};
// **************************************************************** //
//
// RtAudio class declaration.
//
// RtAudio is a "controller" used to select an available audio i/o
// interface. It presents a common API for the user to call but all
// functionality is implemented by the class RtAudioApi and its
// subclasses. RtAudio creates an instance of an RtAudioApi subclass
// based on the user's API choice. If no choice is made, RtAudio
// attempts to make a "logical" API selection.
//
// **************************************************************** //
class RtAudio
{
public:
//! Audio API specifier arguments.
enum RtAudioApi {
UNSPECIFIED, /*!< Search for a working compiled API. */
LINUX_ALSA, /*!< The Advanced Linux Sound Architecture API. */
LINUX_OSS, /*!< The Linux Open Sound System API. */
LINUX_JACK, /*!< The Linux Jack Low-Latency Audio Server API. */
MACOSX_CORE, /*!< Macintosh OS-X Core Audio API. */
IRIX_AL, /*!< The Irix Audio Library API. */
WINDOWS_ASIO, /*!< The Steinberg Audio Stream I/O API. */
WINDOWS_DS /*!< The Microsoft Direct Sound API. */
};
//! The default class constructor.
/*!
Probes the system to make sure at least one audio input/output
device is available and determines the api-specific identifier for
each device found. An RtError error can be thrown if no devices
are found or if a memory allocation error occurs.
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( RtAudioApi api=UNSPECIFIED );
//! A constructor which can be used to open a stream during instantiation.
/*!
The specified output and/or input device identifiers correspond
to those enumerated via the getDeviceInfo() method. If device =
0, the default or first available devices meeting the given
parameters is selected. If an output or input channel value is
zero, the corresponding device value is ignored. When a stream is
successfully opened, its identifier is returned via the "streamId"
pointer. An RtError can be thrown if no devices are found
for the given parameters, if a memory allocation error occurs, or
if a driver error occurs. \sa openStream()
*/
RtAudio( int outputDevice, int outputChannels,
int inputDevice, int inputChannels,
RtAudioFormat format, int sampleRate,
int *bufferSize, int numberOfBuffers, RtAudioApi api=UNSPECIFIED );
//! The destructor.
/*!
Stops and closes an open stream and devices and deallocates
buffer and structure memory.
*/
~RtAudio();
//! A public method for opening a stream with the specified parameters.
/*!
An RtError is thrown if a stream cannot be opened.
\param outputDevice: If equal to 0, the default or first device
found meeting the given parameters is opened. Otherwise, the
device number should correspond to one of those enumerated via
the getDeviceInfo() method.
\param outputChannels: The desired number of output channels. If
equal to zero, the outputDevice identifier is ignored.
\param inputDevice: If equal to 0, the default or first device
found meeting the given parameters is opened. Otherwise, the
device number should correspond to one of those enumerated via
the getDeviceInfo() method.
\param inputChannels: The desired number of input channels. If
equal to zero, the inputDevice identifier is ignored.
\param format: An RtAudioFormat specifying the desired sample data format.
\param sampleRate: The desired sample rate (sample frames per second).
\param *bufferSize: A pointer value indicating the desired internal buffer
size in sample frames. The actual value used by the device is
returned via the same pointer. A value of zero can be specified,
in which case the lowest allowable value is determined.
\param numberOfBuffers: A value which can be used to help control device
latency. More buffers typically result in more robust performance,
though at a cost of greater latency. A value of zero can be
specified, in which case the lowest allowable value is used.
*/
void openStream( int outputDevice, int outputChannels,
int inputDevice, int inputChannels,
RtAudioFormat format, int sampleRate,
int *bufferSize, int numberOfBuffers );
//! A public method which sets a user-defined callback function for a given stream.
/*!
This method assigns a callback function to a previously opened
stream for non-blocking stream functionality. A separate process
is initiated, though the user function is called only when the
stream is "running" (between calls to the startStream() and
stopStream() methods, respectively). The callback process remains
active for the duration of the stream and is automatically
shutdown when the stream is closed (via the closeStream() method
or by object destruction). The callback process can also be
shutdown and the user function de-referenced through an explicit
call to the cancelStreamCallback() method. Note that the stream
can use only blocking or callback functionality at a particular
time, though it is possible to alternate modes on the same stream
through the use of the setStreamCallback() and
cancelStreamCallback() methods (the blocking tickStream() method
can be used before a callback is set and/or after a callback is
cancelled). An RtError will be thrown if called when no stream is
open or a thread errors occurs.
*/
void setStreamCallback(RtAudioCallback callback, void *userData) { rtapi_->setStreamCallback( callback, userData ); };
//! A public method which cancels a callback process and function for the stream.
/*!
This method shuts down a callback process and de-references the
user function for the stream. Callback functionality can
subsequently be restarted on the stream via the
setStreamCallback() method. An RtError will be thrown if called
when no stream is open.
*/
void cancelStreamCallback() { rtapi_->cancelStreamCallback(); };
//! A public method which returns the number of audio devices found.
int getDeviceCount(void) { return rtapi_->getDeviceCount(); };
//! Return an RtAudioDeviceInfo structure for a specified device number.
/*!
Any device integer between 1 and getDeviceCount() is valid. If
a device is busy or otherwise unavailable, the structure member
"probed" will have a value of "false" and all other members are
undefined. If the specified device is the current default input
or output device, the "isDefault" member will have a value of
"true". An RtError will be thrown for an invalid device argument.
*/
RtAudioDeviceInfo getDeviceInfo(int device) { return rtapi_->getDeviceInfo( device ); };
//! A public method which returns a pointer to the buffer for an open stream.
/*!
The user should fill and/or read the buffer data in interleaved format
and then call the tickStream() method. An RtError will be
thrown if called when no stream is open.
*/
char * const getStreamBuffer() { return rtapi_->getStreamBuffer(); };
//! Public method used to trigger processing of input/output data for a stream.
/*!
This method blocks until all buffer data is read/written. An
RtError will be thrown if a driver error occurs or if called when
no stream is open.
*/
void tickStream() { rtapi_->tickStream(); };
//! Public method which closes a stream and frees any associated buffers.
/*!
If a stream is not open, this method issues a warning and
returns (an RtError is not thrown).
*/
void closeStream() { rtapi_->closeStream(); };
//! Public method which starts a stream.
/*!
An RtError will be thrown if a driver error occurs or if called
when no stream is open.
*/
void startStream() { rtapi_->startStream(); };
//! Stop a stream, allowing any samples remaining in the queue to be played out and/or read in.
/*!
An RtError will be thrown if a driver error occurs or if called
when no stream is open.
*/
void stopStream() { rtapi_->stopStream(); };
//! Stop a stream, discarding any samples remaining in the input/output queue.
/*!
An RtError will be thrown if a driver error occurs or if called
when no stream is open.
*/
void abortStream() { rtapi_->abortStream(); };
//! Returns true is the stream is running, and false if it is stopped.
/*!
An RtError will be thrown if a driver error occurs or if called
when no stream is open.
*/
bool isStreamRunning() { return rtapi_->isStreamRunning(); };
//! Returns the number of elapsed seconds since the stream was started.
/*!
An RtError will be thrown if a driver error occurs or if called
when no stream is open.
*/
double getStreamTime() { return rtapi_->getStreamTime(); };
protected:
void initialize( RtAudioApi api );
RtApi *rtapi_;
};
// RtApi Subclass prototypes.
#if defined(__LINUX_ALSA__)
class RtApiAlsa: public RtApi
{
public:
RtApiAlsa();
~RtApiAlsa();
void tickStream();
void closeStream();
void startStream();
void stopStream();
void abortStream();
int streamWillBlock();
void setStreamCallback( RtAudioCallback callback, void *userData );
void cancelStreamCallback();
private:
void initialize(void);
void probeDeviceInfo( RtApiDevice *info );
bool probeDeviceOpen( int device, StreamMode mode, int channels,
int sampleRate, RtAudioFormat format,
int *bufferSize, int numberOfBuffers );
};
#endif
#if defined(__LINUX_JACK__)
class RtApiJack: public RtApi
{
public:
RtApiJack();
~RtApiJack();
void tickStream();
void closeStream();
void startStream();
void stopStream();
void abortStream();
void setStreamCallback( RtAudioCallback callback, void *userData );
void cancelStreamCallback();
// This function is intended for internal use only. It must be
// public because it is called by the internal callback handler,
// which is not a member of RtAudio. External use of this function
// will most likely produce highly undesireable results!
void callbackEvent( unsigned long nframes );
private:
void initialize(void);
void probeDeviceInfo( RtApiDevice *info );
bool probeDeviceOpen( int device, StreamMode mode, int channels,
int sampleRate, RtAudioFormat format,
int *bufferSize, int numberOfBuffers );
};
#endif
#if defined(__LINUX_OSS__)
class RtApiOss: public RtApi
{
public:
RtApiOss();
~RtApiOss();
void tickStream();
void closeStream();
void startStream();
void stopStream();
void abortStream();
int streamWillBlock();
void setStreamCallback( RtAudioCallback callback, void *userData );
void cancelStreamCallback();
private:
void initialize(void);
void probeDeviceInfo( RtApiDevice *info );
bool probeDeviceOpen( int device, StreamMode mode, int channels,
int sampleRate, RtAudioFormat format,
int *bufferSize, int numberOfBuffers );
};
#endif
#if defined(__MACOSX_CORE__)
#include <CoreAudio/AudioHardware.h>
class RtApiCore: public RtApi
{
public:
RtApiCore();
~RtApiCore();
int getDefaultOutputDevice(void);
int getDefaultInputDevice(void);
void tickStream();
void closeStream();
void startStream();
void stopStream();
void abortStream();
void setStreamCallback( RtAudioCallback callback, void *userData );
void cancelStreamCallback();
// This function is intended for internal use only. It must be
// public because it is called by the internal callback handler,
// which is not a member of RtAudio. External use of this function
// will most likely produce highly undesireable results!
void callbackEvent( AudioDeviceID deviceId, void *inData, void *outData );
private:
void initialize(void);
void probeDeviceInfo( RtApiDevice *info );
bool probeDeviceOpen( int device, StreamMode mode, int channels,
int sampleRate, RtAudioFormat format,
int *bufferSize, int numberOfBuffers );
};
#endif
#if defined(__WINDOWS_DS__)
class RtApiDs: public RtApi
{
public:
RtApiDs();
~RtApiDs();
int getDefaultOutputDevice(void);
int getDefaultInputDevice(void);
void tickStream();
void closeStream();
void startStream();
void stopStream();
void abortStream();
int streamWillBlock();
void setStreamCallback( RtAudioCallback callback, void *userData );
void cancelStreamCallback();
private:
void initialize(void);
void probeDeviceInfo( RtApiDevice *info );
bool probeDeviceOpen( int device, StreamMode mode, int channels,
int sampleRate, RtAudioFormat format,
int *bufferSize, int numberOfBuffers );
};
#endif
#if defined(__WINDOWS_ASIO__)
class RtApiAsio: public RtApi
{
public:
RtApiAsio();
~RtApiAsio();
void tickStream();
void closeStream();
void startStream();
void stopStream();
void abortStream();
void setStreamCallback( RtAudioCallback callback, void *userData );
void cancelStreamCallback();
// This function is intended for internal use only. It must be
// public because it is called by the internal callback handler,
// which is not a member of RtAudio. External use of this function
// will most likely produce highly undesireable results!
void callbackEvent( long bufferIndex );
private:
void initialize(void);
void probeDeviceInfo( RtApiDevice *info );
bool probeDeviceOpen( int device, StreamMode mode, int channels,
int sampleRate, RtAudioFormat format,
int *bufferSize, int numberOfBuffers );
};
#endif
#if defined(__IRIX_AL__)
class RtApiAl: public RtApi
{
public:
RtApiAl();
~RtApiAl();
int getDefaultOutputDevice(void);
int getDefaultInputDevice(void);
void tickStream();
void closeStream();
void startStream();
void stopStream();
void abortStream();
int streamWillBlock();
void setStreamCallback( RtAudioCallback callback, void *userData );
void cancelStreamCallback();
private:
void initialize(void);
void probeDeviceInfo( RtApiDevice *info );
bool probeDeviceOpen( int device, StreamMode mode, int channels,
int sampleRate, RtAudioFormat format,
int *bufferSize, int numberOfBuffers );
};
#endif
// Define the following flag to have extra information spewed to stderr.
//#define __RTAUDIO_DEBUG__
#endif
// Indentation settings for Vim and Emacs
//
// Local Variables:
// c-basic-offset: 2
// indent-tabs-mode: nil
// End:
//
// vim: et sts=2 sw=2

View File

@@ -1,60 +0,0 @@
/************************************************************************/
/*! \class RtError
\brief 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.
*/
/************************************************************************/
#ifndef RTERROR_H
#define RTERROR_H
#include <iostream>
#include <string>
class RtError
{
public:
//! Defined RtError types.
enum Type {
WARNING, /*!< A non-critical error. */
DEBUG_WARNING, /*!< A non-critical error which might be useful for debugging. */
UNSPECIFIED, /*!< The default, unspecified error type. */
NO_DEVICES_FOUND, /*!< No devices found on system. */
INVALID_DEVICE, /*!< An invalid device ID was specified. */
INVALID_STREAM, /*!< An invalid stream ID was specified. */
MEMORY_ERROR, /*!< An error occured during memory allocation. */
INVALID_PARAMETER, /*!< An invalid parameter was specified to a function. */
DRIVER_ERROR, /*!< A system driver error occured. */
SYSTEM_ERROR, /*!< A system error occured. */
THREAD_ERROR /*!< A thread error occured. */
};
protected:
std::string message_;
Type type_;
public:
//! The constructor.
RtError(const std::string& message, Type type = RtError::UNSPECIFIED) : message_(message), type_(type){}
//! The destructor.
virtual ~RtError(void) {};
//! Prints thrown error message to stderr.
virtual void printMessage(void) { std::cerr << '\n' << message_ << "\n\n"; }
//! Returns the thrown error message type.
virtual const Type& getType(void) { return type_; }
//! Returns the thrown error message string.
virtual const std::string& getMessage(void) { return message_; }
//! Returns the thrown error message as a C string.
virtual const char *getMessageString(void) { return message_.c_str(); }
};
#endif

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,102 +0,0 @@
# Process this file with autoconf to produce a configure script.
AC_INIT(RtAudio, 3.0, gary@ccrma.stanford.edu, rtaudio)
AC_CONFIG_SRCDIR(RtAudio.cpp)
AC_CONFIG_FILES([rtaudio-config Makefile tests/Makefile])
# Fill GXX with something before test.
AC_SUBST( GXX, ["no"] )
# Checks for programs.
AC_PROG_CC
AC_PROG_CXX(g++ CC c++ cxx)
AC_PROG_RANLIB
AC_PATH_PROG(AR, ar, no)
if [[ $AR = "no" ]] ; then
AC_MSG_ERROR("Could not find ar - needed to create a library");
fi
# Checks for libraries.
AC_CHECK_LIB(pthread, pthread_create, , AC_MSG_ERROR(RtAudio requires the pthread library!))
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(sys/ioctl.h unistd.h)
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
# Check for debug
AC_MSG_CHECKING(whether to compile debug version)
AC_ARG_ENABLE(debug,
[ --enable-debug = enable various debug output],
[AC_SUBST( debug, [-D__RTAUDIO_DEBUG__] ) AC_SUBST( cflags, [-g] ) AC_SUBST( object_path, [Debug] ) AC_MSG_RESULT(yes)],
[AC_SUBST( debug, [] ) AC_SUBST( cflags, [-O2] ) AC_SUBST( object_path, [Release] ) AC_MSG_RESULT(no)])
# Check compiler and use -Wall if gnu.
if [test $GXX = "yes" ;] then
AC_SUBST( warn, [-Wall] )
fi
# Checks for package options and external software
AC_CANONICAL_HOST
AC_MSG_CHECKING(for audio API)
case $host in
*-*-linux*)
AC_SUBST( sound_api, [_NO_API_] )
AC_ARG_WITH(jack, [ --with-jack = choose JACK server support (linux only)], [AC_SUBST( sound_api, [-D__LINUX_JACK__] ) AC_MSG_RESULT(using JACK)], )
if [test $sound_api = -D__LINUX_JACK__;] then
TEMP_LIBS=$LIBS
AC_CHECK_LIB(jack, jack_client_new, , AC_MSG_ERROR(JACK support requires the jack library!))
AC_CHECK_LIB(asound, snd_pcm_open, , AC_MSG_ERROR(Jack support also requires the asound library!))
LIBS="`pkg-config --cflags --libs jack` $TEMP_LIBS -lasound"
audio_apis="-D__LINUX_JACK__"
fi
# Look for Alsa flag
AC_ARG_WITH(alsa, [ --with-alsa = choose native ALSA API support (linux only)], [AC_SUBST( sound_api, [-D__LINUX_ALSA__] ) AC_MSG_RESULT(using ALSA)], )
if [test $sound_api = -D__LINUX_ALSA__;] then
AC_CHECK_LIB(asound, snd_pcm_open, , AC_MSG_ERROR(ALSA support requires the asound library!))
audio_apis="-D__LINUX_ALSA__ $audio_apis"
fi
# Look for OSS flag
AC_ARG_WITH(oss, [ --with-oss = choose OSS API support (linux only)], [AC_SUBST( sound_api, [-D__LINUX_OSS__] ) AC_MSG_RESULT(using OSS)], )
if test $sound_api = -D__LINUX_OSS__; then
audio_apis="-D__LINUX_OSS__ $audio_apis"
fi
# If no audio api flags specified, use OSS
if [test $sound_api = _NO_API_;] then
AC_SUBST( sound_api, [-D__LINUX_OSS__] )
AC_MSG_RESULT(using OSS)
AC_SUBST( audio_apis, [-D__LINUX_OSS__] )
fi
;;
*-sgi*)
AC_SUBST( audio_apis, ["-D__IRIX_AL__ -LANG:std -w"] )
AC_MSG_RESULT(using IRIX AL)
AC_CHECK_LIB(audio, alOpenPort, , AC_MSG_ERROR(IRIX audio support requires the audio library!) )
;;
*-apple*)
# Check for CoreAudio framework
AC_CHECK_HEADER(CoreAudio/CoreAudio.h,
[AC_SUBST( audio_apis, [-D__MACOSX_CORE__] )],
[AC_MSG_ERROR(CoreAudio header files not found!)] )
AC_SUBST( frameworks, ["-framework CoreAudio"] )
AC_CHECK_LIB(stdc++, printf, , AC_MSG_ERROR(RtAudio requires the C++ library!) )
;;
*)
# Default case for unknown realtime systems.
AC_MSG_ERROR(Unknown system type for realtime support!)
;;
esac
# Checks for library functions.
AC_PROG_GCC_TRADITIONAL
AC_OUTPUT
chmod oug+x rtaudio-config

View File

@@ -1,155 +0,0 @@
# Doxyfile 1.2.6
#---------------------------------------------------------------------------
# General configuration options
#---------------------------------------------------------------------------
PROJECT_NAME = RtAudio
PROJECT_NUMBER =
OUTPUT_DIRECTORY = .
OUTPUT_LANGUAGE = English
EXTRACT_ALL = NO
EXTRACT_PRIVATE = NO
EXTRACT_STATIC = NO
HIDE_UNDOC_MEMBERS = YES
HIDE_UNDOC_CLASSES = NO
BRIEF_MEMBER_DESC = YES
REPEAT_BRIEF = YES
ALWAYS_DETAILED_SEC = NO
FULL_PATH_NAMES = NO
STRIP_FROM_PATH =
INTERNAL_DOCS = NO
CLASS_DIAGRAMS = YES
SOURCE_BROWSER = NO
INLINE_SOURCES = NO
STRIP_CODE_COMMENTS = YES
CASE_SENSE_NAMES = YES
HIDE_SCOPE_NAMES = NO
VERBATIM_HEADERS = YES
SHOW_INCLUDE_FILES = YES
JAVADOC_AUTOBRIEF = NO
INHERIT_DOCS = YES
INLINE_INFO = YES
SORT_MEMBER_DOCS = NO
DISTRIBUTE_GROUP_DOC = NO
TAB_SIZE = 8
ENABLED_SECTIONS =
GENERATE_TODOLIST = YES
GENERATE_TESTLIST = YES
GENERATE_BUGLIST = YES
ALIASES =
MAX_INITIALIZER_LINES = 30
OPTIMIZE_OUTPUT_FOR_C = NO
SHOW_USED_FILES = YES
#---------------------------------------------------------------------------
# configuration options related to warning and progress messages
#---------------------------------------------------------------------------
QUIET = NO
WARNINGS = YES
WARN_IF_UNDOCUMENTED = YES
WARN_FORMAT = "$file:$line: $text"
WARN_LOGFILE =
#---------------------------------------------------------------------------
# configuration options related to the input files
#---------------------------------------------------------------------------
INPUT = tutorial.txt ../../RtAudio.h ../../RtError.h
FILE_PATTERNS =
RECURSIVE = NO
EXCLUDE =
EXCLUDE_PATTERNS =
EXAMPLE_PATH =
EXAMPLE_PATTERNS =
IMAGE_PATH =
INPUT_FILTER =
FILTER_SOURCE_FILES = NO
#---------------------------------------------------------------------------
# configuration options related to the alphabetical class index
#---------------------------------------------------------------------------
ALPHABETICAL_INDEX = NO
COLS_IN_ALPHA_INDEX = 5
IGNORE_PREFIX =
#---------------------------------------------------------------------------
# configuration options related to the HTML output
#---------------------------------------------------------------------------
GENERATE_HTML = YES
HTML_OUTPUT = ../html
HTML_HEADER = header.html
HTML_FOOTER = footer.html
HTML_STYLESHEET =
HTML_ALIGN_MEMBERS = YES
GENERATE_HTMLHELP = NO
GENERATE_CHI = NO
BINARY_TOC = NO
TOC_EXPAND = NO
DISABLE_INDEX = YES
ENUM_VALUES_PER_LINE = 4
GENERATE_TREEVIEW = NO
TREEVIEW_WIDTH = 250
#---------------------------------------------------------------------------
# configuration options related to the LaTeX output
#---------------------------------------------------------------------------
GENERATE_LATEX = NO
LATEX_OUTPUT = latex
COMPACT_LATEX = NO
PAPER_TYPE = letter
EXTRA_PACKAGES =
LATEX_HEADER =
PDF_HYPERLINKS = NO
USE_PDFLATEX = YES
LATEX_BATCHMODE = NO
#---------------------------------------------------------------------------
# configuration options related to the RTF output
#---------------------------------------------------------------------------
GENERATE_RTF = NO
RTF_OUTPUT = rtf
COMPACT_RTF = NO
RTF_HYPERLINKS = NO
RTF_STYLESHEET_FILE =
#---------------------------------------------------------------------------
# configuration options related to the man page output
#---------------------------------------------------------------------------
GENERATE_MAN = NO
MAN_OUTPUT = man
MAN_EXTENSION = .3
#---------------------------------------------------------------------------
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = NO
EXPAND_ONLY_PREDEF = NO
SEARCH_INCLUDES = YES
INCLUDE_PATH =
INCLUDE_FILE_PATTERNS =
PREDEFINED =
EXPAND_AS_DEFINED =
#---------------------------------------------------------------------------
# Configuration::addtions related to external references
#---------------------------------------------------------------------------
TAGFILES =
GENERATE_TAGFILE =
ALLEXTERNALS = NO
PERL_PATH = /usr/bin/perl
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
HAVE_DOT = NO
CLASS_GRAPH = YES
COLLABORATION_GRAPH = YES
INCLUDE_GRAPH = YES
INCLUDED_BY_GRAPH = YES
GRAPHICAL_HIERARCHY = YES
DOT_PATH =
MAX_DOT_GRAPH_WIDTH = 1024
MAX_DOT_GRAPH_HEIGHT = 1024
GENERATE_LEGEND = YES
DOT_CLEANUP = YES
#---------------------------------------------------------------------------
# Configuration::addtions related to the search engine
#---------------------------------------------------------------------------
SEARCHENGINE = NO
CGI_NAME = search.cgi
CGI_URL =
DOC_URL =
DOC_ABSPATH =
BIN_ABSPATH = /usr/local/bin/
EXT_DOC_PATHS =

View File

@@ -1,9 +0,0 @@
<HR>
<table><tr><td><img src="../images/mcgill.gif" width=165></td>
<td>&copy;2001-2004 Gary P. Scavone, McGill University. All Rights Reserved.<br>
Maintained by Gary P. Scavone, <a href="mailto:gary@music.mcgill.ca">gary@music.mcgill.ca</a></td></tr>
</table>
</BODY>
</HTML>

View File

@@ -1,9 +0,0 @@
<HTML>
<HEAD>
<TITLE>The RtAudio Tutorial</TITLE>
<LINK HREF="doxygen.css" REL="stylesheet" TYPE="text/css">
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<CENTER>
<a class="qindex" href="index.html">Tutorial</a> &nbsp; <a class="qindex" href="annotated.html">Class/Enum List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; </CENTER>
<HR>

View File

@@ -1,721 +0,0 @@
/*! \mainpage The RtAudio Tutorial
<BODY BGCOLOR="white">
<CENTER>\ref intro &nbsp;&nbsp; \ref changes &nbsp;&nbsp;\ref download &nbsp;&nbsp; \ref start &nbsp;&nbsp; \ref error &nbsp;&nbsp; \ref probing &nbsp;&nbsp; \ref settings &nbsp;&nbsp; \ref playbackb &nbsp;&nbsp; \ref playbackc &nbsp;&nbsp; \ref recording &nbsp;&nbsp; \ref duplex &nbsp;&nbsp; \ref multi &nbsp;&nbsp; \ref methods &nbsp;&nbsp; \ref compiling &nbsp;&nbsp; \ref debug &nbsp;&nbsp; \ref apinotes &nbsp;&nbsp; \ref acknowledge &nbsp;&nbsp; \ref license</CENTER>
\section intro Introduction
RtAudio is a set of C++ classes which provide a common API (Application Programming Interface) for realtime audio input/output across Linux (native ALSA, JACK, and OSS), Macintosh OS X, SGI, and Windows (DirectSound and ASIO) operating systems. RtAudio significantly simplifies the process of interacting with computer audio hardware. It was designed with the following goals:
<UL>
<LI>object oriented C++ design</LI>
<LI>simple, common API across all supported platforms</LI>
<LI>only two header files and one source file for easy inclusion in programming projects</LI>
<LI>allow simultaneous multi-api support</LI>
<LI>blocking functionality</LI>
<LI>callback functionality</LI>
<LI>extensive audio device parameter control</LI>
<LI>audio device capability probing</LI>
<LI>automatic internal conversion for data format, channel number compensation, de-interleaving, and byte-swapping</LI>
</UL>
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 \ref apinotes section for information specific to each of the supported audio APIs.
The RtAudio API provides both blocking (synchronous) and callback (asynchronous) functionality. Callbacks are typically used in conjunction with graphical user interfaces (GUI). Blocking functionality is often necessary for explicit control of multiple input/output stream synchronization or when audio must be synchronized with other system events.
\section changes What's New (Version 3.0)
RtAudio now allows simultaneous multi-api support. For example, you can compile RtAudio to provide both DirectSound and ASIO support on Windows platforms or ALSA, JACK, and OSS support on Linux platforms. This was accomplished by creating an abstract base class, RtApi, with subclasses for each supported API (RtApiAlsa, RtApiJack, RtApiOss, RtApiDs, RtApiAsio, RtApiCore, and RtApiAl). The class RtAudio is now a "controller" which creates an instance of an RtApi subclass based on the user's API choice via an optional RtAudio::RtAudioApi instantiation argument. If no API is specified, RtAudio attempts to make a "logical" API selection.
Support for the JACK low-latency audio server has been added with this version of RtAudio. It is necessary to have the JACK server running before creating an instance of RtAudio.
Several API changes have been made in version 3.0 of RtAudio in an effort to provide more consistent behavior across all supported audio APIs. The most significant of these changes is that multiple stream support from a single RtAudio instance has been discontinued. As a result, stream identifier input arguments are no longer required. Also, the RtAudio::streamWillBlock() function was poorly supported by most APIs and has been deprecated (though the function still exists in those subclasses of RtApi that do allow it to be implemented).
The RtAudio::getDeviceInfo() function was modified to return a globally defined RtAudioDeviceInfo structure. This structure is a simplified version of the previous RTAUDIO_DEVICE structure. In addition, the RTAUDIO_FORMAT structure was renamed RtAudioFormat and defined globally within RtAudio.h. These changes were made for clarity and to better conform with standard C++ programming practices.
The RtError class declaration and definition have been extracted to a separate file (RtError.h). This was done in preparation for a new release of the RtMidi class (planned for Summer 2004).
\section download Download
Latest Release (22 March 2004): <A href="http://music.mcgill.ca/~gary/rtaudio/release/rtaudio-3.0.1.tar.gz">Version 3.0.1 (200 kB tar/gzipped)</A>
\section start Getting Started
With version 3.0, it is now possible to compile multiple API support on a given platform and to specify an API choice during class instantiation. In the examples that follow, no API will be specified (in which case, RtAudio attempts to select the most "logical" available API).
The first thing that must be done when using RtAudio is to create an instance of the class. The default constructor scans the underlying audio system to verify that at least one device is available. RtAudio often uses C++ exceptions to report errors, necessitating try/catch blocks around most member functions. The following code example demonstrates default object construction and destruction:
\code
#include "RtAudio.h"
int main()
{
RtAudio *audio;
// Default RtAudio constructor
try {
audio = new RtAudio();
}
catch (RtError &error) {
// Handle the exception here
error.printMessage();
}
// Clean up
delete audio;
}
\endcode
Obviously, this example doesn't demonstrate any of the real functionality of RtAudio. However, all uses of RtAudio must begin with a constructor (either default or overloaded varieties) and must end with class destruction. Further, it is necessary that all class methods which can throw a C++ exception be called within a try/catch block.
\section error Error Handling
RtAudio uses a C++ exception handler called RtError, which is declared and defined in RtError.h. The RtError class is quite simple but it does allow errors to be "caught" by RtError::Type. Almost all RtAudio methods can "throw" an RtError, most typically if a driver error occurs or a stream function is called when no stream is open. There are a number of cases within RtAudio where warning messages may be displayed but an exception is not thrown. There is a protected RtAudio method, error(), which can be modified to globally control how these messages are handled and reported. By default, error messages are not automatically displayed in RtAudio unless the preprocessor definition __RTAUDIO_DEBUG__ is defined. Messages associated with caught exceptions can be displayed with, for example, the RtError::printMessage() function.
\section probing 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.
\code
// probe.cpp
#include <iostream>
#include "RtAudio.h"
int main()
{
RtAudio *audio;
// Default RtAudio constructor
try {
audio = new RtAudio();
}
catch (RtError &error) {
error.printMessage();
exit(EXIT_FAILURE);
}
// Determine the number of devices available
int devices = audio->getDeviceCount();
// Scan through devices for various capabilities
RtAudioDeviceInfo info;
for (int i=1; i<=devices; i++) {
try {
info = audio->getDeviceInfo(i);
}
catch (RtError &error) {
error.printMessage();
break;
}
// Print, for example, the maximum number of output channels for each device
std::cout << "device = " << i;
std::cout << ": maximum output channels = " << info.outputChannels << "\n";
}
// Clean up
delete audio;
return 0;
}
\endcode
The RtAudioDeviceInfo structure is defined in RtAudio.h and provides a variety of information useful in assessing the capabilities of a device:
\code
typedef struct RtAudioDeviceInfo{
std::string name; // Character string device identifier.
bool probed; // true if the device capabilities were successfully probed.
int outputChannels; // Maximum output channels supported by device.
int inputChannels; // Maximum input channels supported by device.
int duplexChannels; // Maximum simultaneous input/output channels supported by device.
bool isDefault; // true if this is the default output or input device.
std::vector<int> sampleRates; // Supported sample rates.
RtAudioFormat nativeFormats; // Bit mask of supported data formats.
};
\endcode
The following data formats are defined and fully supported by RtAudio:
\code
typedef unsigned long RtAudioFormat;
static const RtAudioFormat RTAUDIO_SINT8; // Signed 8-bit integer
static const RtAudioFormat RTAUDIO_SINT16; // Signed 16-bit integer
static const RtAudioFormat RTAUDIO_SINT24; // Signed 24-bit integer (upper 3 bytes of 32-bit signed integer.)
static const RtAudioFormat RTAUDIO_SINT32; // Signed 32-bit integer
static const RtAudioFormat RTAUDIO_FLOAT32; // 32-bit float normalized between +/- 1.0
static const RtAudioFormat RTAUDIO_FLOAT64; // 64-bit double normalized between +/- 1.0
\endcode
The <I>nativeFormats</I> member of the RtAudioDeviceInfo structure is a bit mask of the above formats which are natively supported by the device. However, RtAudio will automatically provide format conversion if a particular format is not natively supported. When the <I>probed</I> member of the RtAudioDeviceInfo structure is false, the remaining structure members are undefined and the device is probably unuseable.
While some audio devices may require a minimum channel value greater than one, RtAudio will provide automatic channel number compensation when the number of channels set by the user is less than that required by the device. Channel compensation is <I>NOT</I> possible when the number of channels set by the user is greater than that supported by the device.
It should be noted that the capabilities reported by a device driver or underlying audio API are not always accurate and/or may be dependent on a combination of device settings. For this reason, RtAudio does not typically rely on the queried values when attempting to open a stream.
\section settings Device Settings
The next step in using RtAudio is to open a stream with particular device and parameter settings.
\code
#include "RtAudio.h"
int main()
{
int channels = 2;
int sampleRate = 44100;
int bufferSize = 256; // 256 sample frames
int nBuffers = 4; // number of internal buffers used by device
int device = 0; // 0 indicates the default or first available device
RtAudio *audio;
// Instantiate RtAudio and open a stream within a try/catch block
try {
audio = new RtAudio();
}
catch (RtError &error) {
error.printMessage();
exit(EXIT_FAILURE);
}
try {
audio->openStream(device, channels, 0, 0, RTAUDIO_FLOAT32,
sampleRate, &bufferSize, nBuffers);
}
catch (RtError &error) {
error.printMessage();
// Perhaps try other parameters?
}
// Clean up
delete audio;
return 0;
}
\endcode
The RtAudio::openStream() method attempts to open a stream with a specified set of parameter values. In this case, we attempt to open a two channel playback stream with the default output device, 32-bit floating point data, a sample rate of 44100 Hz, a frame rate of 256 sample frames per read/write, and 4 internal device buffers. When device = 0, RtAudio first attempts to open the default audio device with the given parameters. If that attempt fails, RtAudio searches through the remaining available devices in an effort to find a device which will meet the given parameters. If all attempts are unsuccessful, an RtError is thrown. When a non-zero device value is specified, an attempt is made to open that device \e ONLY (device = 1 specifies the first identified device, as reported by RtAudio::getDeviceInfo()).
RtAudio provides four signed integer and two floating point data formats which can be specified using the RtAudioFormat parameter values mentioned earlier. If the opened device does not natively support the given format, RtAudio will automatically perform the necessary data format conversion.
The <I>bufferSize</I> parameter specifies the desired number of sample frames which will be written to and/or read from a device per write/read operation. The <I>nBuffers</I> parameter is used in setting the underlying device buffer parameters. Both the <I>bufferSize</I> and <I>nBuffers</I> parameters can be used to control stream latency though there is no guarantee that the passed values will be those used by a device (the <I>nBuffers</I> parameter is ignored when using the OS X CoreAudio, Linux Jack, and the Windows ASIO APIs). In general, lower values for both parameters will produce less latency but perhaps less robust performance. Both parameters can be specified with values of zero, in which case the smallest allowable values will be used. The <I>bufferSize</I> parameter is passed as a pointer and the actual value used by the stream is set during the device setup procedure. <I>bufferSize</I> values should be a power of two. Optimal and allowable buffer values tend to vary between systems and devices. Check the \ref apinotes section for general guidelines.
As noted earlier, the device capabilities reported by a driver or underlying audio API are not always accurate and/or may be dependent on a combination of device settings. Because of this, RtAudio does not attempt to query a device's capabilities or use previously reported values when opening a device. Instead, RtAudio simply attempts to set the given parameters on a specified device and then checks whether the setup is successful or not.
\section playbackb Playback (blocking functionality)
Once the device is open for playback, there are only a few final steps necessary for realtime audio output. We'll first provide an example (blocking functionality) and then discuss the details.
\code
// playback.cpp
#include "RtAudio.h"
int main()
{
int count;
int channels = 2;
int sampleRate = 44100;
int bufferSize = 256; // 256 sample frames
int nBuffers = 4; // number of internal buffers used by device
float *buffer;
int device = 0; // 0 indicates the default or first available device
RtAudio *audio;
// Open a stream during RtAudio instantiation
try {
audio = new RtAudio(device, channels, 0, 0, RTAUDIO_FLOAT32,
sampleRate, &bufferSize, nBuffers);
}
catch (RtError &error) {
error.printMessage();
exit(EXIT_FAILURE);
}
try {
// Get a pointer to the stream buffer
buffer = (float *) audio->getStreamBuffer();
// Start the stream
audio->startStream();
}
catch (RtError &error) {
error.printMessage();
goto cleanup;
}
// An example loop which runs for 40000 sample frames
count = 0;
while (count < 40000) {
// Generate your samples and fill the buffer with bufferSize sample frames of data
...
// Trigger the output of the data buffer
try {
audio->tickStream();
}
catch (RtError &error) {
error.printMessage();
goto cleanup;
}
count += bufferSize;
}
try {
// Stop and close the stream
audio->stopStream();
audio->closeStream();
}
catch (RtError &error) {
error.printMessage();
}
cleanup:
delete audio;
return 0;
}
\endcode
The first thing to notice in this example is that we attempt to open a stream during class instantiation with an overloaded constructor. This constructor simply combines the functionality of the default constructor, used earlier, and the RtAudio::openStream() method. Again, we have specified a device value of 0, indicating that the default or first available device meeting the given parameters should be used. An attempt is made to open the stream with the specified <I>bufferSize</I> value. However, it is possible that the device will not accept this value, in which case the closest allowable size is used and returned via the pointer value. The constructor can fail if no available devices are found, or a memory allocation or device driver error occurs. Note that you should not call the RtAudio destructor if an exception is thrown during instantiation.
Assuming the constructor is successful, it is necessary to get a pointer to the buffer, provided by RtAudio, for use in feeding data to/from the opened stream. Note that the user should <I>NOT</I> attempt to deallocate the stream buffer memory ... memory management for the stream buffer will be automatically controlled by RtAudio. After starting the stream with RtAudio::startStream(), one simply fills that buffer, which is of length equal to the returned <I>bufferSize</I> value, with interleaved audio data (in the specified format) for playback. Finally, a call to the RtAudio::tickStream() routine triggers a blocking write call for the stream.
In general, one should call the RtAudio::stopStream() and RtAudio::closeStream() methods after finishing with a stream. However, both methods will implicitly be called during object destruction if necessary.
\section playbackc Playback (callback functionality)
The primary difference in using RtAudio with callback functionality involves the creation of a user-defined callback function. Here is an example which produces a sawtooth waveform for playback.
\code
#include <iostream>
#include "RtAudio.h"
// Two-channel sawtooth wave generator.
int sawtooth(char *buffer, int bufferSize, void *data)
{
int i, j;
double *my_buffer = (double *) buffer;
double *my_data = (double *) data;
// Write interleaved audio data.
for (i=0; i<bufferSize; i++) {
for (j=0; j<2; j++) {
*my_buffer++ = my_data[j];
my_data[j] += 0.005 * (j+1+(j*0.1));
if (my_data[j] >= 1.0) my_data[j] -= 2.0;
}
}
return 0;
}
int main()
{
int channels = 2;
int sampleRate = 44100;
int bufferSize = 256; // 256 sample frames
int nBuffers = 4; // number of internal buffers used by device
int device = 0; // 0 indicates the default or first available device
double data[2];
char input;
RtAudio *audio;
// Open a stream during RtAudio instantiation
try {
audio = new RtAudio(device, channels, 0, 0, RTAUDIO_FLOAT64,
sampleRate, &bufferSize, nBuffers);
}
catch (RtError &error) {
error.printMessage();
exit(EXIT_FAILURE);
}
try {
// Set the stream callback function
audio->setStreamCallback(&sawtooth, (void *)data);
// Start the stream
audio->startStream();
}
catch (RtError &error) {
error.printMessage();
goto cleanup;
}
std::cout << "\nPlaying ... press <enter> to quit.\n";
std::cin.get(input);
try {
// Stop and close the stream
audio->stopStream();
audio->closeStream();
}
catch (RtError &error) {
error.printMessage();
}
cleanup:
delete audio;
return 0;
}
\endcode
After opening the device in exactly the same way as the previous example (except with a data format change), we must set our callback function for the stream using RtAudio::setStreamCallback(). When the underlying audio API uses blocking calls (OSS, ALSA, SGI, and Windows DirectSound), this method will spawn a new process (or thread) which automatically calls the callback function when more data is needed. Callback-based audio APIs (OS X CoreAudio Linux Jack, and ASIO) implement their own event notification schemes. Note that the callback function is called only when the stream is "running" (between calls to the RtAudio::startStream() and RtAudio::stopStream() methods). The last argument to RtAudio::setStreamCallback() is a pointer to arbitrary data that you wish to access from within your callback function.
In this example, we stop the stream with an explicit call to RtAudio::stopStream(). When using callback functionality, it is also possible to stop a stream by returning a non-zero value from the callback function.
Once set with RtAudio::setStreamCallback, the callback process exists for the life of the stream (until the stream is closed with RtAudio::closeStream() or the RtAudio instance is deleted). It is possible to disassociate a callback function and cancel its process for an open stream using the RtAudio::cancelStreamCallback() method. The stream can then be used with blocking functionality or a new callback can be associated with it.
\section recording 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:
\code
// record.cpp
#include "RtAudio.h"
int main()
{
int count;
int channels = 2;
int sampleRate = 44100;
int bufferSize = 256; // 256 sample frames
int nBuffers = 4; // number of internal buffers used by device
float *buffer;
int device = 0; // 0 indicates the default or first available device
RtAudio *audio;
// Instantiate RtAudio and open a stream.
try {
audio = new RtAudio(&stream, 0, 0, device, channels,
RTAUDIO_FLOAT32, sampleRate, &bufferSize, nBuffers);
}
catch (RtError &error) {
error.printMessage();
exit(EXIT_FAILURE);
}
try {
// Get a pointer to the stream buffer
buffer = (float *) audio->getStreamBuffer();
// Start the stream
audio->startStream();
}
catch (RtError &error) {
error.printMessage();
goto cleanup;
}
// An example loop which runs for about 40000 sample frames
count = 0;
while (count < 40000) {
// Read a buffer of data
try {
audio->tickStream();
}
catch (RtError &error) {
error.printMessage();
goto cleanup;
}
// Process the input samples (bufferSize sample frames) that were read
...
count += bufferSize;
}
try {
// Stop the stream
audio->stopStream();
}
catch (RtError &error) {
error.printMessage();
}
cleanup:
delete audio;
return 0;
}
\endcode
In this example, the stream was opened for recording with a non-zero <I>inputChannels</I> value. The only other difference between this example and that for playback involves the order of data processing in the loop, where it is necessary to first read a buffer of input data before manipulating it.
\section duplex Duplex Mode
Finally, it is easy to use RtAudio for simultaneous audio input/output, or duplex operation. In this example, we use a callback function and simply scale the input data before sending it back to the output.
\code
// duplex.cpp
#include <iostream>
#include "RtAudio.h"
// Pass-through function.
int scale(char *buffer, int bufferSize, void *)
{
// Note: do nothing here for pass through.
double *my_buffer = (double *) buffer;
// Scale input data for output.
for (int i=0; i<bufferSize; i++) {
// Do for two channels.
*my_buffer++ *= 0.5;
*my_buffer++ *= 0.5;
}
return 0;
}
int main()
{
int channels = 2;
int sampleRate = 44100;
int bufferSize = 256; // 256 sample frames
int nBuffers = 4; // number of internal buffers used by device
int device = 0; // 0 indicates the default or first available device
char input;
RtAudio *audio;
// Open a stream during RtAudio instantiation
try {
audio = new RtAudio(device, channels, device, channels, RTAUDIO_FLOAT64,
sampleRate, &bufferSize, nBuffers);
}
catch (RtError &error) {
error.printMessage();
exit(EXIT_FAILURE);
}
try {
// Set the stream callback function
audio->setStreamCallback(&scale, NULL);
// Start the stream
audio->startStream();
}
catch (RtError &error) {
error.printMessage();
goto cleanup;
}
std::cout << "\nRunning duplex ... press <enter> to quit.\n";
std::cin.get(input);
try {
// Stop and close the stream
audio->stopStream();
audio->closeStream();
}
catch (RtError &error) {
error.printMessage();
}
cleanup:
delete audio;
return 0;
}
\endcode
When an RtAudio stream is running in duplex mode (nonzero input <I>AND</I> output channels), the audio write (playback) operation always occurs before the audio read (record) operation. This sequence allows the use of a single buffer to store both output and input data.
As we see with this example, the write-read sequence of operations does not preclude the use of RtAudio in situations where input data is first processed and then output through a duplex stream. When the stream buffer is first allocated, it is initialized with zeros, which produces no audible result when output to the device. In this example, anything recorded by the audio stream input will be scaled and played out during the next round of audio processing.
Note that duplex operation can also be achieved by opening one output stream instance and one input stream instance using the same or different devices. However, there may be timing problems when attempting to use two different devices, due to possible device clock variations, unless a common external "sync" is provided. This becomes even more difficult to achieve using two separate callback streams because it is not possible to <I>explicitly</I> control the calling order of the callback functions.
\section multi Using Simultaneous Multiple APIs
Because support for each audio API is encapsulated in a specific RtApi subclass, it is possible to compile and instantiate multiple API-specific subclasses on a given operating system. For example, one can compile both the RtApiDs and RtApiAsio classes on Windows operating systems by providing the appropriate preprocessor definitions, include files, and libraries for each. In a run-time situation, one might first attempt to determine whether any ASIO device drivers exist. This can be done by specifying the api argument RtAudio::WINDOWS_ASIO when attempting to create an instance of RtAudio. If an RtError is thrown (indicating no available drivers), then an instance of RtAudio with the api argument RtAudio::WINDOWS_DS can be created. Alternately, if no api argument is specified, RtAudio will first look for ASIO drivers and then DirectSound drivers (on Linux systems, the default API search order is Jack, Alsa, and finally OSS). In theory, it should also be possible to have separate instances of RtAudio open at the same time with different underlying audio API support, though this has not been tested. It is difficult to know how well different audio APIs can simultaneously coexist on a given operating system. In particular, it is most unlikely that the same device could be simultaneously controlled with two different audio APIs.
\section methods Summary of Methods
The following is a short summary of public methods (not including constructors and the destructor) provided by RtAudio:
<UL>
<LI>RtAudio::openStream(): opens a stream with the specified parameters.</LI>
<LI>RtAudio::setStreamCallback(): sets a user-defined callback function for the stream.</LI>
<LI>RtAudio::cancelStreamCallback(): cancels a callback process and function for the stream.</LI>
<LI>RtAudio::getDeviceCount(): returns the number of audio devices available.</LI>
<LI>RtAudio::getDeviceInfo(): returns an RtAudioDeviceInfo structure for a specified device.</LI>
<LI>RtAudio::getStreamBuffer(): returns a pointer to the stream buffer.</LI>
<LI>RtAudio::tickStream(): triggers processing of input/output data for the stream (blocking).</LI>
<LI>RtAudio::closeStream(): closes the stream (implicitly called during object destruction).</LI>
<LI>RtAudio::startStream(): (re)starts the stream, typically after it has been stopped with either stopStream() or abortStream() or after first opening the stream.</LI>
<LI>RtAudio::stopStream(): stops the stream, allowing any remaining samples in the queue to be played out and/or read in. This does not implicitly call RtAudio::closeStream().</LI>
<LI>RtAudio::abortStream(): stops the stream, discarding any remaining samples in the queue. This does not implicitly call closeStream().</LI>
</UL>
\section compiling 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:
<P>
<TABLE BORDER=2 COLS=5 WIDTH="100%">
<TR BGCOLOR="beige">
<TD WIDTH="5%"><B>OS:</B></TD>
<TD WIDTH="5%"><B>Audio API:</B></TD>
<TD WIDTH="5%"><B>C++ Class:</B></TD>
<TD WIDTH="5%"><B>Preprocessor Definition:</B></TD>
<TD WIDTH="5%"><B>Library or Framework:</B></TD>
<TD><B>Example Compiler Statement:</B></TD>
</TR>
<TR>
<TD>Linux</TD>
<TD>ALSA</TD>
<TD>RtApiAlsa</TD>
<TD>__LINUX_ALSA__</TD>
<TD><TT>asound, pthread</TT></TD>
<TD><TT>g++ -Wall -D__LINUX_ALSA__ -o probe probe.cpp RtAudio.cpp -lasound -lpthread</TT></TD>
</TR>
<TR>
<TD>Linux</TD>
<TD>Jack Audio Server</TD>
<TD>RtApiJack</TD>
<TD>__LINUX_JACK__</TD>
<TD><TT>jack, pthread</TT></TD>
<TD><TT>g++ -Wall -D__LINUX_JACK__ -o probe probe.cpp RtAudio.cpp `pkg-config --cflags --libs jack` -lpthread</TT></TD>
</TR>
<TR>
<TD>Linux</TD>
<TD>OSS</TD>
<TD>RtApiOss</TD>
<TD>__LINUX_OSS__</TD>
<TD><TT>pthread</TT></TD>
<TD><TT>g++ -Wall -D__LINUX_OSS__ -o probe probe.cpp RtAudio.cpp -lpthread</TT></TD>
</TR>
<TR>
<TD>Macintosh OS X</TD>
<TD>CoreAudio</TD>
<TD>RtApiCore</TD>
<TD>__MACOSX_CORE__</TD>
<TD><TT>pthread, stdc++, CoreAudio</TT></TD>
<TD><TT>g++ -Wall -D__MACOSX_CORE__ -o probe probe.cpp RtAudio.cpp -framework CoreAudio -lpthread</TT></TD>
</TR>
<TR>
<TD>Irix</TD>
<TD>AL</TD>
<TD>RtApiAl</TD>
<TD>__IRIX_AL__</TD>
<TD><TT>audio, pthread</TT></TD>
<TD><TT>CC -Wall -D__IRIX_AL__ -o probe probe.cpp RtAudio.cpp -laudio -lpthread</TT></TD>
</TR>
<TR>
<TD>Windows</TD>
<TD>Direct Sound</TD>
<TD>RtApiDs</TD>
<TD>__WINDOWS_DS__</TD>
<TD><TT>dsound.lib (ver. 5.0 or higher), multithreaded</TT></TD>
<TD><I>compiler specific</I></TD>
</TR>
<TR>
<TD>Windows</TD>
<TD>ASIO</TD>
<TD>RtApiAsio</TD>
<TD>__WINDOWS_ASIO__</TD>
<TD><I>various ASIO header and source files</I></TD>
<TD><I>compiler specific</I></TD>
</TR>
</TABLE>
<P>
The example compiler statements above could be used to compile the <TT>probe.cpp</TT> example file, assuming that <TT>probe.cpp</TT>, <TT>RtAudio.h</TT>, <tt>RtError.h</tt>, and <TT>RtAudio.cpp</TT> all exist in the same directory.
\section debug Debugging
If you are having problems getting RtAudio to run on your system, try passing the preprocessor definition <TT>__RTAUDIO_DEBUG__</TT> to the compiler (or uncomment the definition at the bottom of RtAudio.h). A variety of warning messages will be displayed which may help in determining the problem. Also try using the programs included in the <tt>test</tt> directory. The program <tt>info</tt> displays the queried capabilities of all hardware devices found.
\section apinotes 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.
\subsection linux Linux:
RtAudio for Linux was developed under Redhat distributions 7.0 - Fedora. Three different audio APIs are supported on Linux platforms: OSS, <A href="http://www.alsa-project.org/">ALSA</A>, and <A href="http://jackit.sourceforge.net/">Jack</A>. The OSS API has existed for at least 6 years and the Linux kernel is distributed with free versions of OSS audio drivers. Therefore, a generic Linux system is most likely to have OSS support (though the availability and quality of OSS drivers for new hardware is decreasing). The ALSA API, although relatively new, is now part of the Linux development kernel and offers significantly better functionality than the OSS API. RtAudio provides support for the 1.0 and higher versions of ALSA. Jack, which is still in development, is a low-latency audio server, written primarily for the GNU/Linux operating system. It can connect a number of different applications to an audio device, as well as allow them to share audio between themselves. Input/output latency on the order of 15 milliseconds can typically be achieved using any of the Linux APIs by fine-tuning the RtAudio buffer parameters (without kernel modifications). Latencies on the order of 5 milliseconds or less can be achieved using a low-latency kernel patch and increasing FIFO scheduling priority. The pthread library, which is used for callback functionality, is a standard component of all Linux distributions.
The ALSA library includes OSS emulation support. That means that you can run programs compiled for the OSS API even when using the ALSA drivers and library. It should be noted however that OSS emulation under ALSA is not perfect. Specifically, channel number queries seem to consistently produce invalid results. While OSS emulation is successful for the majority of RtAudio tests, it is recommended that the native ALSA implementation of RtAudio be used on systems which have ALSA drivers installed.
The ALSA implementation of RtAudio makes no use of the ALSA "plug" interface. All necessary data format conversions, channel compensation, de-interleaving, and byte-swapping is handled by internal RtAudio routines.
The Jack API is based on a callback scheme. RtAudio provides blocking functionality, in addition to callback functionality, within the context of that behavior. It should be noted, however, that the best performance is achieved when using RtAudio's callback functionality with the Jack API. At the moment, only one RtAudio instance can be connected to the Jack server. Because RtAudio does not provide a mechanism for allowing the user to specify particular channels (or ports) of a device, it simply opens the first <I>N</I> enumerated Jack ports for input/output.
\subsection macosx Macintosh OS X (CoreAudio):
The Apple CoreAudio API is based on a callback scheme. RtAudio provides blocking functionality, in addition to callback functionality, within the context of that behavior. CoreAudio is designed to use a separate callback procedure for each of its audio devices. A single RtAudio duplex stream using two different devices is supported, though it cannot be guaranteed to always behave correctly because we cannot synchronize these two callbacks. This same functionality might be achieved with better synchrony by creating separate instances of RtAudio for each device and making use of RtAudio blocking calls (i.e. RtAudio::tickStream()). The <I>numberOfBuffers</I> 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.
\subsection irix Irix (SGI):
The Irix version of RtAudio was written and tested on an SGI Indy running Irix version 6.5.4 and the newer "al" audio library. RtAudio does not compile under Irix version 6.3, mainly because the C++ compiler is too old. Despite the relatively slow speed of the Indy, RtAudio was found to behave quite well and input/output latency was very good. No problems were found with respect to using the pthread library.
\subsection windowsds Windows (DirectSound):
In order to compile RtAudio under Windows for the DirectSound API, you must have the header and source files for DirectSound version 5.0 or higher. As far as I know, there is no DirectSoundCapture support for Windows NT. Audio output latency with DirectSound can be reasonably good (on the order of 20 milliseconds). On the other hand, input audio latency tends to be terrible (100 milliseconds or more). Further, DirectSound drivers tend to crash easily when experimenting with buffer parameters. On my system, I found it necessary to use values around nBuffers = 8 and bufferSize = 512 to avoid crashes. RtAudio was originally developed with Visual C++ version 6.0.
\subsection windowsasio Windows (ASIO):
The Steinberg ASIO audio API is based on a callback scheme. In addition, the API allows only a single device driver to be loaded and accessed at a time. ASIO device drivers must be supplied by audio hardware manufacturers, though ASIO emulation is possible on top of systems with DirectSound drivers. The <I>numberOfBuffers</I> 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: <TT>asio.h,cpp; asiodrivers.h,cpp; asiolist.h,cpp; asiodrvr.h; asiosys.h; ginclude.h; iasiodrv.h</TT>. The Visual C++ projects found in <TT>/tests/Windows/</TT> compile both ASIO and DirectSound support.
\section acknowledge Acknowledgements
The RtAudio API incorporates many of the concepts developed in the <A href="http://www.portaudio.com/">PortAudio</A> project by Phil Burk and Ross Bencina. Early development also incorporated ideas from Bill Schottstaedt's <A href="http://www-ccrma.stanford.edu/software/snd/sndlib/">sndlib</A>. The CCRMA <A href="http://www-ccrma.stanford.edu/groups/soundwire/">SoundWire group</A> 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 <A href="http://www.iua.upf.es/">Institut Universitari de L'Audiovisual (IUA)</A> in Barcelona, Spain and the <A href="http://www.acoustics.hut.fi/">Laboratory of Acoustics and Audio Signal Processing</A> at the Helsinki University of Technology, Finland. Much subsequent development happened while working at the <A href="http://www-ccrma.stanford.edu/">Center for Computer Research in Music and Acoustics (CCRMA)</A> at <A href="http://www.stanford.edu/">Stanford University</A>. The most recent version of RtAudio was finished while working as an assistant professor of <a href="http://www.music.mcgill.ca/musictech/">Music Technology</a> at <a href="http://www.mcgill.ca/">McGill University</a>. This work was supported in part by the United States Air Force Office of Scientific Research (grant \#F49620-99-1-0293).
\section license License
RtAudio: a realtime audio i/o C++ classes<BR>
Copyright (c) 2001-2004 Gary P. Scavone
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
Any person wishing to distribute modifications to the Software is
requested to send the modifications to the original developer so that
they can be incorporated into the canonical version.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

View File

@@ -1,539 +0,0 @@
<HTML>
<HEAD>
<TITLE>The RtAudio Tutorial</TITLE>
<LINK HREF="doxygen.css" REL="stylesheet" TYPE="text/css">
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<CENTER>
<a class="qindex" href="index.html">Tutorial</a> &nbsp; <a class="qindex" href="annotated.html">Class/Enum List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; </CENTER>
<HR>
<!-- Generated by Doxygen 1.3.4 -->
<h1>RtAudio.h</h1><div class="fragment"><pre>00001 <span class="comment">/************************************************************************/</span>
00038 <span class="comment">/************************************************************************/</span>
00039
00040 <span class="comment">// RtAudio: Version 3.0.1, 22 March 2004</span>
00041
00042 <span class="preprocessor">#ifndef __RTAUDIO_H</span>
00043 <span class="preprocessor"></span><span class="preprocessor">#define __RTAUDIO_H</span>
00044 <span class="preprocessor"></span>
00045 <span class="preprocessor">#include "RtError.h"</span>
00046 <span class="preprocessor">#include &lt;string&gt;</span>
00047 <span class="preprocessor">#include &lt;vector&gt;</span>
00048
00049 <span class="comment">// Operating system dependent thread functionality.</span>
00050 <span class="preprocessor">#if defined(__WINDOWS_DS__) || defined(__WINDOWS_ASIO__)</span>
00051 <span class="preprocessor"></span><span class="preprocessor"> #include &lt;windows.h&gt;</span>
00052 <span class="preprocessor"> #include &lt;process.h&gt;</span>
00053
00054 <span class="keyword">typedef</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> ThreadHandle;
00055 <span class="keyword">typedef</span> CRITICAL_SECTION StreamMutex;
00056
00057 <span class="preprocessor">#else // Various unix flavors with pthread support.</span>
00058 <span class="preprocessor"></span><span class="preprocessor"> #include &lt;pthread.h&gt;</span>
00059
00060 <span class="keyword">typedef</span> pthread_t ThreadHandle;
00061 <span class="keyword">typedef</span> pthread_mutex_t StreamMutex;
00062
00063 <span class="preprocessor">#endif</span>
00064 <span class="preprocessor"></span>
00065 <span class="comment">// This global structure type is used to pass callback information</span>
00066 <span class="comment">// between the private RtAudio stream structure and global callback</span>
00067 <span class="comment">// handling functions.</span>
00068 <span class="keyword">struct </span>CallbackInfo {
00069 <span class="keywordtype">void</span> *object; <span class="comment">// Used as a "this" pointer.</span>
00070 ThreadHandle thread;
00071 <span class="keywordtype">bool</span> usingCallback;
00072 <span class="keywordtype">void</span> *callback;
00073 <span class="keywordtype">void</span> *userData;
00074 <span class="keywordtype">void</span> *apiInfo; <span class="comment">// void pointer for API specific callback information</span>
00075
00076 <span class="comment">// Default constructor.</span>
00077 CallbackInfo()
00078 :object(0), usingCallback(false), callback(0),
00079 userData(0), apiInfo(0) {}
00080 };
00081
00082 <span class="comment">// Support for signed integers and floats. Audio data fed to/from</span>
00083 <span class="comment">// the tickStream() routine is assumed to ALWAYS be in host</span>
00084 <span class="comment">// byte order. The internal routines will automatically take care of</span>
00085 <span class="comment">// any necessary byte-swapping between the host format and the</span>
00086 <span class="comment">// soundcard. Thus, endian-ness is not a concern in the following</span>
00087 <span class="comment">// format definitions.</span>
00088 <span class="keyword">typedef</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> RtAudioFormat;
00089 <span class="keyword">static</span> <span class="keyword">const</span> RtAudioFormat RTAUDIO_SINT8 = 0x1;
00090 <span class="keyword">static</span> <span class="keyword">const</span> RtAudioFormat RTAUDIO_SINT16 = 0x2;
00091 <span class="keyword">static</span> <span class="keyword">const</span> RtAudioFormat RTAUDIO_SINT24 = 0x4;
00092 <span class="keyword">static</span> <span class="keyword">const</span> RtAudioFormat RTAUDIO_SINT32 = 0x8;
00093 <span class="keyword">static</span> <span class="keyword">const</span> RtAudioFormat RTAUDIO_FLOAT32 = 0x10;
00094 <span class="keyword">static</span> <span class="keyword">const</span> RtAudioFormat RTAUDIO_FLOAT64 = 0x20;
00096 <span class="keyword">typedef</span> int (*RtAudioCallback)(<span class="keywordtype">char</span> *buffer, <span class="keywordtype">int</span> bufferSize, <span class="keywordtype">void</span> *userData);
00097
<a name="l00099"></a><a class="code" href="structRtAudioDeviceInfo.html">00099</a> <span class="keyword">struct </span><a class="code" href="structRtAudioDeviceInfo.html">RtAudioDeviceInfo</a> {
<a name="l00100"></a><a class="code" href="structRtAudioDeviceInfo.html#o0">00100</a> std::string <a class="code" href="structRtAudioDeviceInfo.html#o0">name</a>;
<a name="l00101"></a><a class="code" href="structRtAudioDeviceInfo.html#o1">00101</a> <span class="keywordtype">bool</span> <a class="code" href="structRtAudioDeviceInfo.html#o1">probed</a>;
<a name="l00102"></a><a class="code" href="structRtAudioDeviceInfo.html#o2">00102</a> <span class="keywordtype">int</span> <a class="code" href="structRtAudioDeviceInfo.html#o2">outputChannels</a>;
<a name="l00103"></a><a class="code" href="structRtAudioDeviceInfo.html#o3">00103</a> <span class="keywordtype">int</span> <a class="code" href="structRtAudioDeviceInfo.html#o3">inputChannels</a>;
<a name="l00104"></a><a class="code" href="structRtAudioDeviceInfo.html#o4">00104</a> <span class="keywordtype">int</span> <a class="code" href="structRtAudioDeviceInfo.html#o4">duplexChannels</a>;
<a name="l00105"></a><a class="code" href="structRtAudioDeviceInfo.html#o5">00105</a> <span class="keywordtype">bool</span> <a class="code" href="structRtAudioDeviceInfo.html#o5">isDefault</a>;
<a name="l00106"></a><a class="code" href="structRtAudioDeviceInfo.html#o6">00106</a> std::vector&lt;int&gt; <a class="code" href="structRtAudioDeviceInfo.html#o6">sampleRates</a>;
<a name="l00107"></a><a class="code" href="structRtAudioDeviceInfo.html#o7">00107</a> RtAudioFormat <a class="code" href="structRtAudioDeviceInfo.html#o7">nativeFormats</a>;
00109 <span class="comment">// Default constructor.</span>
00110 <a class="code" href="structRtAudioDeviceInfo.html">RtAudioDeviceInfo</a>()
00111 :<a class="code" href="structRtAudioDeviceInfo.html#o1">probed</a>(false), <a class="code" href="structRtAudioDeviceInfo.html#o2">outputChannels</a>(0), <a class="code" href="structRtAudioDeviceInfo.html#o3">inputChannels</a>(0),
00112 <a class="code" href="structRtAudioDeviceInfo.html#o4">duplexChannels</a>(0), <a class="code" href="structRtAudioDeviceInfo.html#o5">isDefault</a>(false), <a class="code" href="structRtAudioDeviceInfo.html#o7">nativeFormats</a>(0) {}
00113 };
00114
00115 <span class="comment">// **************************************************************** //</span>
00116 <span class="comment">//</span>
00117 <span class="comment">// RtApi class declaration.</span>
00118 <span class="comment">//</span>
00119 <span class="comment">// Note that RtApi is an abstract base class and cannot be</span>
00120 <span class="comment">// explicitly instantiated. The class RtAudio will create an</span>
00121 <span class="comment">// instance of an RtApi subclass (RtApiOss, RtApiAlsa,</span>
00122 <span class="comment">// RtApiJack, RtApiCore, RtApiAl, RtApiDs, or RtApiAsio).</span>
00123 <span class="comment">//</span>
00124 <span class="comment">// **************************************************************** //</span>
00125
00126 <span class="keyword">class </span>RtApi
00127 {
00128 <span class="keyword">public</span>:
00129
00130 RtApi();
00131 <span class="keyword">virtual</span> ~RtApi();
00132 <span class="keywordtype">void</span> openStream( <span class="keywordtype">int</span> outputDevice, <span class="keywordtype">int</span> outputChannels,
00133 <span class="keywordtype">int</span> inputDevice, <span class="keywordtype">int</span> inputChannels,
00134 RtAudioFormat format, <span class="keywordtype">int</span> sampleRate,
00135 <span class="keywordtype">int</span> *bufferSize, <span class="keywordtype">int</span> numberOfBuffers );
00136 <span class="keyword">virtual</span> <span class="keywordtype">void</span> setStreamCallback( RtAudioCallback callback, <span class="keywordtype">void</span> *userData ) = 0;
00137 <span class="keyword">virtual</span> <span class="keywordtype">void</span> cancelStreamCallback() = 0;
00138 <span class="keywordtype">int</span> getDeviceCount(<span class="keywordtype">void</span>);
00139 <a class="code" href="structRtAudioDeviceInfo.html">RtAudioDeviceInfo</a> getDeviceInfo( <span class="keywordtype">int</span> device );
00140 <span class="keywordtype">char</span> * <span class="keyword">const</span> getStreamBuffer();
00141 <span class="keyword">virtual</span> <span class="keywordtype">void</span> tickStream() = 0;
00142 <span class="keyword">virtual</span> <span class="keywordtype">void</span> closeStream();
00143 <span class="keyword">virtual</span> <span class="keywordtype">void</span> startStream() = 0;
00144 <span class="keyword">virtual</span> <span class="keywordtype">void</span> stopStream() = 0;
00145 <span class="keyword">virtual</span> <span class="keywordtype">void</span> abortStream() = 0;
00146
00147 <span class="keyword">protected</span>:
00148
00149 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> MAX_SAMPLE_RATES;
00150 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> SAMPLE_RATES[];
00151
00152 <span class="keyword">enum</span> { FAILURE, SUCCESS };
00153
00154 <span class="keyword">enum</span> StreamMode {
00155 OUTPUT,
00156 INPUT,
00157 DUPLEX,
00158 UNINITIALIZED = -75
00159 };
00160
00161 <span class="keyword">enum</span> StreamState {
00162 STREAM_STOPPED,
00163 STREAM_RUNNING
00164 };
00165
00166 <span class="comment">// A protected structure for audio streams.</span>
00167 <span class="keyword">struct </span>RtApiStream {
00168 <span class="keywordtype">int</span> device[2]; <span class="comment">// Playback and record, respectively.</span>
00169 <span class="keywordtype">void</span> *apiHandle; <span class="comment">// void pointer for API specific stream handle information</span>
00170 StreamMode mode; <span class="comment">// OUTPUT, INPUT, or DUPLEX.</span>
00171 StreamState state; <span class="comment">// STOPPED or RUNNING</span>
00172 <span class="keywordtype">char</span> *userBuffer;
00173 <span class="keywordtype">char</span> *deviceBuffer;
00174 <span class="keywordtype">bool</span> doConvertBuffer[2]; <span class="comment">// Playback and record, respectively.</span>
00175 <span class="keywordtype">bool</span> deInterleave[2]; <span class="comment">// Playback and record, respectively.</span>
00176 <span class="keywordtype">bool</span> doByteSwap[2]; <span class="comment">// Playback and record, respectively.</span>
00177 <span class="keywordtype">int</span> sampleRate;
00178 <span class="keywordtype">int</span> bufferSize;
00179 <span class="keywordtype">int</span> nBuffers;
00180 <span class="keywordtype">int</span> nUserChannels[2]; <span class="comment">// Playback and record, respectively.</span>
00181 <span class="keywordtype">int</span> nDeviceChannels[2]; <span class="comment">// Playback and record channels, respectively.</span>
00182 RtAudioFormat userFormat;
00183 RtAudioFormat deviceFormat[2]; <span class="comment">// Playback and record, respectively.</span>
00184 StreamMutex mutex;
00185 CallbackInfo callbackInfo;
00186
00187 RtApiStream()
00188 :apiHandle(0), userBuffer(0), deviceBuffer(0) {}
00189 <span class="comment">// mode(UNINITIALIZED), state(STREAM_STOPPED),</span>
00190 };
00191
00192 <span class="comment">// A protected device structure for audio devices.</span>
00193 <span class="keyword">struct </span>RtApiDevice {
00194 std::string name;
00195 <span class="keywordtype">bool</span> probed;
00196 <span class="keywordtype">void</span> *apiDeviceId; <span class="comment">// void pointer for API specific device information</span>
00197 <span class="keywordtype">int</span> maxOutputChannels;
00198 <span class="keywordtype">int</span> maxInputChannels;
00199 <span class="keywordtype">int</span> maxDuplexChannels;
00200 <span class="keywordtype">int</span> minOutputChannels;
00201 <span class="keywordtype">int</span> minInputChannels;
00202 <span class="keywordtype">int</span> minDuplexChannels;
00203 <span class="keywordtype">bool</span> hasDuplexSupport;
00204 <span class="keywordtype">bool</span> isDefault;
00205 std::vector&lt;int&gt; sampleRates;
00206 RtAudioFormat nativeFormats;
00208 <span class="comment">// Default constructor.</span>
00209 RtApiDevice()
00210 :probed(false), apiDeviceId(0), maxOutputChannels(0), maxInputChannels(0),
00211 maxDuplexChannels(0), minOutputChannels(0), minInputChannels(0),
00212 minDuplexChannels(0), isDefault(false), nativeFormats(0) {}
00213 };
00214
00215 <span class="keyword">typedef</span> <span class="keywordtype">signed</span> <span class="keywordtype">short</span> Int16;
00216 <span class="keyword">typedef</span> <span class="keywordtype">signed</span> <span class="keywordtype">int</span> Int32;
00217 <span class="keyword">typedef</span> <span class="keywordtype">float</span> Float32;
00218 <span class="keyword">typedef</span> <span class="keywordtype">double</span> Float64;
00219
00220 <span class="keywordtype">char</span> message_[256];
00221 <span class="keywordtype">int</span> nDevices_;
00222 std::vector&lt;RtApiDevice&gt; devices_;
00223 RtApiStream stream_;
00224
00229 <span class="keyword">virtual</span> <span class="keywordtype">void</span> initialize(<span class="keywordtype">void</span>) = 0;
00230
00239 <span class="keyword">virtual</span> <span class="keywordtype">void</span> probeDeviceInfo( RtApiDevice *info );
00240
00249 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> probeDeviceOpen( <span class="keywordtype">int</span> device, StreamMode mode, <span class="keywordtype">int</span> channels,
00250 <span class="keywordtype">int</span> sampleRate, RtAudioFormat format,
00251 <span class="keywordtype">int</span> *bufferSize, <span class="keywordtype">int</span> numberOfBuffers );
00252
00257 <span class="keyword">virtual</span> <span class="keywordtype">int</span> getDefaultInputDevice(<span class="keywordtype">void</span>);
00258
00263 <span class="keyword">virtual</span> <span class="keywordtype">int</span> getDefaultOutputDevice(<span class="keywordtype">void</span>);
00264
00266 <span class="keywordtype">void</span> clearDeviceInfo( RtApiDevice *info );
00267
00269 <span class="keywordtype">void</span> clearStreamInfo();
00270
00272 <span class="keywordtype">void</span> error( RtError::Type type );
00273
00278 <span class="keywordtype">void</span> verifyStream();
00279
00284 <span class="keywordtype">void</span> convertStreamBuffer( StreamMode mode );
00285
00287 <span class="keywordtype">void</span> byteSwapBuffer( <span class="keywordtype">char</span> *buffer, <span class="keywordtype">int</span> samples, RtAudioFormat format );
00288
00290 <span class="keywordtype">int</span> formatBytes( RtAudioFormat format );
00291 };
00292
00293
00294 <span class="comment">// **************************************************************** //</span>
00295 <span class="comment">//</span>
00296 <span class="comment">// RtAudio class declaration.</span>
00297 <span class="comment">//</span>
00298 <span class="comment">// RtAudio is a "controller" used to select an available audio i/o</span>
00299 <span class="comment">// interface. It presents a common API for the user to call but all</span>
00300 <span class="comment">// functionality is implemented by the class RtAudioApi and its</span>
00301 <span class="comment">// subclasses. RtAudio creates an instance of an RtAudioApi subclass</span>
00302 <span class="comment">// based on the user's API choice. If no choice is made, RtAudio</span>
00303 <span class="comment">// attempts to make a "logical" API selection.</span>
00304 <span class="comment">//</span>
00305 <span class="comment">// **************************************************************** //</span>
00306
<a name="l00307"></a><a class="code" href="classRtAudio.html">00307</a> <span class="keyword">class </span><a class="code" href="classRtAudio.html">RtAudio</a>
00308 {
00309 <span class="keyword">public</span>:
00310
<a name="l00312"></a><a class="code" href="classRtAudio.html#w8">00312</a> <span class="keyword">enum</span> <a class="code" href="classRtAudio.html#w8">RtAudioApi</a> {
00313 <a class="code" href="classRtAudio.html#w8w0">UNSPECIFIED</a>,
00314 <a class="code" href="classRtAudio.html#w8w1">LINUX_ALSA</a>,
00315 <a class="code" href="classRtAudio.html#w8w2">LINUX_OSS</a>,
00316 <a class="code" href="classRtAudio.html#w8w3">LINUX_JACK</a>,
00317 <a class="code" href="classRtAudio.html#w8w4">MACOSX_CORE</a>,
00318 <a class="code" href="classRtAudio.html#w8w5">IRIX_AL</a>,
00319 <a class="code" href="classRtAudio.html#w8w6">WINDOWS_ASIO</a>,
00320 <a class="code" href="classRtAudio.html#w8w7">WINDOWS_DS</a>
00321 };
00322
00324
00334 <a class="code" href="classRtAudio.html#a0">RtAudio</a>( RtAudioApi api=UNSPECIFIED );
00335
00337
00348 <a class="code" href="classRtAudio.html#a0">RtAudio</a>( <span class="keywordtype">int</span> outputDevice, <span class="keywordtype">int</span> outputChannels,
00349 <span class="keywordtype">int</span> inputDevice, <span class="keywordtype">int</span> inputChannels,
00350 RtAudioFormat format, <span class="keywordtype">int</span> sampleRate,
00351 <span class="keywordtype">int</span> *bufferSize, <span class="keywordtype">int</span> numberOfBuffers, RtAudioApi api=UNSPECIFIED );
00352
00354
00358 <a class="code" href="classRtAudio.html#a2">~RtAudio</a>();
00359
00361
00387 <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#a3">openStream</a>( <span class="keywordtype">int</span> outputDevice, <span class="keywordtype">int</span> outputChannels,
00388 <span class="keywordtype">int</span> inputDevice, <span class="keywordtype">int</span> inputChannels,
00389 RtAudioFormat format, <span class="keywordtype">int</span> sampleRate,
00390 <span class="keywordtype">int</span> *bufferSize, <span class="keywordtype">int</span> numberOfBuffers );
00391
00393
<a name="l00412"></a><a class="code" href="classRtAudio.html#a4">00412</a> <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#a4">setStreamCallback</a>(RtAudioCallback callback, <span class="keywordtype">void</span> *userData) { rtapi_-&gt;setStreamCallback( callback, userData ); };
00413
00415
<a name="l00422"></a><a class="code" href="classRtAudio.html#a5">00422</a> <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#a5">cancelStreamCallback</a>() { rtapi_-&gt;cancelStreamCallback(); };
00423
<a name="l00425"></a><a class="code" href="classRtAudio.html#a6">00425</a> <span class="keywordtype">int</span> <a class="code" href="classRtAudio.html#a6">getDeviceCount</a>(<span class="keywordtype">void</span>) { <span class="keywordflow">return</span> rtapi_-&gt;getDeviceCount(); };
00426
00428
<a name="l00436"></a><a class="code" href="classRtAudio.html#a7">00436</a> <a class="code" href="structRtAudioDeviceInfo.html">RtAudioDeviceInfo</a> <a class="code" href="classRtAudio.html#a7">getDeviceInfo</a>(<span class="keywordtype">int</span> device) { <span class="keywordflow">return</span> rtapi_-&gt;getDeviceInfo( device ); };
00437
00439
<a name="l00444"></a><a class="code" href="classRtAudio.html#a8">00444</a> <span class="keywordtype">char</span> * <span class="keyword">const</span> <a class="code" href="classRtAudio.html#a8">getStreamBuffer</a>() { <span class="keywordflow">return</span> rtapi_-&gt;getStreamBuffer(); };
00445
00447
<a name="l00452"></a><a class="code" href="classRtAudio.html#a9">00452</a> <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#a9">tickStream</a>() { rtapi_-&gt;tickStream(); };
00453
00455
<a name="l00459"></a><a class="code" href="classRtAudio.html#a10">00459</a> <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#a10">closeStream</a>() { rtapi_-&gt;closeStream(); };
00460
00462
<a name="l00466"></a><a class="code" href="classRtAudio.html#a11">00466</a> <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#a11">startStream</a>() { rtapi_-&gt;startStream(); };
00467
00469
<a name="l00473"></a><a class="code" href="classRtAudio.html#a12">00473</a> <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#a12">stopStream</a>() { rtapi_-&gt;stopStream(); };
00474
00476
<a name="l00480"></a><a class="code" href="classRtAudio.html#a13">00480</a> <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#a13">abortStream</a>() { rtapi_-&gt;abortStream(); };
00481
00482
00483 <span class="keyword">protected</span>:
00484
00485 <span class="keywordtype">void</span> initialize( RtAudioApi api );
00486
00487 RtApi *rtapi_;
00488 };
00489
00490
00491 <span class="comment">// RtApi Subclass prototypes.</span>
00492
00493 <span class="preprocessor">#if defined(__LINUX_ALSA__)</span>
00494 <span class="preprocessor"></span>
00495 <span class="keyword">class </span>RtApiAlsa: <span class="keyword">public</span> RtApi
00496 {
00497 <span class="keyword">public</span>:
00498
00499 RtApiAlsa();
00500 ~RtApiAlsa();
00501 <span class="keywordtype">void</span> tickStream();
00502 <span class="keywordtype">void</span> closeStream();
00503 <span class="keywordtype">void</span> startStream();
00504 <span class="keywordtype">void</span> stopStream();
00505 <span class="keywordtype">void</span> abortStream();
00506 <span class="keywordtype">int</span> streamWillBlock();
00507 <span class="keywordtype">void</span> setStreamCallback( RtAudioCallback callback, <span class="keywordtype">void</span> *userData );
00508 <span class="keywordtype">void</span> cancelStreamCallback();
00509
00510 <span class="keyword">private</span>:
00511
00512 <span class="keywordtype">void</span> initialize(<span class="keywordtype">void</span>);
00513 <span class="keywordtype">void</span> probeDeviceInfo( RtApiDevice *info );
00514 <span class="keywordtype">bool</span> probeDeviceOpen( <span class="keywordtype">int</span> device, StreamMode mode, <span class="keywordtype">int</span> channels,
00515 <span class="keywordtype">int</span> sampleRate, RtAudioFormat format,
00516 <span class="keywordtype">int</span> *bufferSize, <span class="keywordtype">int</span> numberOfBuffers );
00517 };
00518
00519 <span class="preprocessor">#endif</span>
00520 <span class="preprocessor"></span>
00521 <span class="preprocessor">#if defined(__LINUX_JACK__)</span>
00522 <span class="preprocessor"></span>
00523 <span class="keyword">class </span>RtApiJack: <span class="keyword">public</span> RtApi
00524 {
00525 <span class="keyword">public</span>:
00526
00527 RtApiJack();
00528 ~RtApiJack();
00529 <span class="keywordtype">void</span> tickStream();
00530 <span class="keywordtype">void</span> closeStream();
00531 <span class="keywordtype">void</span> startStream();
00532 <span class="keywordtype">void</span> stopStream();
00533 <span class="keywordtype">void</span> abortStream();
00534 <span class="keywordtype">void</span> setStreamCallback( RtAudioCallback callback, <span class="keywordtype">void</span> *userData );
00535 <span class="keywordtype">void</span> cancelStreamCallback();
00536 <span class="comment">// This function is intended for internal use only. It must be</span>
00537 <span class="comment">// public because it is called by the internal callback handler,</span>
00538 <span class="comment">// which is not a member of RtAudio. External use of this function</span>
00539 <span class="comment">// will most likely produce highly undesireable results!</span>
00540 <span class="keywordtype">void</span> callbackEvent( <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> nframes );
00541
00542 <span class="keyword">private</span>:
00543
00544 <span class="keywordtype">void</span> initialize(<span class="keywordtype">void</span>);
00545 <span class="keywordtype">void</span> probeDeviceInfo( RtApiDevice *info );
00546 <span class="keywordtype">bool</span> probeDeviceOpen( <span class="keywordtype">int</span> device, StreamMode mode, <span class="keywordtype">int</span> channels,
00547 <span class="keywordtype">int</span> sampleRate, RtAudioFormat format,
00548 <span class="keywordtype">int</span> *bufferSize, <span class="keywordtype">int</span> numberOfBuffers );
00549 };
00550
00551 <span class="preprocessor">#endif</span>
00552 <span class="preprocessor"></span>
00553 <span class="preprocessor">#if defined(__LINUX_OSS__)</span>
00554 <span class="preprocessor"></span>
00555 <span class="keyword">class </span>RtApiOss: <span class="keyword">public</span> RtApi
00556 {
00557 <span class="keyword">public</span>:
00558
00559 RtApiOss();
00560 ~RtApiOss();
00561 <span class="keywordtype">void</span> tickStream();
00562 <span class="keywordtype">void</span> closeStream();
00563 <span class="keywordtype">void</span> startStream();
00564 <span class="keywordtype">void</span> stopStream();
00565 <span class="keywordtype">void</span> abortStream();
00566 <span class="keywordtype">int</span> streamWillBlock();
00567 <span class="keywordtype">void</span> setStreamCallback( RtAudioCallback callback, <span class="keywordtype">void</span> *userData );
00568 <span class="keywordtype">void</span> cancelStreamCallback();
00569
00570 <span class="keyword">private</span>:
00571
00572 <span class="keywordtype">void</span> initialize(<span class="keywordtype">void</span>);
00573 <span class="keywordtype">void</span> probeDeviceInfo( RtApiDevice *info );
00574 <span class="keywordtype">bool</span> probeDeviceOpen( <span class="keywordtype">int</span> device, StreamMode mode, <span class="keywordtype">int</span> channels,
00575 <span class="keywordtype">int</span> sampleRate, RtAudioFormat format,
00576 <span class="keywordtype">int</span> *bufferSize, <span class="keywordtype">int</span> numberOfBuffers );
00577 };
00578
00579 <span class="preprocessor">#endif</span>
00580 <span class="preprocessor"></span>
00581 <span class="preprocessor">#if defined(__MACOSX_CORE__)</span>
00582 <span class="preprocessor"></span>
00583 <span class="preprocessor">#include &lt;CoreAudio/AudioHardware.h&gt;</span>
00584
00585 <span class="keyword">class </span>RtApiCore: <span class="keyword">public</span> RtApi
00586 {
00587 <span class="keyword">public</span>:
00588
00589 RtApiCore();
00590 ~RtApiCore();
00591 <span class="keywordtype">int</span> getDefaultOutputDevice(<span class="keywordtype">void</span>);
00592 <span class="keywordtype">int</span> getDefaultInputDevice(<span class="keywordtype">void</span>);
00593 <span class="keywordtype">void</span> tickStream();
00594 <span class="keywordtype">void</span> closeStream();
00595 <span class="keywordtype">void</span> startStream();
00596 <span class="keywordtype">void</span> stopStream();
00597 <span class="keywordtype">void</span> abortStream();
00598 <span class="keywordtype">void</span> setStreamCallback( RtAudioCallback callback, <span class="keywordtype">void</span> *userData );
00599 <span class="keywordtype">void</span> cancelStreamCallback();
00600
00601 <span class="comment">// This function is intended for internal use only. It must be</span>
00602 <span class="comment">// public because it is called by the internal callback handler,</span>
00603 <span class="comment">// which is not a member of RtAudio. External use of this function</span>
00604 <span class="comment">// will most likely produce highly undesireable results!</span>
00605 <span class="keywordtype">void</span> callbackEvent( AudioDeviceID deviceId, <span class="keywordtype">void</span> *inData, <span class="keywordtype">void</span> *outData );
00606
00607 <span class="keyword">private</span>:
00608
00609 <span class="keywordtype">void</span> initialize(<span class="keywordtype">void</span>);
00610 <span class="keywordtype">void</span> probeDeviceInfo( RtApiDevice *info );
00611 <span class="keywordtype">bool</span> probeDeviceOpen( <span class="keywordtype">int</span> device, StreamMode mode, <span class="keywordtype">int</span> channels,
00612 <span class="keywordtype">int</span> sampleRate, RtAudioFormat format,
00613 <span class="keywordtype">int</span> *bufferSize, <span class="keywordtype">int</span> numberOfBuffers );
00614 };
00615
00616 <span class="preprocessor">#endif</span>
00617 <span class="preprocessor"></span>
00618 <span class="preprocessor">#if defined(__WINDOWS_DS__)</span>
00619 <span class="preprocessor"></span>
00620 <span class="keyword">class </span>RtApiDs: <span class="keyword">public</span> RtApi
00621 {
00622 <span class="keyword">public</span>:
00623
00624 RtApiDs();
00625 ~RtApiDs();
00626 <span class="keywordtype">int</span> getDefaultOutputDevice(<span class="keywordtype">void</span>);
00627 <span class="keywordtype">int</span> getDefaultInputDevice(<span class="keywordtype">void</span>);
00628 <span class="keywordtype">void</span> tickStream();
00629 <span class="keywordtype">void</span> closeStream();
00630 <span class="keywordtype">void</span> startStream();
00631 <span class="keywordtype">void</span> stopStream();
00632 <span class="keywordtype">void</span> abortStream();
00633 <span class="keywordtype">int</span> streamWillBlock();
00634 <span class="keywordtype">void</span> setStreamCallback( RtAudioCallback callback, <span class="keywordtype">void</span> *userData );
00635 <span class="keywordtype">void</span> cancelStreamCallback();
00636
00637 <span class="keyword">private</span>:
00638
00639 <span class="keywordtype">void</span> initialize(<span class="keywordtype">void</span>);
00640 <span class="keywordtype">void</span> probeDeviceInfo( RtApiDevice *info );
00641 <span class="keywordtype">bool</span> probeDeviceOpen( <span class="keywordtype">int</span> device, StreamMode mode, <span class="keywordtype">int</span> channels,
00642 <span class="keywordtype">int</span> sampleRate, RtAudioFormat format,
00643 <span class="keywordtype">int</span> *bufferSize, <span class="keywordtype">int</span> numberOfBuffers );
00644 };
00645
00646 <span class="preprocessor">#endif</span>
00647 <span class="preprocessor"></span>
00648 <span class="preprocessor">#if defined(__WINDOWS_ASIO__)</span>
00649 <span class="preprocessor"></span>
00650 <span class="keyword">class </span>RtApiAsio: <span class="keyword">public</span> RtApi
00651 {
00652 <span class="keyword">public</span>:
00653
00654 RtApiAsio();
00655 ~RtApiAsio();
00656 <span class="keywordtype">void</span> tickStream();
00657 <span class="keywordtype">void</span> closeStream();
00658 <span class="keywordtype">void</span> startStream();
00659 <span class="keywordtype">void</span> stopStream();
00660 <span class="keywordtype">void</span> abortStream();
00661 <span class="keywordtype">void</span> setStreamCallback( RtAudioCallback callback, <span class="keywordtype">void</span> *userData );
00662 <span class="keywordtype">void</span> cancelStreamCallback();
00663
00664 <span class="comment">// This function is intended for internal use only. It must be</span>
00665 <span class="comment">// public because it is called by the internal callback handler,</span>
00666 <span class="comment">// which is not a member of RtAudio. External use of this function</span>
00667 <span class="comment">// will most likely produce highly undesireable results!</span>
00668 <span class="keywordtype">void</span> callbackEvent( <span class="keywordtype">long</span> bufferIndex );
00669
00670 <span class="keyword">private</span>:
00671
00672 <span class="keywordtype">void</span> initialize(<span class="keywordtype">void</span>);
00673 <span class="keywordtype">void</span> probeDeviceInfo( RtApiDevice *info );
00674 <span class="keywordtype">bool</span> probeDeviceOpen( <span class="keywordtype">int</span> device, StreamMode mode, <span class="keywordtype">int</span> channels,
00675 <span class="keywordtype">int</span> sampleRate, RtAudioFormat format,
00676 <span class="keywordtype">int</span> *bufferSize, <span class="keywordtype">int</span> numberOfBuffers );
00677 };
00678
00679 <span class="preprocessor">#endif</span>
00680 <span class="preprocessor"></span>
00681 <span class="preprocessor">#if defined(__IRIX_AL__)</span>
00682 <span class="preprocessor"></span>
00683 <span class="keyword">class </span>RtApiAl: <span class="keyword">public</span> RtApi
00684 {
00685 <span class="keyword">public</span>:
00686
00687 RtApiAl();
00688 ~RtApiAl();
00689 <span class="keywordtype">int</span> getDefaultOutputDevice(<span class="keywordtype">void</span>);
00690 <span class="keywordtype">int</span> getDefaultInputDevice(<span class="keywordtype">void</span>);
00691 <span class="keywordtype">void</span> tickStream();
00692 <span class="keywordtype">void</span> closeStream();
00693 <span class="keywordtype">void</span> startStream();
00694 <span class="keywordtype">void</span> stopStream();
00695 <span class="keywordtype">void</span> abortStream();
00696 <span class="keywordtype">int</span> streamWillBlock();
00697 <span class="keywordtype">void</span> setStreamCallback( RtAudioCallback callback, <span class="keywordtype">void</span> *userData );
00698 <span class="keywordtype">void</span> cancelStreamCallback();
00699
00700 <span class="keyword">private</span>:
00701
00702 <span class="keywordtype">void</span> initialize(<span class="keywordtype">void</span>);
00703 <span class="keywordtype">void</span> probeDeviceInfo( RtApiDevice *info );
00704 <span class="keywordtype">bool</span> probeDeviceOpen( <span class="keywordtype">int</span> device, StreamMode mode, <span class="keywordtype">int</span> channels,
00705 <span class="keywordtype">int</span> sampleRate, RtAudioFormat format,
00706 <span class="keywordtype">int</span> *bufferSize, <span class="keywordtype">int</span> numberOfBuffers );
00707 };
00708
00709 <span class="preprocessor">#endif</span>
00710 <span class="preprocessor"></span>
00711 <span class="comment">// Define the following flag to have extra information spewed to stderr.</span>
00712 <span class="comment">//#define __RTAUDIO_DEBUG__</span>
00713
00714 <span class="preprocessor">#endif</span>
</pre></div><HR>
<table><tr><td><img src="../images/mcgill.gif" width=165></td>
<td>&copy;2001-2004 Gary P. Scavone, McGill University. All Rights Reserved.<br>
Maintained by Gary P. Scavone, <a href="mailto:gary@music.mcgill.ca">gary@music.mcgill.ca</a></td></tr>
</table>
</BODY>
</HTML>

View File

@@ -1,64 +0,0 @@
<HTML>
<HEAD>
<TITLE>The RtAudio Tutorial</TITLE>
<LINK HREF="doxygen.css" REL="stylesheet" TYPE="text/css">
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<CENTER>
<a class="qindex" href="index.html">Tutorial</a> &nbsp; <a class="qindex" href="annotated.html">Class/Enum List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; </CENTER>
<HR>
<!-- Generated by Doxygen 1.3.4 -->
<h1>RtError.h</h1><div class="fragment"><pre>00001 <span class="comment">/************************************************************************/</span>
00010 <span class="comment">/************************************************************************/</span>
00011
00012 <span class="preprocessor">#ifndef RTERROR_H</span>
00013 <span class="preprocessor"></span><span class="preprocessor">#define RTERROR_H</span>
00014 <span class="preprocessor"></span>
00015 <span class="preprocessor">#include &lt;iostream&gt;</span>
00016 <span class="preprocessor">#include &lt;string&gt;</span>
00017
<a name="l00018"></a><a class="code" href="classRtError.html">00018</a> <span class="keyword">class </span><a class="code" href="classRtError.html">RtError</a>
00019 {
00020 <span class="keyword">public</span>:
<a name="l00022"></a><a class="code" href="classRtError.html#w11">00022</a> <span class="keyword">enum</span> <a class="code" href="classRtError.html#w11">Type</a> {
00023 <a class="code" href="classRtError.html#w11w0">WARNING</a>,
00024 <a class="code" href="classRtError.html#w11w1">DEBUG_WARNING</a>,
00025 <a class="code" href="classRtError.html#w11w2">UNSPECIFIED</a>,
00026 <a class="code" href="classRtError.html#w11w3">NO_DEVICES_FOUND</a>,
00027 <a class="code" href="classRtError.html#w11w4">INVALID_DEVICE</a>,
00028 <a class="code" href="classRtError.html#w11w5">INVALID_STREAM</a>,
00029 <a class="code" href="classRtError.html#w11w6">MEMORY_ERROR</a>,
00030 <a class="code" href="classRtError.html#w11w7">INVALID_PARAMETER</a>,
00031 <a class="code" href="classRtError.html#w11w8">DRIVER_ERROR</a>,
00032 <a class="code" href="classRtError.html#w11w9">SYSTEM_ERROR</a>,
00033 <a class="code" href="classRtError.html#w11w10">THREAD_ERROR</a>
00034 };
00035
00036 <span class="keyword">protected</span>:
00037 std::string message_;
00038 <a class="code" href="classRtError.html#w11">Type</a> type_;
00039
00040 <span class="keyword">public</span>:
<a name="l00042"></a><a class="code" href="classRtError.html#a0">00042</a> <a class="code" href="classRtError.html#a0">RtError</a>(<span class="keyword">const</span> std::string&amp; message, Type type = RtError::UNSPECIFIED) : message_(message), type_(type){}
00043
<a name="l00045"></a><a class="code" href="classRtError.html#a1">00045</a> <span class="keyword">virtual</span> <a class="code" href="classRtError.html#a1">~RtError</a>(<span class="keywordtype">void</span>) {};
00046
<a name="l00048"></a><a class="code" href="classRtError.html#a2">00048</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classRtError.html#a2">printMessage</a>(<span class="keywordtype">void</span>) { std::cerr &lt;&lt; <span class="charliteral">'\n'</span> &lt;&lt; message_ &lt;&lt; <span class="stringliteral">"\n\n"</span>; }
00049
<a name="l00051"></a><a class="code" href="classRtError.html#a3">00051</a> <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="classRtError.html#w11">Type</a>&amp; <a class="code" href="classRtError.html#a3">getType</a>(<span class="keywordtype">void</span>) { <span class="keywordflow">return</span> type_; }
00052
<a name="l00054"></a><a class="code" href="classRtError.html#a4">00054</a> <span class="keyword">virtual</span> <span class="keyword">const</span> std::string&amp; <a class="code" href="classRtError.html#a4">getMessage</a>(<span class="keywordtype">void</span>) { <span class="keywordflow">return</span> message_; }
00055
<a name="l00057"></a><a class="code" href="classRtError.html#a5">00057</a> <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="classRtError.html#a5">getMessageString</a>(<span class="keywordtype">void</span>) { <span class="keywordflow">return</span> message_.c_str(); }
00058 };
00059
00060 <span class="preprocessor">#endif</span>
</pre></div><HR>
<table><tr><td><img src="../images/mcgill.gif" width=165></td>
<td>&copy;2001-2004 Gary P. Scavone, McGill University. All Rights Reserved.<br>
Maintained by Gary P. Scavone, <a href="mailto:gary@music.mcgill.ca">gary@music.mcgill.ca</a></td></tr>
</table>
</BODY>
</HTML>

View File

@@ -1,24 +0,0 @@
<HTML>
<HEAD>
<TITLE>The RtAudio Tutorial</TITLE>
<LINK HREF="doxygen.css" REL="stylesheet" TYPE="text/css">
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<CENTER>
<a class="qindex" href="index.html">Tutorial</a> &nbsp; <a class="qindex" href="annotated.html">Class/Enum List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; </CENTER>
<HR>
<!-- Generated by Doxygen 1.3.4 -->
<h1>RtAudio Class List</h1>Here are the classes, structs, unions and interfaces with brief descriptions:<table>
<tr><td class="indexkey"><a class="el" href="classRtAudio.html">RtAudio</a></td><td class="indexvalue">Realtime audio i/o C++ classes </td></tr>
<tr><td class="indexkey"><a class="el" href="structRtAudioDeviceInfo.html">RtAudioDeviceInfo</a></td><td class="indexvalue">The public device information structure for returning queried values </td></tr>
<tr><td class="indexkey"><a class="el" href="classRtError.html">RtError</a></td><td class="indexvalue">Exception handling class for <a class="el" href="classRtAudio.html">RtAudio</a> &amp; RtMidi </td></tr>
</table>
<HR>
<table><tr><td><img src="../images/mcgill.gif" width=165></td>
<td>&copy;2001-2004 Gary P. Scavone, McGill University. All Rights Reserved.<br>
Maintained by Gary P. Scavone, <a href="mailto:gary@music.mcgill.ca">gary@music.mcgill.ca</a></td></tr>
</table>
</BODY>
</HTML>

View File

@@ -1,43 +0,0 @@
<HTML>
<HEAD>
<TITLE>The RtAudio Tutorial</TITLE>
<LINK HREF="doxygen.css" REL="stylesheet" TYPE="text/css">
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<CENTER>
<a class="qindex" href="index.html">Tutorial</a> &nbsp; <a class="qindex" href="annotated.html">Class/Enum List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; </CENTER>
<HR>
<!-- Generated by Doxygen 1.3.4 -->
<h1>RtAudio Member List</h1>This is the complete list of members for <a class="el" href="classRtAudio.html">RtAudio</a>, including all inherited members.<table>
<tr class="memlist"><td><a class="el" href="classRtAudio.html#a13">abortStream</a>()</td><td><a class="el" href="classRtAudio.html">RtAudio</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classRtAudio.html#a5">cancelStreamCallback</a>()</td><td><a class="el" href="classRtAudio.html">RtAudio</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classRtAudio.html#a10">closeStream</a>()</td><td><a class="el" href="classRtAudio.html">RtAudio</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classRtAudio.html#a6">getDeviceCount</a>(void)</td><td><a class="el" href="classRtAudio.html">RtAudio</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classRtAudio.html#a7">getDeviceInfo</a>(int device)</td><td><a class="el" href="classRtAudio.html">RtAudio</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classRtAudio.html#a8">getStreamBuffer</a>()</td><td><a class="el" href="classRtAudio.html">RtAudio</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classRtAudio.html#w8w5">IRIX_AL</a> enum value</td><td><a class="el" href="classRtAudio.html">RtAudio</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classRtAudio.html#w8w1">LINUX_ALSA</a> enum value</td><td><a class="el" href="classRtAudio.html">RtAudio</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classRtAudio.html#w8w3">LINUX_JACK</a> enum value</td><td><a class="el" href="classRtAudio.html">RtAudio</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classRtAudio.html#w8w2">LINUX_OSS</a> enum value</td><td><a class="el" href="classRtAudio.html">RtAudio</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classRtAudio.html#w8w4">MACOSX_CORE</a> enum value</td><td><a class="el" href="classRtAudio.html">RtAudio</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classRtAudio.html#a3">openStream</a>(int outputDevice, int outputChannels, int inputDevice, int inputChannels, RtAudioFormat format, int sampleRate, int *bufferSize, int numberOfBuffers)</td><td><a class="el" href="classRtAudio.html">RtAudio</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classRtAudio.html#a0">RtAudio</a>(RtAudioApi api=UNSPECIFIED)</td><td><a class="el" href="classRtAudio.html">RtAudio</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classRtAudio.html#a1">RtAudio</a>(int outputDevice, int outputChannels, int inputDevice, int inputChannels, RtAudioFormat format, int sampleRate, int *bufferSize, int numberOfBuffers, RtAudioApi api=UNSPECIFIED)</td><td><a class="el" href="classRtAudio.html">RtAudio</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classRtAudio.html#w8">RtAudioApi</a> enum name</td><td><a class="el" href="classRtAudio.html">RtAudio</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classRtAudio.html#a4">setStreamCallback</a>(RtAudioCallback callback, void *userData)</td><td><a class="el" href="classRtAudio.html">RtAudio</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classRtAudio.html#a11">startStream</a>()</td><td><a class="el" href="classRtAudio.html">RtAudio</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classRtAudio.html#a12">stopStream</a>()</td><td><a class="el" href="classRtAudio.html">RtAudio</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classRtAudio.html#a9">tickStream</a>()</td><td><a class="el" href="classRtAudio.html">RtAudio</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classRtAudio.html#w8w0">UNSPECIFIED</a> enum value</td><td><a class="el" href="classRtAudio.html">RtAudio</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classRtAudio.html#w8w6">WINDOWS_ASIO</a> enum value</td><td><a class="el" href="classRtAudio.html">RtAudio</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classRtAudio.html#w8w7">WINDOWS_DS</a> enum value</td><td><a class="el" href="classRtAudio.html">RtAudio</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classRtAudio.html#a2">~RtAudio</a>()</td><td><a class="el" href="classRtAudio.html">RtAudio</a></td><td></td></tr>
</table><HR>
<table><tr><td><img src="../images/mcgill.gif" width=165></td>
<td>&copy;2001-2004 Gary P. Scavone, McGill University. All Rights Reserved.<br>
Maintained by Gary P. Scavone, <a href="mailto:gary@music.mcgill.ca">gary@music.mcgill.ca</a></td></tr>
</table>
</BODY>
</HTML>

View File

@@ -1,661 +0,0 @@
<HTML>
<HEAD>
<TITLE>The RtAudio Tutorial</TITLE>
<LINK HREF="doxygen.css" REL="stylesheet" TYPE="text/css">
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<CENTER>
<a class="qindex" href="index.html">Tutorial</a> &nbsp; <a class="qindex" href="annotated.html">Class/Enum List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; </CENTER>
<HR>
<!-- Generated by Doxygen 1.3.4 -->
<h1>RtAudio Class Reference</h1>Realtime audio i/o C++ classes.
<a href="#_details">More...</a>
<p>
<code>#include &lt;<a class="el" href="RtAudio_8h-source.html">RtAudio.h</a>&gt;</code>
<p>
<a href="classRtAudio-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Public Types</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>enum &nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classRtAudio.html#w8">RtAudioApi</a> { <br>
&nbsp;&nbsp;<a class="el" href="classRtAudio.html#w8w0">UNSPECIFIED</a>,
<a class="el" href="classRtAudio.html#w8w1">LINUX_ALSA</a>,
<a class="el" href="classRtAudio.html#w8w2">LINUX_OSS</a>,
<a class="el" href="classRtAudio.html#w8w3">LINUX_JACK</a>,
<br>
&nbsp;&nbsp;<a class="el" href="classRtAudio.html#w8w4">MACOSX_CORE</a>,
<a class="el" href="classRtAudio.html#w8w5">IRIX_AL</a>,
<a class="el" href="classRtAudio.html#w8w6">WINDOWS_ASIO</a>,
<a class="el" href="classRtAudio.html#w8w7">WINDOWS_DS</a>
<br>
}</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Audio API specifier arguments. </em> <a href="#w8">More...</a><em><br><br></td></tr>
<tr><td colspan=2><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classRtAudio.html#a0">RtAudio</a> (<a class="el" href="classRtAudio.html#w8">RtAudioApi</a> api=UNSPECIFIED)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The default class constructor. </em> <a href="#a0"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classRtAudio.html#a1">RtAudio</a> (int outputDevice, int outputChannels, int inputDevice, int inputChannels, RtAudioFormat format, int sampleRate, int *bufferSize, int numberOfBuffers, <a class="el" href="classRtAudio.html#w8">RtAudioApi</a> api=UNSPECIFIED)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">A constructor which can be used to open a stream during instantiation. </em> <a href="#a1"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classRtAudio.html#a2">~RtAudio</a> ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The destructor. </em> <a href="#a2"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classRtAudio.html#a3">openStream</a> (int outputDevice, int outputChannels, int inputDevice, int inputChannels, RtAudioFormat format, int sampleRate, int *bufferSize, int numberOfBuffers)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">A public method for opening a stream with the specified parameters. </em> <a href="#a3"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classRtAudio.html#a4">setStreamCallback</a> (RtAudioCallback callback, void *userData)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">A public method which sets a user-defined callback function for a given stream. </em> <a href="#a4"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classRtAudio.html#a5">cancelStreamCallback</a> ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">A public method which cancels a callback process and function for the stream. </em> <a href="#a5"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a6" doxytag="RtAudio::getDeviceCount" ></a>
int&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classRtAudio.html#a6">getDeviceCount</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">A public method which returns the number of audio devices found. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="structRtAudioDeviceInfo.html">RtAudioDeviceInfo</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classRtAudio.html#a7">getDeviceInfo</a> (int device)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return an <a class="el" href="structRtAudioDeviceInfo.html">RtAudioDeviceInfo</a> structure for a specified device number. </em> <a href="#a7"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>char *const &nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classRtAudio.html#a8">getStreamBuffer</a> ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">A public method which returns a pointer to the buffer for an open stream. </em> <a href="#a8"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classRtAudio.html#a9">tickStream</a> ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Public method used to trigger processing of input/output data for a stream. </em> <a href="#a9"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classRtAudio.html#a10">closeStream</a> ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Public method which closes a stream and frees any associated buffers. </em> <a href="#a10"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classRtAudio.html#a11">startStream</a> ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Public method which starts a stream. </em> <a href="#a11"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classRtAudio.html#a12">stopStream</a> ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Stop a stream, allowing any samples remaining in the queue to be played out and/or read in. </em> <a href="#a12"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classRtAudio.html#a13">abortStream</a> ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Stop a stream, discarding any samples remaining in the input/output queue. </em> <a href="#a13"></a><em><br><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
Realtime audio i/o C++ classes.
<p>
RtAudio provides a common API (Application Programming Interface) for realtime audio input/output across Linux (native ALSA, Jack, and OSS), SGI, Macintosh OS X (CoreAudio), and Windows (DirectSound and ASIO) operating systems.<p>
RtAudio WWW site: <a href="http://music.mcgill.ca/~gary/rtaudio/">http://music.mcgill.ca/~gary/rtaudio/</a><p>
RtAudio: a realtime audio i/o C++ class Copyright (c) 2001-2004 Gary P. Scavone<p>
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:<p>
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.<p>
Any person wishing to distribute modifications to the Software is requested to send the modifications to the original developer so that they can be incorporated into the canonical version.<p>
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.
<p>
<hr><h2>Member Enumeration Documentation</h2>
<a class="anchor" name="w8" doxytag="RtAudio::RtAudioApi" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> enum <a class="el" href="classRtAudio.html#w8">RtAudio::RtAudioApi</a>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Audio API specifier arguments.
<p>
<dl compact><dt><b>Enumeration values: </b></dt><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em><a class="anchor" name="w8w0" doxytag="UNSPECIFIED" ></a>UNSPECIFIED</em>&nbsp;</td><td>
Search for a working compiled API. </td></tr>
<tr><td valign=top><em><a class="anchor" name="w8w1" doxytag="LINUX_ALSA" ></a>LINUX_ALSA</em>&nbsp;</td><td>
The Advanced Linux Sound Architecture API. </td></tr>
<tr><td valign=top><em><a class="anchor" name="w8w2" doxytag="LINUX_OSS" ></a>LINUX_OSS</em>&nbsp;</td><td>
The Linux Open Sound System API. </td></tr>
<tr><td valign=top><em><a class="anchor" name="w8w3" doxytag="LINUX_JACK" ></a>LINUX_JACK</em>&nbsp;</td><td>
The Linux Jack Low-Latency Audio Server API. </td></tr>
<tr><td valign=top><em><a class="anchor" name="w8w4" doxytag="MACOSX_CORE" ></a>MACOSX_CORE</em>&nbsp;</td><td>
Macintosh OS-X Core Audio API. </td></tr>
<tr><td valign=top><em><a class="anchor" name="w8w5" doxytag="IRIX_AL" ></a>IRIX_AL</em>&nbsp;</td><td>
The Irix Audio Library API. </td></tr>
<tr><td valign=top><em><a class="anchor" name="w8w6" doxytag="WINDOWS_ASIO" ></a>WINDOWS_ASIO</em>&nbsp;</td><td>
The Steinberg Audio Stream I/O API. </td></tr>
<tr><td valign=top><em><a class="anchor" name="w8w7" doxytag="WINDOWS_DS" ></a>WINDOWS_DS</em>&nbsp;</td><td>
The Microsoft Direct Sound API. </td></tr>
</table>
</dl>
</td>
</tr>
</table>
<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" name="a0" doxytag="RtAudio::RtAudio" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> RtAudio::RtAudio </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top"><a class="el" href="classRtAudio.html#w8">RtAudioApi</a>&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>api</em> = UNSPECIFIED </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
The default class constructor.
<p>
Probes the system to make sure at least one audio input/output device is available and determines the api-specific identifier for each device found. An <a class="el" href="classRtError.html">RtError</a> error can be thrown if no devices are found or if a memory allocation error occurs.<p>
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). </td>
</tr>
</table>
<a class="anchor" name="a1" doxytag="RtAudio::RtAudio" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> RtAudio::RtAudio </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">int&nbsp;</td>
<td class="mdname" nowrap> <em>outputDevice</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>int&nbsp;</td>
<td class="mdname" nowrap> <em>outputChannels</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>int&nbsp;</td>
<td class="mdname" nowrap> <em>inputDevice</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>int&nbsp;</td>
<td class="mdname" nowrap> <em>inputChannels</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>RtAudioFormat&nbsp;</td>
<td class="mdname" nowrap> <em>format</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>int&nbsp;</td>
<td class="mdname" nowrap> <em>sampleRate</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>int *&nbsp;</td>
<td class="mdname" nowrap> <em>bufferSize</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>int&nbsp;</td>
<td class="mdname" nowrap> <em>numberOfBuffers</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap><a class="el" href="classRtAudio.html#w8">RtAudioApi</a>&nbsp;</td>
<td class="mdname" nowrap> <em>api</em> = UNSPECIFIED</td>
</tr>
<tr>
<td></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
A constructor which can be used to open a stream during instantiation.
<p>
The specified output and/or input device identifiers correspond to those enumerated via the <a class="el" href="classRtAudio.html#a7">getDeviceInfo()</a> method. If device = 0, the default or first available devices meeting the given parameters is selected. If an output or input channel value is zero, the corresponding device value is ignored. When a stream is successfully opened, its identifier is returned via the "streamId" pointer. An <a class="el" href="classRtError.html">RtError</a> can be thrown if no devices are found for the given parameters, if a memory allocation error occurs, or if a driver error occurs. <dl compact><dt><b>See also:</b></dt><dd><a class="el" href="classRtAudio.html#a3">openStream()</a> </dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="a2" doxytag="RtAudio::~RtAudio" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> RtAudio::~<a class="el" href="classRtAudio.html">RtAudio</a> </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
The destructor.
<p>
Stops and closes an open stream and devices and deallocates buffer and structure memory. </td>
</tr>
</table>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="a3" doxytag="RtAudio::openStream" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void RtAudio::openStream </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">int&nbsp;</td>
<td class="mdname" nowrap> <em>outputDevice</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>int&nbsp;</td>
<td class="mdname" nowrap> <em>outputChannels</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>int&nbsp;</td>
<td class="mdname" nowrap> <em>inputDevice</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>int&nbsp;</td>
<td class="mdname" nowrap> <em>inputChannels</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>RtAudioFormat&nbsp;</td>
<td class="mdname" nowrap> <em>format</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>int&nbsp;</td>
<td class="mdname" nowrap> <em>sampleRate</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>int *&nbsp;</td>
<td class="mdname" nowrap> <em>bufferSize</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>int&nbsp;</td>
<td class="mdname" nowrap> <em>numberOfBuffers</em></td>
</tr>
<tr>
<td></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
A public method for opening a stream with the specified parameters.
<p>
An <a class="el" href="classRtError.html">RtError</a> is thrown if a stream cannot be opened.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign=top><em>outputDevice:</em>&nbsp;</td><td>If equal to 0, the default or first device found meeting the given parameters is opened. Otherwise, the device number should correspond to one of those enumerated via the <a class="el" href="classRtAudio.html#a7">getDeviceInfo()</a> method. </td></tr>
<tr><td valign=top><em>outputChannels:</em>&nbsp;</td><td>The desired number of output channels. If equal to zero, the outputDevice identifier is ignored. </td></tr>
<tr><td valign=top><em>inputDevice:</em>&nbsp;</td><td>If equal to 0, the default or first device found meeting the given parameters is opened. Otherwise, the device number should correspond to one of those enumerated via the <a class="el" href="classRtAudio.html#a7">getDeviceInfo()</a> method. </td></tr>
<tr><td valign=top><em>inputChannels:</em>&nbsp;</td><td>The desired number of input channels. If equal to zero, the inputDevice identifier is ignored. </td></tr>
<tr><td valign=top><em>format:</em>&nbsp;</td><td>An RtAudioFormat specifying the desired sample data format. </td></tr>
<tr><td valign=top><em>sampleRate:</em>&nbsp;</td><td>The desired sample rate (sample frames per second). </td></tr>
<tr><td valign=top><em>*bufferSize:</em>&nbsp;</td><td>A pointer value indicating the desired internal buffer size in sample frames. The actual value used by the device is returned via the same pointer. A value of zero can be specified, in which case the lowest allowable value is determined. </td></tr>
<tr><td valign=top><em>numberOfBuffers:</em>&nbsp;</td><td>A value which can be used to help control device latency. More buffers typically result in more robust performance, though at a cost of greater latency. A value of zero can be specified, in which case the lowest allowable value is used. </td></tr>
</table>
</dl>
</td>
</tr>
</table>
<a class="anchor" name="a4" doxytag="RtAudio::setStreamCallback" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void RtAudio::setStreamCallback </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">RtAudioCallback&nbsp;</td>
<td class="mdname" nowrap> <em>callback</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>void *&nbsp;</td>
<td class="mdname" nowrap> <em>userData</em></td>
</tr>
<tr>
<td></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"><code> [inline]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
A public method which sets a user-defined callback function for a given stream.
<p>
This method assigns a callback function to a previously opened stream for non-blocking stream functionality. A separate process is initiated, though the user function is called only when the stream is "running" (between calls to the <a class="el" href="classRtAudio.html#a11">startStream()</a> and <a class="el" href="classRtAudio.html#a12">stopStream()</a> methods, respectively). The callback process remains active for the duration of the stream and is automatically shutdown when the stream is closed (via the <a class="el" href="classRtAudio.html#a10">closeStream()</a> method or by object destruction). The callback process can also be shutdown and the user function de-referenced through an explicit call to the <a class="el" href="classRtAudio.html#a5">cancelStreamCallback()</a> method. Note that the stream can use only blocking or callback functionality at a particular time, though it is possible to alternate modes on the same stream through the use of the <a class="el" href="classRtAudio.html#a4">setStreamCallback()</a> and <a class="el" href="classRtAudio.html#a5">cancelStreamCallback()</a> methods (the blocking <a class="el" href="classRtAudio.html#a9">tickStream()</a> method can be used before a callback is set and/or after a callback is cancelled). An <a class="el" href="classRtError.html">RtError</a> will be thrown if called when no stream is open or a thread errors occurs. </td>
</tr>
</table>
<a class="anchor" name="a5" doxytag="RtAudio::cancelStreamCallback" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void RtAudio::cancelStreamCallback </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap><code> [inline]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
A public method which cancels a callback process and function for the stream.
<p>
This method shuts down a callback process and de-references the user function for the stream. Callback functionality can subsequently be restarted on the stream via the <a class="el" href="classRtAudio.html#a4">setStreamCallback()</a> method. An <a class="el" href="classRtError.html">RtError</a> will be thrown if called when no stream is open. </td>
</tr>
</table>
<a class="anchor" name="a7" doxytag="RtAudio::getDeviceInfo" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="structRtAudioDeviceInfo.html">RtAudioDeviceInfo</a> RtAudio::getDeviceInfo </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">int&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>device</em> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap><code> [inline]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Return an <a class="el" href="structRtAudioDeviceInfo.html">RtAudioDeviceInfo</a> structure for a specified device number.
<p>
Any device integer between 1 and <a class="el" href="classRtAudio.html#a6">getDeviceCount()</a> is valid. If a device is busy or otherwise unavailable, the structure member "probed" will have a value of "false" and all other members are undefined. If the specified device is the current default input or output device, the "isDefault" member will have a value of "true". An <a class="el" href="classRtError.html">RtError</a> will be thrown for an invalid device argument. </td>
</tr>
</table>
<a class="anchor" name="a8" doxytag="RtAudio::getStreamBuffer" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> char* const RtAudio::getStreamBuffer </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap><code> [inline]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
A public method which returns a pointer to the buffer for an open stream.
<p>
The user should fill and/or read the buffer data in interleaved format and then call the <a class="el" href="classRtAudio.html#a9">tickStream()</a> method. An <a class="el" href="classRtError.html">RtError</a> will be thrown if called when no stream is open. </td>
</tr>
</table>
<a class="anchor" name="a9" doxytag="RtAudio::tickStream" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void RtAudio::tickStream </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap><code> [inline]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Public method used to trigger processing of input/output data for a stream.
<p>
This method blocks until all buffer data is read/written. An <a class="el" href="classRtError.html">RtError</a> will be thrown if a driver error occurs or if called when no stream is open. </td>
</tr>
</table>
<a class="anchor" name="a10" doxytag="RtAudio::closeStream" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void RtAudio::closeStream </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap><code> [inline]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Public method which closes a stream and frees any associated buffers.
<p>
If a stream is not open, this method issues a warning and returns (an <a class="el" href="classRtError.html">RtError</a> is not thrown). </td>
</tr>
</table>
<a class="anchor" name="a11" doxytag="RtAudio::startStream" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void RtAudio::startStream </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap><code> [inline]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Public method which starts a stream.
<p>
An <a class="el" href="classRtError.html">RtError</a> will be thrown if a driver error occurs or if called when no stream is open. </td>
</tr>
</table>
<a class="anchor" name="a12" doxytag="RtAudio::stopStream" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void RtAudio::stopStream </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap><code> [inline]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Stop a stream, allowing any samples remaining in the queue to be played out and/or read in.
<p>
An <a class="el" href="classRtError.html">RtError</a> will be thrown if a driver error occurs or if called when no stream is open. </td>
</tr>
</table>
<a class="anchor" name="a13" doxytag="RtAudio::abortStream" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void RtAudio::abortStream </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap><code> [inline]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Stop a stream, discarding any samples remaining in the input/output queue.
<p>
An <a class="el" href="classRtError.html">RtError</a> will be thrown if a driver error occurs or if called when no stream is open. </td>
</tr>
</table>
<hr>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="RtAudio_8h-source.html">RtAudio.h</a></ul>
<HR>
<table><tr><td><img src="../images/mcgill.gif" width=165></td>
<td>&copy;2001-2004 Gary P. Scavone, McGill University. All Rights Reserved.<br>
Maintained by Gary P. Scavone, <a href="mailto:gary@music.mcgill.ca">gary@music.mcgill.ca</a></td></tr>
</table>
</BODY>
</HTML>

View File

@@ -1,38 +0,0 @@
<HTML>
<HEAD>
<TITLE>The RtAudio Tutorial</TITLE>
<LINK HREF="doxygen.css" REL="stylesheet" TYPE="text/css">
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<CENTER>
<a class="qindex" href="index.html">Tutorial</a> &nbsp; <a class="qindex" href="annotated.html">Class/Enum List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; </CENTER>
<HR>
<!-- Generated by Doxygen 1.3.4 -->
<h1>RtError Member List</h1>This is the complete list of members for <a class="el" href="classRtError.html">RtError</a>, including all inherited members.<table>
<tr class="memlist"><td><a class="el" href="classRtError.html#w11w1">DEBUG_WARNING</a> enum value</td><td><a class="el" href="classRtError.html">RtError</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classRtError.html#w11w8">DRIVER_ERROR</a> enum value</td><td><a class="el" href="classRtError.html">RtError</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classRtError.html#a4">getMessage</a>(void)</td><td><a class="el" href="classRtError.html">RtError</a></td><td><code> [inline, virtual]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classRtError.html#a5">getMessageString</a>(void)</td><td><a class="el" href="classRtError.html">RtError</a></td><td><code> [inline, virtual]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classRtError.html#a3">getType</a>(void)</td><td><a class="el" href="classRtError.html">RtError</a></td><td><code> [inline, virtual]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classRtError.html#w11w4">INVALID_DEVICE</a> enum value</td><td><a class="el" href="classRtError.html">RtError</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classRtError.html#w11w7">INVALID_PARAMETER</a> enum value</td><td><a class="el" href="classRtError.html">RtError</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classRtError.html#w11w5">INVALID_STREAM</a> enum value</td><td><a class="el" href="classRtError.html">RtError</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classRtError.html#w11w6">MEMORY_ERROR</a> enum value</td><td><a class="el" href="classRtError.html">RtError</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classRtError.html#w11w3">NO_DEVICES_FOUND</a> enum value</td><td><a class="el" href="classRtError.html">RtError</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classRtError.html#a2">printMessage</a>(void)</td><td><a class="el" href="classRtError.html">RtError</a></td><td><code> [inline, virtual]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classRtError.html#a0">RtError</a>(const std::string &amp;message, Type type=RtError::UNSPECIFIED)</td><td><a class="el" href="classRtError.html">RtError</a></td><td><code> [inline]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classRtError.html#w11w9">SYSTEM_ERROR</a> enum value</td><td><a class="el" href="classRtError.html">RtError</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classRtError.html#w11w10">THREAD_ERROR</a> enum value</td><td><a class="el" href="classRtError.html">RtError</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classRtError.html#w11">Type</a> enum name</td><td><a class="el" href="classRtError.html">RtError</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classRtError.html#w11w2">UNSPECIFIED</a> enum value</td><td><a class="el" href="classRtError.html">RtError</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classRtError.html#w11w0">WARNING</a> enum value</td><td><a class="el" href="classRtError.html">RtError</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classRtError.html#a1">~RtError</a>(void)</td><td><a class="el" href="classRtError.html">RtError</a></td><td><code> [inline, virtual]</code></td></tr>
</table><HR>
<table><tr><td><img src="../images/mcgill.gif" width=165></td>
<td>&copy;2001-2004 Gary P. Scavone, McGill University. All Rights Reserved.<br>
Maintained by Gary P. Scavone, <a href="mailto:gary@music.mcgill.ca">gary@music.mcgill.ca</a></td></tr>
</table>
</BODY>
</HTML>

View File

@@ -1,129 +0,0 @@
<HTML>
<HEAD>
<TITLE>The RtAudio Tutorial</TITLE>
<LINK HREF="doxygen.css" REL="stylesheet" TYPE="text/css">
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<CENTER>
<a class="qindex" href="index.html">Tutorial</a> &nbsp; <a class="qindex" href="annotated.html">Class/Enum List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; </CENTER>
<HR>
<!-- Generated by Doxygen 1.3.4 -->
<h1>RtError Class Reference</h1>Exception handling class for <a class="el" href="classRtAudio.html">RtAudio</a> &amp; RtMidi.
<a href="#_details">More...</a>
<p>
<code>#include &lt;<a class="el" href="RtError_8h-source.html">RtError.h</a>&gt;</code>
<p>
<a href="classRtError-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Public Types</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>enum &nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classRtError.html#w11">Type</a> { <br>
&nbsp;&nbsp;<a class="el" href="classRtError.html#w11w0">WARNING</a>,
<a class="el" href="classRtError.html#w11w1">DEBUG_WARNING</a>,
<a class="el" href="classRtError.html#w11w2">UNSPECIFIED</a>,
<a class="el" href="classRtError.html#w11w3">NO_DEVICES_FOUND</a>,
<br>
&nbsp;&nbsp;<a class="el" href="classRtError.html#w11w4">INVALID_DEVICE</a>,
<a class="el" href="classRtError.html#w11w5">INVALID_STREAM</a>,
<a class="el" href="classRtError.html#w11w6">MEMORY_ERROR</a>,
<a class="el" href="classRtError.html#w11w7">INVALID_PARAMETER</a>,
<br>
&nbsp;&nbsp;<a class="el" href="classRtError.html#w11w8">DRIVER_ERROR</a>,
<a class="el" href="classRtError.html#w11w9">SYSTEM_ERROR</a>,
<a class="el" href="classRtError.html#w11w10">THREAD_ERROR</a>
<br>
}</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Defined RtError types. </em> <a href="#w11">More...</a><em><br><br></td></tr>
<tr><td colspan=2><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a0" doxytag="RtError::RtError" ></a>
&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classRtError.html#a0">RtError</a> (const std::string &amp;message, <a class="el" href="classRtError.html#w11">Type</a> type=RtError::UNSPECIFIED)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The constructor. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a1" doxytag="RtError::~RtError" ></a>
virtual&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classRtError.html#a1">~RtError</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The destructor. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a2" doxytag="RtError::printMessage" ></a>
virtual void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classRtError.html#a2">printMessage</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Prints thrown error message to stderr. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a3" doxytag="RtError::getType" ></a>
virtual const <a class="el" href="classRtError.html#w11">Type</a> &amp;&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classRtError.html#a3">getType</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the thrown error message type. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a4" doxytag="RtError::getMessage" ></a>
virtual const std::string &amp;&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classRtError.html#a4">getMessage</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the thrown error message string. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a5" doxytag="RtError::getMessageString" ></a>
virtual const char *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classRtError.html#a5">getMessageString</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the thrown error message as a C string. <br><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
Exception handling class for <a class="el" href="classRtAudio.html">RtAudio</a> &amp; RtMidi.
<p>
The RtError class is quite simple but it does allow errors to be "caught" by <a class="el" href="classRtError.html#w11">RtError::Type</a>. See the <a class="el" href="classRtAudio.html">RtAudio</a> and RtMidi documentation to know which methods can throw an RtError.
<p>
<hr><h2>Member Enumeration Documentation</h2>
<a class="anchor" name="w11" doxytag="RtError::Type" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> enum <a class="el" href="classRtError.html#w11">RtError::Type</a>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Defined RtError types.
<p>
<dl compact><dt><b>Enumeration values: </b></dt><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em><a class="anchor" name="w11w0" doxytag="WARNING" ></a>WARNING</em>&nbsp;</td><td>
A non-critical error. </td></tr>
<tr><td valign=top><em><a class="anchor" name="w11w1" doxytag="DEBUG_WARNING" ></a>DEBUG_WARNING</em>&nbsp;</td><td>
A non-critical error which might be useful for debugging. </td></tr>
<tr><td valign=top><em><a class="anchor" name="w11w2" doxytag="UNSPECIFIED" ></a>UNSPECIFIED</em>&nbsp;</td><td>
The default, unspecified error type. </td></tr>
<tr><td valign=top><em><a class="anchor" name="w11w3" doxytag="NO_DEVICES_FOUND" ></a>NO_DEVICES_FOUND</em>&nbsp;</td><td>
No devices found on system. </td></tr>
<tr><td valign=top><em><a class="anchor" name="w11w4" doxytag="INVALID_DEVICE" ></a>INVALID_DEVICE</em>&nbsp;</td><td>
An invalid device ID was specified. </td></tr>
<tr><td valign=top><em><a class="anchor" name="w11w5" doxytag="INVALID_STREAM" ></a>INVALID_STREAM</em>&nbsp;</td><td>
An invalid stream ID was specified. </td></tr>
<tr><td valign=top><em><a class="anchor" name="w11w6" doxytag="MEMORY_ERROR" ></a>MEMORY_ERROR</em>&nbsp;</td><td>
An error occured during memory allocation. </td></tr>
<tr><td valign=top><em><a class="anchor" name="w11w7" doxytag="INVALID_PARAMETER" ></a>INVALID_PARAMETER</em>&nbsp;</td><td>
An invalid parameter was specified to a function. </td></tr>
<tr><td valign=top><em><a class="anchor" name="w11w8" doxytag="DRIVER_ERROR" ></a>DRIVER_ERROR</em>&nbsp;</td><td>
A system driver error occured. </td></tr>
<tr><td valign=top><em><a class="anchor" name="w11w9" doxytag="SYSTEM_ERROR" ></a>SYSTEM_ERROR</em>&nbsp;</td><td>
A system error occured. </td></tr>
<tr><td valign=top><em><a class="anchor" name="w11w10" doxytag="THREAD_ERROR" ></a>THREAD_ERROR</em>&nbsp;</td><td>
A thread error occured. </td></tr>
</table>
</dl>
</td>
</tr>
</table>
<hr>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="RtError_8h-source.html">RtError.h</a></ul>
<HR>
<table><tr><td><img src="../images/mcgill.gif" width=165></td>
<td>&copy;2001-2004 Gary P. Scavone, McGill University. All Rights Reserved.<br>
Maintained by Gary P. Scavone, <a href="mailto:gary@music.mcgill.ca">gary@music.mcgill.ca</a></td></tr>
</table>
</BODY>
</HTML>

View File

@@ -1,169 +0,0 @@
H1 {
text-align: center;
font-family: Arial, Helvetica, sans-serif;
}
H2 {
font-family: Geneva, Arial, Helvetica, sans-serif;
}
CAPTION { font-weight: bold }
DIV.qindex { width: 100%;
background-color: #eeeeff;
border: 4px solid #eeeeff;
text-align: center;
margin-bottom: 2px
}
A.qindex { text-decoration: none; font-weight: bold; color: #0000ee }
A.qindex:visited { text-decoration: none; font-weight: bold; color: #0000ee }
A.qindex:hover { text-decoration: none; background-color: #ddddff }
A.qindexHL { text-decoration: none; font-weight: bold;
background-color: #6666cc;
color: #ffffff
}
A.qindexHL:hover { text-decoration: none; background-color: #6666cc; color: #ffffff }
A.qindexHL:visited { text-decoration: none; background-color: #6666cc; color: #ffffff }
A.el { text-decoration: none; font-weight: bold }
A.elRef { font-weight: bold }
A.code { text-decoration: none; font-weight: normal; color: #4444ee }
A.codeRef { font-weight: normal; color: #4444ee }
A:hover { text-decoration: none; background-color: #f2f2ff }
DL.el { margin-left: -1cm }
DIV.fragment {
width: 98%;
border: 1px solid #CCCCCC;
background-color: #f5f5f5;
padding-left: 4px;
margin: 4px;
}
DIV.ah { background-color: black; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px }
TD.md { background-color: #f2f2ff; font-weight: bold; }
TD.mdname1 { background-color: #f2f2ff; font-weight: bold; color: #602020; }
TD.mdname { background-color: #f2f2ff; font-weight: bold; color: #602020; width: 600px; }
DIV.groupHeader { margin-left: 16px; margin-top: 12px; margin-bottom: 6px; font-weight: bold }
DIV.groupText { margin-left: 16px; font-style: italic; font-size: smaller }
BODY {
background: white;
color: black;
margin-right: 20px;
margin-left: 20px;
}
TD.indexkey {
background-color: #eeeeff;
font-weight: bold;
padding-right : 10px;
padding-top : 2px;
padding-left : 10px;
padding-bottom : 2px;
margin-left : 0px;
margin-right : 0px;
margin-top : 2px;
margin-bottom : 2px
}
TD.indexvalue {
background-color: #eeeeff;
font-style: italic;
padding-right : 10px;
padding-top : 2px;
padding-left : 10px;
padding-bottom : 2px;
margin-left : 0px;
margin-right : 0px;
margin-top : 2px;
margin-bottom : 2px
}
TR.memlist {
background-color: #f0f0f0;
}
P.formulaDsp { text-align: center; }
IMG.formulaDsp { }
IMG.formulaInl { vertical-align: middle; }
SPAN.keyword { color: #008000 }
SPAN.keywordtype { color: #604020 }
SPAN.keywordflow { color: #e08000 }
SPAN.comment { color: #800000 }
SPAN.preprocessor { color: #806020 }
SPAN.stringliteral { color: #002080 }
SPAN.charliteral { color: #008080 }
.mdTable {
border: 1px solid #868686;
background-color: #f2f2ff;
}
.mdRow {
padding: 8px 20px;
}
.mdescLeft {
font-size: smaller;
font-family: Arial, Helvetica, sans-serif;
background-color: #FAFAFA;
padding-left: 8px;
border-top: 1px none #E0E0E0;
border-right: 1px none #E0E0E0;
border-bottom: 1px none #E0E0E0;
border-left: 1px none #E0E0E0;
margin: 0px;
}
.mdescRight {
font-size: smaller;
font-family: Arial, Helvetica, sans-serif;
font-style: italic;
background-color: #FAFAFA;
padding-left: 4px;
border-top: 1px none #E0E0E0;
border-right: 1px none #E0E0E0;
border-bottom: 1px none #E0E0E0;
border-left: 1px none #E0E0E0;
margin: 0px;
padding-bottom: 0px;
padding-right: 8px;
}
.memItemLeft {
padding: 1px 0px 0px 8px;
margin: 4px;
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-top-style: solid;
border-top-color: #E0E0E0;
border-right-color: #E0E0E0;
border-bottom-color: #E0E0E0;
border-left-color: #E0E0E0;
border-right-style: none;
border-bottom-style: none;
border-left-style: none;
background-color: #FAFAFA;
font-family: Geneva, Arial, Helvetica, sans-serif;
font-size: 12px;
}
.memItemRight {
padding: 1px 0px 0px 8px;
margin: 4px;
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-top-style: solid;
border-top-color: #E0E0E0;
border-right-color: #E0E0E0;
border-bottom-color: #E0E0E0;
border-left-color: #E0E0E0;
border-right-style: none;
border-bottom-style: none;
border-left-style: none;
background-color: #FAFAFA;
font-family: Geneva, Arial, Helvetica, sans-serif;
font-size: 13px;
}
.search { color: #0000ee;
font-weight: bold;
}
FORM.search {
margin-bottom: 0px;
margin-top: 0px;
}
INPUT.search { font-size: 75%;
color: #000080;
font-weight: normal;
background-color: #eeeeff;
}
TD.tiny { font-size: 75%;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

View File

@@ -1,23 +0,0 @@
<HTML>
<HEAD>
<TITLE>The RtAudio Tutorial</TITLE>
<LINK HREF="doxygen.css" REL="stylesheet" TYPE="text/css">
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<CENTER>
<a class="qindex" href="index.html">Tutorial</a> &nbsp; <a class="qindex" href="annotated.html">Class/Enum List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; </CENTER>
<HR>
<!-- Generated by Doxygen 1.3.4 -->
<h1>RtAudio File List</h1>Here is a list of all documented files with brief descriptions:<table>
<tr><td class="indexkey"><b>RtAudio.h</b> <a href="RtAudio_8h-source.html">[code]</a></td><td class="indexvalue"></td></tr>
<tr><td class="indexkey"><b>RtError.h</b> <a href="RtError_8h-source.html">[code]</a></td><td class="indexvalue"></td></tr>
</table>
<HR>
<table><tr><td><img src="../images/mcgill.gif" width=165></td>
<td>&copy;2001-2004 Gary P. Scavone, McGill University. All Rights Reserved.<br>
Maintained by Gary P. Scavone, <a href="mailto:gary@music.mcgill.ca">gary@music.mcgill.ca</a></td></tr>
</table>
</BODY>
</HTML>

View File

@@ -1,104 +0,0 @@
<HTML>
<HEAD>
<TITLE>The RtAudio Tutorial</TITLE>
<LINK HREF="doxygen.css" REL="stylesheet" TYPE="text/css">
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<CENTER>
<a class="qindex" href="index.html">Tutorial</a> &nbsp; <a class="qindex" href="annotated.html">Class/Enum List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; </CENTER>
<HR>
<!-- Generated by Doxygen 1.3.4 -->
<div class="qindex"><a class="qindexHL" href="functions.html">All</a> | <a class="qindex" href="functions_func.html">Functions</a> | <a class="qindex" href="functions_vars.html">Variables</a> | <a class="qindex" href="functions_enum.html">Enumerations</a> | <a class="qindex" href="functions_eval.html">Enumeration&nbsp;values</a></div>
<div class="qindex"><a class="qindex" href="#index_a">a</a> | <a class="qindex" href="#index_c">c</a> | <a class="qindex" href="#index_d">d</a> | <a class="qindex" href="#index_g">g</a> | <a class="qindex" href="#index_i">i</a> | <a class="qindex" href="#index_l">l</a> | <a class="qindex" href="#index_m">m</a> | <a class="qindex" href="#index_n">n</a> | <a class="qindex" href="#index_o">o</a> | <a class="qindex" href="#index_p">p</a> | <a class="qindex" href="#index_r">r</a> | <a class="qindex" href="#index_s">s</a> | <a class="qindex" href="#index_t">t</a> | <a class="qindex" href="#index_u">u</a> | <a class="qindex" href="#index_w">w</a> | <a class="qindex" href="#index_~">~</a></div>
<p>
<p>
Here is a list of all documented class members with links to the class documentation for each member:<h3><a class="anchor" name="index_a">- a -</a></h3><ul>
<li>abortStream()
: <a class="el" href="classRtAudio.html#a13">RtAudio</a></ul>
<h3><a class="anchor" name="index_c">- c -</a></h3><ul>
<li>cancelStreamCallback()
: <a class="el" href="classRtAudio.html#a5">RtAudio</a><li>closeStream()
: <a class="el" href="classRtAudio.html#a10">RtAudio</a></ul>
<h3><a class="anchor" name="index_d">- d -</a></h3><ul>
<li>DEBUG_WARNING
: <a class="el" href="classRtError.html#w11w1">RtError</a><li>DRIVER_ERROR
: <a class="el" href="classRtError.html#w11w8">RtError</a><li>duplexChannels
: <a class="el" href="structRtAudioDeviceInfo.html#o4">RtAudioDeviceInfo</a></ul>
<h3><a class="anchor" name="index_g">- g -</a></h3><ul>
<li>getDeviceCount()
: <a class="el" href="classRtAudio.html#a6">RtAudio</a><li>getDeviceInfo()
: <a class="el" href="classRtAudio.html#a7">RtAudio</a><li>getMessage()
: <a class="el" href="classRtError.html#a4">RtError</a><li>getMessageString()
: <a class="el" href="classRtError.html#a5">RtError</a><li>getStreamBuffer()
: <a class="el" href="classRtAudio.html#a8">RtAudio</a><li>getType()
: <a class="el" href="classRtError.html#a3">RtError</a></ul>
<h3><a class="anchor" name="index_i">- i -</a></h3><ul>
<li>inputChannels
: <a class="el" href="structRtAudioDeviceInfo.html#o3">RtAudioDeviceInfo</a><li>INVALID_DEVICE
: <a class="el" href="classRtError.html#w11w4">RtError</a><li>INVALID_PARAMETER
: <a class="el" href="classRtError.html#w11w7">RtError</a><li>INVALID_STREAM
: <a class="el" href="classRtError.html#w11w5">RtError</a><li>IRIX_AL
: <a class="el" href="classRtAudio.html#w8w5">RtAudio</a><li>isDefault
: <a class="el" href="structRtAudioDeviceInfo.html#o5">RtAudioDeviceInfo</a></ul>
<h3><a class="anchor" name="index_l">- l -</a></h3><ul>
<li>LINUX_ALSA
: <a class="el" href="classRtAudio.html#w8w1">RtAudio</a><li>LINUX_JACK
: <a class="el" href="classRtAudio.html#w8w3">RtAudio</a><li>LINUX_OSS
: <a class="el" href="classRtAudio.html#w8w2">RtAudio</a></ul>
<h3><a class="anchor" name="index_m">- m -</a></h3><ul>
<li>MACOSX_CORE
: <a class="el" href="classRtAudio.html#w8w4">RtAudio</a><li>MEMORY_ERROR
: <a class="el" href="classRtError.html#w11w6">RtError</a></ul>
<h3><a class="anchor" name="index_n">- n -</a></h3><ul>
<li>name
: <a class="el" href="structRtAudioDeviceInfo.html#o0">RtAudioDeviceInfo</a><li>nativeFormats
: <a class="el" href="structRtAudioDeviceInfo.html#o7">RtAudioDeviceInfo</a><li>NO_DEVICES_FOUND
: <a class="el" href="classRtError.html#w11w3">RtError</a></ul>
<h3><a class="anchor" name="index_o">- o -</a></h3><ul>
<li>openStream()
: <a class="el" href="classRtAudio.html#a3">RtAudio</a><li>outputChannels
: <a class="el" href="structRtAudioDeviceInfo.html#o2">RtAudioDeviceInfo</a></ul>
<h3><a class="anchor" name="index_p">- p -</a></h3><ul>
<li>printMessage()
: <a class="el" href="classRtError.html#a2">RtError</a><li>probed
: <a class="el" href="structRtAudioDeviceInfo.html#o1">RtAudioDeviceInfo</a></ul>
<h3><a class="anchor" name="index_r">- r -</a></h3><ul>
<li>RtAudio()
: <a class="el" href="classRtAudio.html#a1">RtAudio</a><li>RtAudioApi
: <a class="el" href="classRtAudio.html#w8">RtAudio</a><li>RtError()
: <a class="el" href="classRtError.html#a0">RtError</a></ul>
<h3><a class="anchor" name="index_s">- s -</a></h3><ul>
<li>sampleRates
: <a class="el" href="structRtAudioDeviceInfo.html#o6">RtAudioDeviceInfo</a><li>setStreamCallback()
: <a class="el" href="classRtAudio.html#a4">RtAudio</a><li>startStream()
: <a class="el" href="classRtAudio.html#a11">RtAudio</a><li>stopStream()
: <a class="el" href="classRtAudio.html#a12">RtAudio</a><li>SYSTEM_ERROR
: <a class="el" href="classRtError.html#w11w9">RtError</a></ul>
<h3><a class="anchor" name="index_t">- t -</a></h3><ul>
<li>THREAD_ERROR
: <a class="el" href="classRtError.html#w11w10">RtError</a><li>tickStream()
: <a class="el" href="classRtAudio.html#a9">RtAudio</a><li>Type
: <a class="el" href="classRtError.html#w11">RtError</a></ul>
<h3><a class="anchor" name="index_u">- u -</a></h3><ul>
<li>UNSPECIFIED
: <a class="el" href="classRtError.html#w11w2">RtError</a>, <a class="el" href="classRtAudio.html#w8w0">RtAudio</a></ul>
<h3><a class="anchor" name="index_w">- w -</a></h3><ul>
<li>WARNING
: <a class="el" href="classRtError.html#w11w0">RtError</a><li>WINDOWS_ASIO
: <a class="el" href="classRtAudio.html#w8w6">RtAudio</a><li>WINDOWS_DS
: <a class="el" href="classRtAudio.html#w8w7">RtAudio</a></ul>
<h3><a class="anchor" name="index_~">- ~ -</a></h3><ul>
<li>~RtAudio()
: <a class="el" href="classRtAudio.html#a2">RtAudio</a><li>~RtError()
: <a class="el" href="classRtError.html#a1">RtError</a></ul>
<HR>
<table><tr><td><img src="../images/mcgill.gif" width=165></td>
<td>&copy;2001-2004 Gary P. Scavone, McGill University. All Rights Reserved.<br>
Maintained by Gary P. Scavone, <a href="mailto:gary@music.mcgill.ca">gary@music.mcgill.ca</a></td></tr>
</table>
</BODY>
</HTML>

View File

@@ -1,26 +0,0 @@
<HTML>
<HEAD>
<TITLE>The RtAudio Tutorial</TITLE>
<LINK HREF="doxygen.css" REL="stylesheet" TYPE="text/css">
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<CENTER>
<a class="qindex" href="index.html">Tutorial</a> &nbsp; <a class="qindex" href="annotated.html">Class/Enum List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; </CENTER>
<HR>
<!-- Generated by Doxygen 1.3.4 -->
<div class="qindex"><a class="qindex" href="functions.html">All</a> | <a class="qindex" href="functions_func.html">Functions</a> | <a class="qindex" href="functions_vars.html">Variables</a> | <a class="qindexHL" href="functions_enum.html">Enumerations</a> | <a class="qindex" href="functions_eval.html">Enumeration&nbsp;values</a></div>
<p>
<ul>
<li>RtAudioApi
: <a class="el" href="classRtAudio.html#w8">RtAudio</a><li>Type
: <a class="el" href="classRtError.html#w11">RtError</a></ul>
<HR>
<table><tr><td><img src="../images/mcgill.gif" width=165></td>
<td>&copy;2001-2004 Gary P. Scavone, McGill University. All Rights Reserved.<br>
Maintained by Gary P. Scavone, <a href="mailto:gary@music.mcgill.ca">gary@music.mcgill.ca</a></td></tr>
</table>
</BODY>
</HTML>

View File

@@ -1,42 +0,0 @@
<HTML>
<HEAD>
<TITLE>The RtAudio Tutorial</TITLE>
<LINK HREF="doxygen.css" REL="stylesheet" TYPE="text/css">
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<CENTER>
<a class="qindex" href="index.html">Tutorial</a> &nbsp; <a class="qindex" href="annotated.html">Class/Enum List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; </CENTER>
<HR>
<!-- Generated by Doxygen 1.3.4 -->
<div class="qindex"><a class="qindex" href="functions.html">All</a> | <a class="qindex" href="functions_func.html">Functions</a> | <a class="qindex" href="functions_vars.html">Variables</a> | <a class="qindex" href="functions_enum.html">Enumerations</a> | <a class="qindexHL" href="functions_eval.html">Enumeration&nbsp;values</a></div>
<p>
<ul>
<li>DEBUG_WARNING
: <a class="el" href="classRtError.html#w11w1">RtError</a><li>DRIVER_ERROR
: <a class="el" href="classRtError.html#w11w8">RtError</a><li>INVALID_DEVICE
: <a class="el" href="classRtError.html#w11w4">RtError</a><li>INVALID_PARAMETER
: <a class="el" href="classRtError.html#w11w7">RtError</a><li>INVALID_STREAM
: <a class="el" href="classRtError.html#w11w5">RtError</a><li>IRIX_AL
: <a class="el" href="classRtAudio.html#w8w5">RtAudio</a><li>LINUX_ALSA
: <a class="el" href="classRtAudio.html#w8w1">RtAudio</a><li>LINUX_JACK
: <a class="el" href="classRtAudio.html#w8w3">RtAudio</a><li>LINUX_OSS
: <a class="el" href="classRtAudio.html#w8w2">RtAudio</a><li>MACOSX_CORE
: <a class="el" href="classRtAudio.html#w8w4">RtAudio</a><li>MEMORY_ERROR
: <a class="el" href="classRtError.html#w11w6">RtError</a><li>NO_DEVICES_FOUND
: <a class="el" href="classRtError.html#w11w3">RtError</a><li>SYSTEM_ERROR
: <a class="el" href="classRtError.html#w11w9">RtError</a><li>THREAD_ERROR
: <a class="el" href="classRtError.html#w11w10">RtError</a><li>UNSPECIFIED
: <a class="el" href="classRtError.html#w11w2">RtError</a>, <a class="el" href="classRtAudio.html#w8w0">RtAudio</a><li>WARNING
: <a class="el" href="classRtError.html#w11w0">RtError</a><li>WINDOWS_ASIO
: <a class="el" href="classRtAudio.html#w8w6">RtAudio</a><li>WINDOWS_DS
: <a class="el" href="classRtAudio.html#w8w7">RtAudio</a></ul>
<HR>
<table><tr><td><img src="../images/mcgill.gif" width=165></td>
<td>&copy;2001-2004 Gary P. Scavone, McGill University. All Rights Reserved.<br>
Maintained by Gary P. Scavone, <a href="mailto:gary@music.mcgill.ca">gary@music.mcgill.ca</a></td></tr>
</table>
</BODY>
</HTML>

View File

@@ -1,43 +0,0 @@
<HTML>
<HEAD>
<TITLE>The RtAudio Tutorial</TITLE>
<LINK HREF="doxygen.css" REL="stylesheet" TYPE="text/css">
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<CENTER>
<a class="qindex" href="index.html">Tutorial</a> &nbsp; <a class="qindex" href="annotated.html">Class/Enum List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; </CENTER>
<HR>
<!-- Generated by Doxygen 1.3.4 -->
<div class="qindex"><a class="qindex" href="functions.html">All</a> | <a class="qindexHL" href="functions_func.html">Functions</a> | <a class="qindex" href="functions_vars.html">Variables</a> | <a class="qindex" href="functions_enum.html">Enumerations</a> | <a class="qindex" href="functions_eval.html">Enumeration&nbsp;values</a></div>
<p>
<ul>
<li>abortStream()
: <a class="el" href="classRtAudio.html#a13">RtAudio</a><li>cancelStreamCallback()
: <a class="el" href="classRtAudio.html#a5">RtAudio</a><li>closeStream()
: <a class="el" href="classRtAudio.html#a10">RtAudio</a><li>getDeviceCount()
: <a class="el" href="classRtAudio.html#a6">RtAudio</a><li>getDeviceInfo()
: <a class="el" href="classRtAudio.html#a7">RtAudio</a><li>getMessage()
: <a class="el" href="classRtError.html#a4">RtError</a><li>getMessageString()
: <a class="el" href="classRtError.html#a5">RtError</a><li>getStreamBuffer()
: <a class="el" href="classRtAudio.html#a8">RtAudio</a><li>getType()
: <a class="el" href="classRtError.html#a3">RtError</a><li>openStream()
: <a class="el" href="classRtAudio.html#a3">RtAudio</a><li>printMessage()
: <a class="el" href="classRtError.html#a2">RtError</a><li>RtAudio()
: <a class="el" href="classRtAudio.html#a1">RtAudio</a><li>RtError()
: <a class="el" href="classRtError.html#a0">RtError</a><li>setStreamCallback()
: <a class="el" href="classRtAudio.html#a4">RtAudio</a><li>startStream()
: <a class="el" href="classRtAudio.html#a11">RtAudio</a><li>stopStream()
: <a class="el" href="classRtAudio.html#a12">RtAudio</a><li>tickStream()
: <a class="el" href="classRtAudio.html#a9">RtAudio</a><li>~RtAudio()
: <a class="el" href="classRtAudio.html#a2">RtAudio</a><li>~RtError()
: <a class="el" href="classRtError.html#a1">RtError</a></ul>
<HR>
<table><tr><td><img src="../images/mcgill.gif" width=165></td>
<td>&copy;2001-2004 Gary P. Scavone, McGill University. All Rights Reserved.<br>
Maintained by Gary P. Scavone, <a href="mailto:gary@music.mcgill.ca">gary@music.mcgill.ca</a></td></tr>
</table>
</BODY>
</HTML>

View File

@@ -1,32 +0,0 @@
<HTML>
<HEAD>
<TITLE>The RtAudio Tutorial</TITLE>
<LINK HREF="doxygen.css" REL="stylesheet" TYPE="text/css">
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<CENTER>
<a class="qindex" href="index.html">Tutorial</a> &nbsp; <a class="qindex" href="annotated.html">Class/Enum List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; </CENTER>
<HR>
<!-- Generated by Doxygen 1.3.4 -->
<div class="qindex"><a class="qindex" href="functions.html">All</a> | <a class="qindex" href="functions_func.html">Functions</a> | <a class="qindexHL" href="functions_vars.html">Variables</a> | <a class="qindex" href="functions_enum.html">Enumerations</a> | <a class="qindex" href="functions_eval.html">Enumeration&nbsp;values</a></div>
<p>
<ul>
<li>duplexChannels
: <a class="el" href="structRtAudioDeviceInfo.html#o4">RtAudioDeviceInfo</a><li>inputChannels
: <a class="el" href="structRtAudioDeviceInfo.html#o3">RtAudioDeviceInfo</a><li>isDefault
: <a class="el" href="structRtAudioDeviceInfo.html#o5">RtAudioDeviceInfo</a><li>name
: <a class="el" href="structRtAudioDeviceInfo.html#o0">RtAudioDeviceInfo</a><li>nativeFormats
: <a class="el" href="structRtAudioDeviceInfo.html#o7">RtAudioDeviceInfo</a><li>outputChannels
: <a class="el" href="structRtAudioDeviceInfo.html#o2">RtAudioDeviceInfo</a><li>probed
: <a class="el" href="structRtAudioDeviceInfo.html#o1">RtAudioDeviceInfo</a><li>sampleRates
: <a class="el" href="structRtAudioDeviceInfo.html#o6">RtAudioDeviceInfo</a></ul>
<HR>
<table><tr><td><img src="../images/mcgill.gif" width=165></td>
<td>&copy;2001-2004 Gary P. Scavone, McGill University. All Rights Reserved.<br>
Maintained by Gary P. Scavone, <a href="mailto:gary@music.mcgill.ca">gary@music.mcgill.ca</a></td></tr>
</table>
</BODY>
</HTML>

View File

@@ -1,573 +0,0 @@
<HTML>
<HEAD>
<TITLE>The RtAudio Tutorial</TITLE>
<LINK HREF="doxygen.css" REL="stylesheet" TYPE="text/css">
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<CENTER>
<a class="qindex" href="index.html">Tutorial</a> &nbsp; <a class="qindex" href="annotated.html">Class/Enum List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; </CENTER>
<HR>
<!-- Generated by Doxygen 1.3.4 -->
<h1>The <a class="el" href="classRtAudio.html">RtAudio</a> Tutorial </h1>
<p>
<center><a class="el" href="index.html#intro">Introduction</a> &nbsp;&nbsp; <a class="el" href="index.html#changes">What's New (Version 3.0)</a> &nbsp;&nbsp;<a class="el" href="index.html#download">Download</a> &nbsp;&nbsp; <a class="el" href="index.html#start">Getting Started</a> &nbsp;&nbsp; <a class="el" href="index.html#error">Error Handling</a> &nbsp;&nbsp; <a class="el" href="index.html#probing">Probing Device Capabilities</a> &nbsp;&nbsp; <a class="el" href="index.html#settings">Device Settings</a> &nbsp;&nbsp; <a class="el" href="index.html#playbackb">Playback (blocking functionality)</a> &nbsp;&nbsp; <a class="el" href="index.html#playbackc">Playback (callback functionality)</a> &nbsp;&nbsp; <a class="el" href="index.html#recording">Recording</a> &nbsp;&nbsp; <a class="el" href="index.html#duplex">Duplex Mode</a> &nbsp;&nbsp; <a class="el" href="index.html#multi">Using Simultaneous Multiple APIs</a> &nbsp;&nbsp; <a class="el" href="index.html#methods">Summary of Methods</a> &nbsp;&nbsp; <a class="el" href="index.html#compiling">Compiling</a> &nbsp;&nbsp; <a class="el" href="index.html#debug">Debugging</a> &nbsp;&nbsp; <a class="el" href="index.html#apinotes">API Notes</a> &nbsp;&nbsp; <a class="el" href="index.html#acknowledge">Acknowledgements</a> &nbsp;&nbsp; <a class="el" href="index.html#license">License</a></center><h2><a class="anchor" name="intro">
Introduction</a></h2>
<a class="el" href="classRtAudio.html">RtAudio</a> is a set of C++ classes which provide a common API (Application Programming Interface) for realtime audio input/output across Linux (native ALSA, JACK, and OSS), Macintosh OS X, SGI, and Windows (DirectSound and ASIO) operating systems. <a class="el" href="classRtAudio.html">RtAudio</a> significantly simplifies the process of interacting with computer audio hardware. It was designed with the following goals:<p>
<ul>
<li>
object oriented C++ design </li>
<li>
simple, common API across all supported platforms </li>
<li>
only two header files and one source file for easy inclusion in programming projects </li>
<li>
allow simultaneous multi-api support </li>
<li>
blocking functionality </li>
<li>
callback functionality </li>
<li>
extensive audio device parameter control </li>
<li>
audio device capability probing </li>
<li>
automatic internal conversion for data format, channel number compensation, de-interleaving, and byte-swapping </li>
</ul>
<p>
<a class="el" href="classRtAudio.html">RtAudio</a> 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 <a class="el" href="classRtAudio.html">RtAudio</a> instance. See the <a class="el" href="index.html#apinotes">API Notes</a> section for information specific to each of the supported audio APIs.<p>
The <a class="el" href="classRtAudio.html">RtAudio</a> API provides both blocking (synchronous) and callback (asynchronous) functionality. Callbacks are typically used in conjunction with graphical user interfaces (GUI). Blocking functionality is often necessary for explicit control of multiple input/output stream synchronization or when audio must be synchronized with other system events.<h2><a class="anchor" name="changes">
What's New (Version 3.0)</a></h2>
<a class="el" href="classRtAudio.html">RtAudio</a> now allows simultaneous multi-api support. For example, you can compile <a class="el" href="classRtAudio.html">RtAudio</a> to provide both DirectSound and ASIO support on Windows platforms or ALSA, JACK, and OSS support on Linux platforms. This was accomplished by creating an abstract base class, RtApi, with subclasses for each supported API (RtApiAlsa, RtApiJack, RtApiOss, RtApiDs, RtApiAsio, RtApiCore, and RtApiAl). The class <a class="el" href="classRtAudio.html">RtAudio</a> is now a "controller" which creates an instance of an RtApi subclass based on the user's API choice via an optional <a class="el" href="classRtAudio.html#w8">RtAudio::RtAudioApi</a> instantiation argument. If no API is specified, <a class="el" href="classRtAudio.html">RtAudio</a> attempts to make a "logical" API selection.<p>
Support for the JACK low-latency audio server has been added with this version of <a class="el" href="classRtAudio.html">RtAudio</a>. It is necessary to have the JACK server running before creating an instance of <a class="el" href="classRtAudio.html">RtAudio</a>.<p>
Several API changes have been made in version 3.0 of <a class="el" href="classRtAudio.html">RtAudio</a> in an effort to provide more consistent behavior across all supported audio APIs. The most significant of these changes is that multiple stream support from a single <a class="el" href="classRtAudio.html">RtAudio</a> instance has been discontinued. As a result, stream identifier input arguments are no longer required. Also, the RtAudio::streamWillBlock() function was poorly supported by most APIs and has been deprecated (though the function still exists in those subclasses of RtApi that do allow it to be implemented).<p>
The <a class="el" href="classRtAudio.html#a7">RtAudio::getDeviceInfo()</a> function was modified to return a globally defined <a class="el" href="structRtAudioDeviceInfo.html">RtAudioDeviceInfo</a> structure. This structure is a simplified version of the previous RTAUDIO_DEVICE structure. In addition, the RTAUDIO_FORMAT structure was renamed RtAudioFormat and defined globally within <a class="el" href="RtAudio_8h.html">RtAudio.h</a>. These changes were made for clarity and to better conform with standard C++ programming practices.<p>
The <a class="el" href="classRtError.html">RtError</a> class declaration and definition have been extracted to a separate file (<a class="el" href="RtError_8h.html">RtError.h</a>). This was done in preparation for a new release of the RtMidi class (planned for Summer 2004).<h2><a class="anchor" name="download">
Download</a></h2>
Latest Release (22 March 2004): <a href="http://music.mcgill.ca/~gary/rtaudio/release/rtaudio-3.0.1.tar.gz">Version 3.0.1 (200 kB tar/gzipped)</a><h2><a class="anchor" name="start">
Getting Started</a></h2>
With version 3.0, it is now possible to compile multiple API support on a given platform and to specify an API choice during class instantiation. In the examples that follow, no API will be specified (in which case, <a class="el" href="classRtAudio.html">RtAudio</a> attempts to select the most "logical" available API).<p>
The first thing that must be done when using <a class="el" href="classRtAudio.html">RtAudio</a> is to create an instance of the class. The default constructor scans the underlying audio system to verify that at least one device is available. <a class="el" href="classRtAudio.html">RtAudio</a> often uses C++ exceptions to report errors, necessitating try/catch blocks around most member functions. The following code example demonstrates default object construction and destruction:<p>
<div class="fragment"><pre><span class="preprocessor">#include "RtAudio.h"</span>
<span class="keywordtype">int</span> main()
{
<a class="code" href="classRtAudio.html">RtAudio</a> *audio;
<span class="comment">// Default RtAudio constructor</span>
<span class="keywordflow">try</span> {
audio = <span class="keyword">new</span> <a class="code" href="classRtAudio.html">RtAudio</a>();
}
<span class="keywordflow">catch</span> (<a class="code" href="classRtError.html">RtError</a> &amp;error) {
<span class="comment">// Handle the exception here</span>
error.printMessage();
}
<span class="comment">// Clean up</span>
<span class="keyword">delete</span> audio;
}
</pre></div><p>
Obviously, this example doesn't demonstrate any of the real functionality of <a class="el" href="classRtAudio.html">RtAudio</a>. However, all uses of <a class="el" href="classRtAudio.html">RtAudio</a> must begin with a constructor (either default or overloaded varieties) and must end with class destruction. Further, it is necessary that all class methods which can throw a C++ exception be called within a try/catch block.<h2><a class="anchor" name="error">
Error Handling</a></h2>
<a class="el" href="classRtAudio.html">RtAudio</a> uses a C++ exception handler called <a class="el" href="classRtError.html">RtError</a>, which is declared and defined in <a class="el" href="RtError_8h.html">RtError.h</a>. The <a class="el" href="classRtError.html">RtError</a> class is quite simple but it does allow errors to be "caught" by <a class="el" href="classRtError.html#w11">RtError::Type</a>. Almost all <a class="el" href="classRtAudio.html">RtAudio</a> methods can "throw" an <a class="el" href="classRtError.html">RtError</a>, most typically if a driver error occurs or a stream function is called when no stream is open. There are a number of cases within <a class="el" href="classRtAudio.html">RtAudio</a> where warning messages may be displayed but an exception is not thrown. There is a protected <a class="el" href="classRtAudio.html">RtAudio</a> method, error(), which can be modified to globally control how these messages are handled and reported. By default, error messages are not automatically displayed in <a class="el" href="classRtAudio.html">RtAudio</a> unless the preprocessor definition __RTAUDIO_DEBUG__ is defined. Messages associated with caught exceptions can be displayed with, for example, the <a class="el" href="classRtError.html#a2">RtError::printMessage()</a> function.<h2><a class="anchor" name="probing">
Probing Device Capabilities</a></h2>
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.<p>
<div class="fragment"><pre><span class="comment">// probe.cpp</span>
<span class="preprocessor">#include &lt;iostream&gt;</span>
<span class="preprocessor">#include "RtAudio.h"</span>
<span class="keywordtype">int</span> main()
{
<a class="code" href="classRtAudio.html">RtAudio</a> *audio;
<span class="comment">// Default RtAudio constructor</span>
<span class="keywordflow">try</span> {
audio = <span class="keyword">new</span> <a class="code" href="classRtAudio.html">RtAudio</a>();
}
<span class="keywordflow">catch</span> (<a class="code" href="classRtError.html">RtError</a> &amp;error) {
error.printMessage();
exit(EXIT_FAILURE);
}
<span class="comment">// Determine the number of devices available</span>
<span class="keywordtype">int</span> devices = audio-&gt;<a class="code" href="classRtAudio.html#a6">getDeviceCount</a>();
<span class="comment">// Scan through devices for various capabilities</span>
<a class="code" href="structRtAudioDeviceInfo.html">RtAudioDeviceInfo</a> info;
<span class="keywordflow">for</span> (<span class="keywordtype">int</span> i=1; i&lt;=devices; i++) {
<span class="keywordflow">try</span> {
info = audio-&gt;<a class="code" href="classRtAudio.html#a7">getDeviceInfo</a>(i);
}
<span class="keywordflow">catch</span> (<a class="code" href="classRtError.html">RtError</a> &amp;error) {
error.printMessage();
<span class="keywordflow">break</span>;
}
<span class="comment">// Print, for example, the maximum number of output channels for each device</span>
std::cout &lt;&lt; <span class="stringliteral">"device = "</span> &lt;&lt; i;
std::cout &lt;&lt; <span class="stringliteral">": maximum output channels = "</span> &lt;&lt; info.<a class="code" href="structRtAudioDeviceInfo.html#o2">outputChannels</a> &lt;&lt; <span class="stringliteral">"\n"</span>;
}
<span class="comment">// Clean up</span>
<span class="keyword">delete</span> audio;
<span class="keywordflow">return</span> 0;
}
</pre></div><p>
The <a class="el" href="structRtAudioDeviceInfo.html">RtAudioDeviceInfo</a> structure is defined in <a class="el" href="RtAudio_8h.html">RtAudio.h</a> and provides a variety of information useful in assessing the capabilities of a device:<p>
<div class="fragment"><pre> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structRtAudioDeviceInfo.html">RtAudioDeviceInfo</a>{
std::string <a class="code" href="structRtAudioDeviceInfo.html#o0">name</a>; <span class="comment">// Character string device identifier.</span>
<span class="keywordtype">bool</span> <a class="code" href="structRtAudioDeviceInfo.html#o1">probed</a>; <span class="comment">// true if the device capabilities were successfully probed.</span>
<span class="keywordtype">int</span> <a class="code" href="structRtAudioDeviceInfo.html#o2">outputChannels</a>; <span class="comment">// Maximum output channels supported by device.</span>
<span class="keywordtype">int</span> <a class="code" href="structRtAudioDeviceInfo.html#o3">inputChannels</a>; <span class="comment">// Maximum input channels supported by device.</span>
<span class="keywordtype">int</span> <a class="code" href="structRtAudioDeviceInfo.html#o4">duplexChannels</a>; <span class="comment">// Maximum simultaneous input/output channels supported by device.</span>
<span class="keywordtype">bool</span> <a class="code" href="structRtAudioDeviceInfo.html#o5">isDefault</a>; <span class="comment">// true if this is the default output or input device.</span>
std::vector&lt;int&gt; <a class="code" href="structRtAudioDeviceInfo.html#o6">sampleRates</a>; <span class="comment">// Supported sample rates.</span>
RtAudioFormat <a class="code" href="structRtAudioDeviceInfo.html#o7">nativeFormats</a>; <span class="comment">// Bit mask of supported data formats.</span>
};
</pre></div><p>
The following data formats are defined and fully supported by <a class="el" href="classRtAudio.html">RtAudio</a>:<p>
<div class="fragment"><pre> <span class="keyword">typedef</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> RtAudioFormat;
<span class="keyword">static</span> <span class="keyword">const</span> RtAudioFormat RTAUDIO_SINT8; <span class="comment">// Signed 8-bit integer</span>
<span class="keyword">static</span> <span class="keyword">const</span> RtAudioFormat RTAUDIO_SINT16; <span class="comment">// Signed 16-bit integer</span>
<span class="keyword">static</span> <span class="keyword">const</span> RtAudioFormat RTAUDIO_SINT24; <span class="comment">// Signed 24-bit integer (upper 3 bytes of 32-bit signed integer.)</span>
<span class="keyword">static</span> <span class="keyword">const</span> RtAudioFormat RTAUDIO_SINT32; <span class="comment">// Signed 32-bit integer</span>
<span class="keyword">static</span> <span class="keyword">const</span> RtAudioFormat RTAUDIO_FLOAT32; <span class="comment">// 32-bit float normalized between +/- 1.0</span>
<span class="keyword">static</span> <span class="keyword">const</span> RtAudioFormat RTAUDIO_FLOAT64; <span class="comment">// 64-bit double normalized between +/- 1.0</span>
</pre></div><p>
The <em>nativeFormats</em> member of the <a class="el" href="structRtAudioDeviceInfo.html">RtAudioDeviceInfo</a> structure is a bit mask of the above formats which are natively supported by the device. However, <a class="el" href="classRtAudio.html">RtAudio</a> will automatically provide format conversion if a particular format is not natively supported. When the <em>probed</em> member of the <a class="el" href="structRtAudioDeviceInfo.html">RtAudioDeviceInfo</a> structure is false, the remaining structure members are undefined and the device is probably unuseable.<p>
While some audio devices may require a minimum channel value greater than one, <a class="el" href="classRtAudio.html">RtAudio</a> 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 <em>NOT</em> possible when the number of channels set by the user is greater than that supported by the device.<p>
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, <a class="el" href="classRtAudio.html">RtAudio</a> does not typically rely on the queried values when attempting to open a stream.<h2><a class="anchor" name="settings">
Device Settings</a></h2>
The next step in using <a class="el" href="classRtAudio.html">RtAudio</a> is to open a stream with particular device and parameter settings.<p>
<div class="fragment"><pre><span class="preprocessor">#include "RtAudio.h"</span>
<span class="keywordtype">int</span> main()
{
<span class="keywordtype">int</span> channels = 2;
<span class="keywordtype">int</span> sampleRate = 44100;
<span class="keywordtype">int</span> bufferSize = 256; <span class="comment">// 256 sample frames</span>
<span class="keywordtype">int</span> nBuffers = 4; <span class="comment">// number of internal buffers used by device</span>
<span class="keywordtype">int</span> device = 0; <span class="comment">// 0 indicates the default or first available device</span>
<a class="code" href="classRtAudio.html">RtAudio</a> *audio;
<span class="comment">// Instantiate RtAudio and open a stream within a try/catch block</span>
<span class="keywordflow">try</span> {
audio = <span class="keyword">new</span> <a class="code" href="classRtAudio.html">RtAudio</a>();
}
<span class="keywordflow">catch</span> (<a class="code" href="classRtError.html">RtError</a> &amp;error) {
error.printMessage();
exit(EXIT_FAILURE);
}
<span class="keywordflow">try</span> {
audio-&gt;<a class="code" href="classRtAudio.html#a3">openStream</a>(device, channels, 0, 0, RTAUDIO_FLOAT32,
sampleRate, &amp;bufferSize, nBuffers);
}
<span class="keywordflow">catch</span> (<a class="code" href="classRtError.html">RtError</a> &amp;error) {
error.printMessage();
<span class="comment">// Perhaps try other parameters?</span>
}
<span class="comment">// Clean up</span>
<span class="keyword">delete</span> audio;
<span class="keywordflow">return</span> 0;
}
</pre></div><p>
The <a class="el" href="classRtAudio.html#a3">RtAudio::openStream()</a> method attempts to open a stream with a specified set of parameter values. In this case, we attempt to open a two channel playback stream with the default output device, 32-bit floating point data, a sample rate of 44100 Hz, a frame rate of 256 sample frames per read/write, and 4 internal device buffers. When device = 0, <a class="el" href="classRtAudio.html">RtAudio</a> first attempts to open the default audio device with the given parameters. If that attempt fails, <a class="el" href="classRtAudio.html">RtAudio</a> searches through the remaining available devices in an effort to find a device which will meet the given parameters. If all attempts are unsuccessful, an <a class="el" href="classRtError.html">RtError</a> is thrown. When a non-zero device value is specified, an attempt is made to open that device <em>ONLY</em> (device = 1 specifies the first identified device, as reported by <a class="el" href="classRtAudio.html#a7">RtAudio::getDeviceInfo()</a>).<p>
<a class="el" href="classRtAudio.html">RtAudio</a> 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, <a class="el" href="classRtAudio.html">RtAudio</a> will automatically perform the necessary data format conversion.<p>
The <em>bufferSize</em> parameter specifies the desired number of sample frames which will be written to and/or read from a device per write/read operation. The <em>nBuffers</em> parameter is used in setting the underlying device buffer parameters. Both the <em>bufferSize</em> and <em>nBuffers</em> parameters can be used to control stream latency though there is no guarantee that the passed values will be those used by a device (the <em>nBuffers</em> parameter is ignored when using the OS X CoreAudio, Linux Jack, and the Windows ASIO APIs). In general, lower values for both parameters will produce less latency but perhaps less robust performance. Both parameters can be specified with values of zero, in which case the smallest allowable values will be used. The <em>bufferSize</em> parameter is passed as a pointer and the actual value used by the stream is set during the device setup procedure. <em>bufferSize</em> values should be a power of two. Optimal and allowable buffer values tend to vary between systems and devices. Check the <a class="el" href="index.html#apinotes">API Notes</a> section for general guidelines.<p>
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, <a class="el" href="classRtAudio.html">RtAudio</a> does not attempt to query a device's capabilities or use previously reported values when opening a device. Instead, <a class="el" href="classRtAudio.html">RtAudio</a> simply attempts to set the given parameters on a specified device and then checks whether the setup is successful or not.<h2><a class="anchor" name="playbackb">
Playback (blocking functionality)</a></h2>
Once the device is open for playback, there are only a few final steps necessary for realtime audio output. We'll first provide an example (blocking functionality) and then discuss the details.<p>
<div class="fragment"><pre><span class="comment">// playback.cpp</span>
<span class="preprocessor">#include "RtAudio.h"</span>
<span class="keywordtype">int</span> main()
{
<span class="keywordtype">int</span> count;
<span class="keywordtype">int</span> channels = 2;
<span class="keywordtype">int</span> sampleRate = 44100;
<span class="keywordtype">int</span> bufferSize = 256; <span class="comment">// 256 sample frames</span>
<span class="keywordtype">int</span> nBuffers = 4; <span class="comment">// number of internal buffers used by device</span>
<span class="keywordtype">float</span> *buffer;
<span class="keywordtype">int</span> device = 0; <span class="comment">// 0 indicates the default or first available device</span>
<a class="code" href="classRtAudio.html">RtAudio</a> *audio;
<span class="comment">// Open a stream during RtAudio instantiation</span>
<span class="keywordflow">try</span> {
audio = <span class="keyword">new</span> <a class="code" href="classRtAudio.html">RtAudio</a>(device, channels, 0, 0, RTAUDIO_FLOAT32,
sampleRate, &amp;bufferSize, nBuffers);
}
<span class="keywordflow">catch</span> (<a class="code" href="classRtError.html">RtError</a> &amp;error) {
error.printMessage();
exit(EXIT_FAILURE);
}
<span class="keywordflow">try</span> {
<span class="comment">// Get a pointer to the stream buffer</span>
buffer = (<span class="keywordtype">float</span> *) audio-&gt;<a class="code" href="classRtAudio.html#a8">getStreamBuffer</a>();
<span class="comment">// Start the stream</span>
audio-&gt;<a class="code" href="classRtAudio.html#a11">startStream</a>();
}
<span class="keywordflow">catch</span> (<a class="code" href="classRtError.html">RtError</a> &amp;error) {
error.printMessage();
<span class="keywordflow">goto</span> cleanup;
}
<span class="comment">// An example loop which runs for 40000 sample frames</span>
count = 0;
<span class="keywordflow">while</span> (count &lt; 40000) {
<span class="comment">// Generate your samples and fill the buffer with bufferSize sample frames of data</span>
...
<span class="comment">// Trigger the output of the data buffer</span>
<span class="keywordflow">try</span> {
audio-&gt;<a class="code" href="classRtAudio.html#a9">tickStream</a>();
}
<span class="keywordflow">catch</span> (<a class="code" href="classRtError.html">RtError</a> &amp;error) {
error.printMessage();
<span class="keywordflow">goto</span> cleanup;
}
count += bufferSize;
}
<span class="keywordflow">try</span> {
<span class="comment">// Stop and close the stream</span>
audio-&gt;<a class="code" href="classRtAudio.html#a12">stopStream</a>();
audio-&gt;<a class="code" href="classRtAudio.html#a10">closeStream</a>();
}
<span class="keywordflow">catch</span> (<a class="code" href="classRtError.html">RtError</a> &amp;error) {
error.printMessage();
}
cleanup:
<span class="keyword">delete</span> audio;
<span class="keywordflow">return</span> 0;
}
</pre></div><p>
The first thing to notice in this example is that we attempt to open a stream during class instantiation with an overloaded constructor. This constructor simply combines the functionality of the default constructor, used earlier, and the <a class="el" href="classRtAudio.html#a3">RtAudio::openStream()</a> method. Again, we have specified a device value of 0, indicating that the default or first available device meeting the given parameters should be used. An attempt is made to open the stream with the specified <em>bufferSize</em> value. However, it is possible that the device will not accept this value, in which case the closest allowable size is used and returned via the pointer value. The constructor can fail if no available devices are found, or a memory allocation or device driver error occurs. Note that you should not call the <a class="el" href="classRtAudio.html">RtAudio</a> destructor if an exception is thrown during instantiation.<p>
Assuming the constructor is successful, it is necessary to get a pointer to the buffer, provided by <a class="el" href="classRtAudio.html">RtAudio</a>, for use in feeding data to/from the opened stream. Note that the user should <em>NOT</em> attempt to deallocate the stream buffer memory ... memory management for the stream buffer will be automatically controlled by <a class="el" href="classRtAudio.html">RtAudio</a>. After starting the stream with <a class="el" href="classRtAudio.html#a11">RtAudio::startStream()</a>, one simply fills that buffer, which is of length equal to the returned <em>bufferSize</em> value, with interleaved audio data (in the specified format) for playback. Finally, a call to the <a class="el" href="classRtAudio.html#a9">RtAudio::tickStream()</a> routine triggers a blocking write call for the stream.<p>
In general, one should call the <a class="el" href="classRtAudio.html#a12">RtAudio::stopStream()</a> and <a class="el" href="classRtAudio.html#a10">RtAudio::closeStream()</a> methods after finishing with a stream. However, both methods will implicitly be called during object destruction if necessary.<h2><a class="anchor" name="playbackc">
Playback (callback functionality)</a></h2>
The primary difference in using <a class="el" href="classRtAudio.html">RtAudio</a> with callback functionality involves the creation of a user-defined callback function. Here is an example which produces a sawtooth waveform for playback.<p>
<div class="fragment"><pre><span class="preprocessor">#include &lt;iostream&gt;</span>
<span class="preprocessor">#include "RtAudio.h"</span>
<span class="comment">// Two-channel sawtooth wave generator.</span>
<span class="keywordtype">int</span> sawtooth(<span class="keywordtype">char</span> *buffer, <span class="keywordtype">int</span> bufferSize, <span class="keywordtype">void</span> *data)
{
<span class="keywordtype">int</span> i, j;
<span class="keywordtype">double</span> *my_buffer = (<span class="keywordtype">double</span> *) buffer;
<span class="keywordtype">double</span> *my_data = (<span class="keywordtype">double</span> *) data;
<span class="comment">// Write interleaved audio data.</span>
<span class="keywordflow">for</span> (i=0; i&lt;bufferSize; i++) {
<span class="keywordflow">for</span> (j=0; j&lt;2; j++) {
*my_buffer++ = my_data[j];
my_data[j] += 0.005 * (j+1+(j*0.1));
<span class="keywordflow">if</span> (my_data[j] &gt;= 1.0) my_data[j] -= 2.0;
}
}
<span class="keywordflow">return</span> 0;
}
<span class="keywordtype">int</span> main()
{
<span class="keywordtype">int</span> channels = 2;
<span class="keywordtype">int</span> sampleRate = 44100;
<span class="keywordtype">int</span> bufferSize = 256; <span class="comment">// 256 sample frames</span>
<span class="keywordtype">int</span> nBuffers = 4; <span class="comment">// number of internal buffers used by device</span>
<span class="keywordtype">int</span> device = 0; <span class="comment">// 0 indicates the default or first available device</span>
<span class="keywordtype">double</span> data[2];
<span class="keywordtype">char</span> input;
<a class="code" href="classRtAudio.html">RtAudio</a> *audio;
<span class="comment">// Open a stream during RtAudio instantiation</span>
<span class="keywordflow">try</span> {
audio = <span class="keyword">new</span> <a class="code" href="classRtAudio.html">RtAudio</a>(device, channels, 0, 0, RTAUDIO_FLOAT64,
sampleRate, &amp;bufferSize, nBuffers);
}
<span class="keywordflow">catch</span> (<a class="code" href="classRtError.html">RtError</a> &amp;error) {
error.printMessage();
exit(EXIT_FAILURE);
}
<span class="keywordflow">try</span> {
<span class="comment">// Set the stream callback function</span>
audio-&gt;<a class="code" href="classRtAudio.html#a4">setStreamCallback</a>(&amp;sawtooth, (<span class="keywordtype">void</span> *)data);
<span class="comment">// Start the stream</span>
audio-&gt;<a class="code" href="classRtAudio.html#a11">startStream</a>();
}
<span class="keywordflow">catch</span> (<a class="code" href="classRtError.html">RtError</a> &amp;error) {
error.printMessage();
<span class="keywordflow">goto</span> cleanup;
}
std::cout &lt;&lt; <span class="stringliteral">"\nPlaying ... press &lt;enter&gt; to quit.\n"</span>;
std::cin.get(input);
<span class="keywordflow">try</span> {
<span class="comment">// Stop and close the stream</span>
audio-&gt;<a class="code" href="classRtAudio.html#a12">stopStream</a>();
audio-&gt;<a class="code" href="classRtAudio.html#a10">closeStream</a>();
}
<span class="keywordflow">catch</span> (<a class="code" href="classRtError.html">RtError</a> &amp;error) {
error.printMessage();
}
cleanup:
<span class="keyword">delete</span> audio;
<span class="keywordflow">return</span> 0;
}
</pre></div><p>
After opening the device in exactly the same way as the previous example (except with a data format change), we must set our callback function for the stream using <a class="el" href="classRtAudio.html#a4">RtAudio::setStreamCallback()</a>. When the underlying audio API uses blocking calls (OSS, ALSA, SGI, and Windows DirectSound), this method will spawn a new process (or thread) which automatically calls the callback function when more data is needed. Callback-based audio APIs (OS X CoreAudio Linux Jack, and ASIO) implement their own event notification schemes. Note that the callback function is called only when the stream is "running" (between calls to the <a class="el" href="classRtAudio.html#a11">RtAudio::startStream()</a> and <a class="el" href="classRtAudio.html#a12">RtAudio::stopStream()</a> methods). The last argument to <a class="el" href="classRtAudio.html#a4">RtAudio::setStreamCallback()</a> is a pointer to arbitrary data that you wish to access from within your callback function.<p>
In this example, we stop the stream with an explicit call to <a class="el" href="classRtAudio.html#a12">RtAudio::stopStream()</a>. When using callback functionality, it is also possible to stop a stream by returning a non-zero value from the callback function.<p>
Once set with <a class="el" href="classRtAudio.html#a4">RtAudio::setStreamCallback</a>, the callback process exists for the life of the stream (until the stream is closed with <a class="el" href="classRtAudio.html#a10">RtAudio::closeStream()</a> or the <a class="el" href="classRtAudio.html">RtAudio</a> instance is deleted). It is possible to disassociate a callback function and cancel its process for an open stream using the <a class="el" href="classRtAudio.html#a5">RtAudio::cancelStreamCallback()</a> method. The stream can then be used with blocking functionality or a new callback can be associated with it.<h2><a class="anchor" name="recording">
Recording</a></h2>
Using <a class="el" href="classRtAudio.html">RtAudio</a> for audio input is almost identical to the way it is used for playback. Here's the blocking playback example rewritten for recording:<p>
<div class="fragment"><pre><span class="comment">// record.cpp</span>
<span class="preprocessor">#include "RtAudio.h"</span>
<span class="keywordtype">int</span> main()
{
<span class="keywordtype">int</span> count;
<span class="keywordtype">int</span> channels = 2;
<span class="keywordtype">int</span> sampleRate = 44100;
<span class="keywordtype">int</span> bufferSize = 256; <span class="comment">// 256 sample frames</span>
<span class="keywordtype">int</span> nBuffers = 4; <span class="comment">// number of internal buffers used by device</span>
<span class="keywordtype">float</span> *buffer;
<span class="keywordtype">int</span> device = 0; <span class="comment">// 0 indicates the default or first available device</span>
<a class="code" href="classRtAudio.html">RtAudio</a> *audio;
<span class="comment">// Instantiate RtAudio and open a stream.</span>
<span class="keywordflow">try</span> {
audio = <span class="keyword">new</span> <a class="code" href="classRtAudio.html">RtAudio</a>(&amp;stream, 0, 0, device, channels,
RTAUDIO_FLOAT32, sampleRate, &amp;bufferSize, nBuffers);
}
<span class="keywordflow">catch</span> (<a class="code" href="classRtError.html">RtError</a> &amp;error) {
error.printMessage();
exit(EXIT_FAILURE);
}
<span class="keywordflow">try</span> {
<span class="comment">// Get a pointer to the stream buffer</span>
buffer = (<span class="keywordtype">float</span> *) audio-&gt;<a class="code" href="classRtAudio.html#a8">getStreamBuffer</a>();
<span class="comment">// Start the stream</span>
audio-&gt;<a class="code" href="classRtAudio.html#a11">startStream</a>();
}
<span class="keywordflow">catch</span> (<a class="code" href="classRtError.html">RtError</a> &amp;error) {
error.printMessage();
<span class="keywordflow">goto</span> cleanup;
}
<span class="comment">// An example loop which runs for about 40000 sample frames</span>
count = 0;
<span class="keywordflow">while</span> (count &lt; 40000) {
<span class="comment">// Read a buffer of data</span>
<span class="keywordflow">try</span> {
audio-&gt;<a class="code" href="classRtAudio.html#a9">tickStream</a>();
}
<span class="keywordflow">catch</span> (<a class="code" href="classRtError.html">RtError</a> &amp;error) {
error.printMessage();
<span class="keywordflow">goto</span> cleanup;
}
<span class="comment">// Process the input samples (bufferSize sample frames) that were read</span>
...
count += bufferSize;
}
<span class="keywordflow">try</span> {
<span class="comment">// Stop the stream</span>
audio-&gt;<a class="code" href="classRtAudio.html#a12">stopStream</a>();
}
<span class="keywordflow">catch</span> (<a class="code" href="classRtError.html">RtError</a> &amp;error) {
error.printMessage();
}
cleanup:
<span class="keyword">delete</span> audio;
<span class="keywordflow">return</span> 0;
}
</pre></div><p>
In this example, the stream was opened for recording with a non-zero <em>inputChannels</em> value. The only other difference between this example and that for playback involves the order of data processing in the loop, where it is necessary to first read a buffer of input data before manipulating it.<h2><a class="anchor" name="duplex">
Duplex Mode</a></h2>
Finally, it is easy to use <a class="el" href="classRtAudio.html">RtAudio</a> for simultaneous audio input/output, or duplex operation. In this example, we use a callback function and simply scale the input data before sending it back to the output.<p>
<div class="fragment"><pre><span class="comment">// duplex.cpp</span>
<span class="preprocessor">#include &lt;iostream&gt;</span>
<span class="preprocessor">#include "RtAudio.h"</span>
<span class="comment">// Pass-through function.</span>
<span class="keywordtype">int</span> scale(<span class="keywordtype">char</span> *buffer, <span class="keywordtype">int</span> bufferSize, <span class="keywordtype">void</span> *)
{
<span class="comment">// Note: do nothing here for pass through.</span>
<span class="keywordtype">double</span> *my_buffer = (<span class="keywordtype">double</span> *) buffer;
<span class="comment">// Scale input data for output.</span>
<span class="keywordflow">for</span> (<span class="keywordtype">int</span> i=0; i&lt;bufferSize; i++) {
<span class="comment">// Do for two channels.</span>
*my_buffer++ *= 0.5;
*my_buffer++ *= 0.5;
}
<span class="keywordflow">return</span> 0;
}
<span class="keywordtype">int</span> main()
{
<span class="keywordtype">int</span> channels = 2;
<span class="keywordtype">int</span> sampleRate = 44100;
<span class="keywordtype">int</span> bufferSize = 256; <span class="comment">// 256 sample frames</span>
<span class="keywordtype">int</span> nBuffers = 4; <span class="comment">// number of internal buffers used by device</span>
<span class="keywordtype">int</span> device = 0; <span class="comment">// 0 indicates the default or first available device</span>
<span class="keywordtype">char</span> input;
<a class="code" href="classRtAudio.html">RtAudio</a> *audio;
<span class="comment">// Open a stream during RtAudio instantiation</span>
<span class="keywordflow">try</span> {
audio = <span class="keyword">new</span> <a class="code" href="classRtAudio.html">RtAudio</a>(device, channels, device, channels, RTAUDIO_FLOAT64,
sampleRate, &amp;bufferSize, nBuffers);
}
<span class="keywordflow">catch</span> (<a class="code" href="classRtError.html">RtError</a> &amp;error) {
error.printMessage();
exit(EXIT_FAILURE);
}
<span class="keywordflow">try</span> {
<span class="comment">// Set the stream callback function</span>
audio-&gt;<a class="code" href="classRtAudio.html#a4">setStreamCallback</a>(&amp;scale, NULL);
<span class="comment">// Start the stream</span>
audio-&gt;<a class="code" href="classRtAudio.html#a11">startStream</a>();
}
<span class="keywordflow">catch</span> (<a class="code" href="classRtError.html">RtError</a> &amp;error) {
error.printMessage();
<span class="keywordflow">goto</span> cleanup;
}
std::cout &lt;&lt; <span class="stringliteral">"\nRunning duplex ... press &lt;enter&gt; to quit.\n"</span>;
std::cin.get(input);
<span class="keywordflow">try</span> {
<span class="comment">// Stop and close the stream</span>
audio-&gt;<a class="code" href="classRtAudio.html#a12">stopStream</a>();
audio-&gt;<a class="code" href="classRtAudio.html#a10">closeStream</a>();
}
<span class="keywordflow">catch</span> (<a class="code" href="classRtError.html">RtError</a> &amp;error) {
error.printMessage();
}
cleanup:
<span class="keyword">delete</span> audio;
<span class="keywordflow">return</span> 0;
}
</pre></div><p>
When an <a class="el" href="classRtAudio.html">RtAudio</a> stream is running in duplex mode (nonzero input <em>AND</em> output channels), the audio write (playback) operation always occurs before the audio read (record) operation. This sequence allows the use of a single buffer to store both output and input data.<p>
As we see with this example, the write-read sequence of operations does not preclude the use of <a class="el" href="classRtAudio.html">RtAudio</a> in situations where input data is first processed and then output through a duplex stream. When the stream buffer is first allocated, it is initialized with zeros, which produces no audible result when output to the device. In this example, anything recorded by the audio stream input will be scaled and played out during the next round of audio processing.<p>
Note that duplex operation can also be achieved by opening one output stream instance and one input stream instance using the same or different devices. However, there may be timing problems when attempting to use two different devices, due to possible device clock variations, unless a common external "sync" is provided. This becomes even more difficult to achieve using two separate callback streams because it is not possible to <em>explicitly</em> control the calling order of the callback functions.<h2><a class="anchor" name="multi">
Using Simultaneous Multiple APIs</a></h2>
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 <a class="el" href="classRtAudio.html#w8w6">RtAudio::WINDOWS_ASIO</a> when attempting to create an instance of <a class="el" href="classRtAudio.html">RtAudio</a>. If an <a class="el" href="classRtError.html">RtError</a> is thrown (indicating no available drivers), then an instance of <a class="el" href="classRtAudio.html">RtAudio</a> with the api argument <a class="el" href="classRtAudio.html#w8w7">RtAudio::WINDOWS_DS</a> can be created. Alternately, if no api argument is specified, <a class="el" href="classRtAudio.html">RtAudio</a> will first look for ASIO drivers and then DirectSound drivers (on Linux systems, the default API search order is Jack, Alsa, and finally OSS). In theory, it should also be possible to have separate instances of <a class="el" href="classRtAudio.html">RtAudio</a> open at the same time with different underlying audio API support, though this has not been tested. It is difficult to know how well different audio APIs can simultaneously coexist on a given operating system. In particular, it is most unlikely that the same device could be simultaneously controlled with two different audio APIs.<h2><a class="anchor" name="methods">
Summary of Methods</a></h2>
The following is a short summary of public methods (not including constructors and the destructor) provided by <a class="el" href="classRtAudio.html">RtAudio</a>:<p>
<ul>
<li>
<a class="el" href="classRtAudio.html#a3">RtAudio::openStream()</a>: opens a stream with the specified parameters. </li>
<li>
<a class="el" href="classRtAudio.html#a4">RtAudio::setStreamCallback()</a>: sets a user-defined callback function for the stream. </li>
<li>
<a class="el" href="classRtAudio.html#a5">RtAudio::cancelStreamCallback()</a>: cancels a callback process and function for the stream. </li>
<li>
<a class="el" href="classRtAudio.html#a6">RtAudio::getDeviceCount()</a>: returns the number of audio devices available. </li>
<li>
<a class="el" href="classRtAudio.html#a7">RtAudio::getDeviceInfo()</a>: returns an <a class="el" href="structRtAudioDeviceInfo.html">RtAudioDeviceInfo</a> structure for a specified device. </li>
<li>
<a class="el" href="classRtAudio.html#a8">RtAudio::getStreamBuffer()</a>: returns a pointer to the stream buffer. </li>
<li>
<a class="el" href="classRtAudio.html#a9">RtAudio::tickStream()</a>: triggers processing of input/output data for the stream (blocking). </li>
<li>
<a class="el" href="classRtAudio.html#a10">RtAudio::closeStream()</a>: closes the stream (implicitly called during object destruction). </li>
<li>
<a class="el" href="classRtAudio.html#a11">RtAudio::startStream()</a>: (re)starts the stream, typically after it has been stopped with either stopStream() or abortStream() or after first opening the stream. </li>
<li>
<a class="el" href="classRtAudio.html#a12">RtAudio::stopStream()</a>: stops the stream, allowing any remaining samples in the queue to be played out and/or read in. This does not implicitly call <a class="el" href="classRtAudio.html#a10">RtAudio::closeStream()</a>. </li>
<li>
<a class="el" href="classRtAudio.html#a13">RtAudio::abortStream()</a>: stops the stream, discarding any remaining samples in the queue. This does not implicitly call closeStream(). </li>
</ul>
<h2><a class="anchor" name="compiling">
Compiling</a></h2>
In order to compile <a class="el" href="classRtAudio.html">RtAudio</a> for a specific OS and audio API, it is necessary to supply the appropriate preprocessor definition and library within the compiler statement: <p>
<table border="2" cols="5" width="100%" cellspacing="3" cellpadding="3">
<tr bgcolor="beige">
<td width="5%"><b>OS:</b> </td><td width="5%"><b>Audio API:</b> </td><td width="5%"><b>C++ Class:</b> </td><td width="5%"><b>Preprocessor Definition:</b> </td><td width="5%"><b>Library or Framework:</b> </td><td><b>Example Compiler Statement:</b> </td></tr>
<tr>
<td>Linux </td><td>ALSA </td><td>RtApiAlsa </td><td>__LINUX_ALSA__ </td><td><code>asound, pthread</code> </td><td><code>g++ -Wall -D__LINUX_ALSA__ -o probe probe.cpp RtAudio.cpp -lasound -lpthread</code> </td></tr>
<tr>
<td>Linux </td><td>Jack Audio Server </td><td>RtApiJack </td><td>__LINUX_JACK__ </td><td><code>jack, pthread</code> </td><td><code>g++ -Wall -D__LINUX_JACK__ -o probe probe.cpp RtAudio.cpp `pkg-config --cflags --libs jack` -lpthread</code> </td></tr>
<tr>
<td>Linux </td><td>OSS </td><td>RtApiOss </td><td>__LINUX_OSS__ </td><td><code>pthread</code> </td><td><code>g++ -Wall -D__LINUX_OSS__ -o probe probe.cpp RtAudio.cpp -lpthread</code> </td></tr>
<tr>
<td>Macintosh OS X </td><td>CoreAudio </td><td>RtApiCore </td><td>__MACOSX_CORE__ </td><td><code>pthread, stdc++, CoreAudio</code> </td><td><code>g++ -Wall -D__MACOSX_CORE__ -o probe probe.cpp RtAudio.cpp -framework CoreAudio -lpthread</code> </td></tr>
<tr>
<td>Irix </td><td>AL </td><td>RtApiAl </td><td>__IRIX_AL__ </td><td><code>audio, pthread</code> </td><td><code>CC -Wall -D__IRIX_AL__ -o probe probe.cpp RtAudio.cpp -laudio -lpthread</code> </td></tr>
<tr>
<td>Windows </td><td>Direct Sound </td><td>RtApiDs </td><td>__WINDOWS_DS__ </td><td><code>dsound.lib (ver. 5.0 or higher), multithreaded</code> </td><td><em>compiler specific</em> </td></tr>
<tr>
<td>Windows </td><td>ASIO </td><td>RtApiAsio </td><td>__WINDOWS_ASIO__ </td><td><em>various ASIO header and source files</em> </td><td><em>compiler specific</em> </td></tr>
</table>
<p>
The example compiler statements above could be used to compile the <code>probe.cpp</code> example file, assuming that <code>probe.cpp</code>, <code><a class="el" href="RtAudio_8h.html">RtAudio.h</a></code>, <code><a class="el" href="RtError_8h.html">RtError.h</a></code>, and <code>RtAudio.cpp</code> all exist in the same directory.<h2><a class="anchor" name="debug">
Debugging</a></h2>
If you are having problems getting <a class="el" href="classRtAudio.html">RtAudio</a> to run on your system, try passing the preprocessor definition <code>__RTAUDIO_DEBUG__</code> to the compiler (or uncomment the definition at the bottom of <a class="el" href="RtAudio_8h.html">RtAudio.h</a>). A variety of warning messages will be displayed which may help in determining the problem. Also try using the programs included in the <code>test</code> directory. The program <code>info</code> displays the queried capabilities of all hardware devices found.<h2><a class="anchor" name="apinotes">
API Notes</a></h2>
<a class="el" href="classRtAudio.html">RtAudio</a> 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.<h3><a class="anchor" name="linux">
Linux:</a></h3>
<a class="el" href="classRtAudio.html">RtAudio</a> for Linux was developed under Redhat distributions 7.0 - Fedora. Three different audio APIs are supported on Linux platforms: OSS, <a href="http://www.alsa-project.org/">ALSA</a>, and <a href="http://jackit.sourceforge.net/">Jack</a>. The OSS API has existed for at least 6 years and the Linux kernel is distributed with free versions of OSS audio drivers. Therefore, a generic Linux system is most likely to have OSS support (though the availability and quality of OSS drivers for new hardware is decreasing). The ALSA API, although relatively new, is now part of the Linux development kernel and offers significantly better functionality than the OSS API. <a class="el" href="classRtAudio.html">RtAudio</a> provides support for the 1.0 and higher versions of ALSA. Jack, which is still in development, is a low-latency audio server, written primarily for the GNU/Linux operating system. It can connect a number of different applications to an audio device, as well as allow them to share audio between themselves. Input/output latency on the order of 15 milliseconds can typically be achieved using any of the Linux APIs by fine-tuning the <a class="el" href="classRtAudio.html">RtAudio</a> 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.<p>
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 <a class="el" href="classRtAudio.html">RtAudio</a> tests, it is recommended that the native ALSA implementation of <a class="el" href="classRtAudio.html">RtAudio</a> be used on systems which have ALSA drivers installed.<p>
The ALSA implementation of <a class="el" href="classRtAudio.html">RtAudio</a> makes no use of the ALSA "plug" interface. All necessary data format conversions, channel compensation, de-interleaving, and byte-swapping is handled by internal <a class="el" href="classRtAudio.html">RtAudio</a> routines.<p>
The Jack API is based on a callback scheme. <a class="el" href="classRtAudio.html">RtAudio</a> provides blocking functionality, in addition to callback functionality, within the context of that behavior. It should be noted, however, that the best performance is achieved when using RtAudio's callback functionality with the Jack API. At the moment, only one <a class="el" href="classRtAudio.html">RtAudio</a> instance can be connected to the Jack server. Because <a class="el" href="classRtAudio.html">RtAudio</a> does not provide a mechanism for allowing the user to specify particular channels (or ports) of a device, it simply opens the first <em>N</em> enumerated Jack ports for input/output.<h3><a class="anchor" name="macosx">
Macintosh OS X (CoreAudio):</a></h3>
The Apple CoreAudio API is based on a callback scheme. <a class="el" href="classRtAudio.html">RtAudio</a> provides blocking functionality, in addition to callback functionality, within the context of that behavior. CoreAudio is designed to use a separate callback procedure for each of its audio devices. A single <a class="el" href="classRtAudio.html">RtAudio</a> duplex stream using two different devices is supported, though it cannot be guaranteed to always behave correctly because we cannot synchronize these two callbacks. This same functionality might be achieved with better synchrony by creating separate instances of <a class="el" href="classRtAudio.html">RtAudio</a> for each device and making use of <a class="el" href="classRtAudio.html">RtAudio</a> blocking calls (i.e. <a class="el" href="classRtAudio.html#a9">RtAudio::tickStream()</a>). The <em>numberOfBuffers</em> parameter to the <a class="el" href="classRtAudio.html#a3">RtAudio::openStream()</a> function has no affect in this implementation.<p>
It is not possible to have multiple instances of <a class="el" href="classRtAudio.html">RtAudio</a> accessing the same CoreAudio device.<h3><a class="anchor" name="irix">
Irix (SGI):</a></h3>
The Irix version of <a class="el" href="classRtAudio.html">RtAudio</a> was written and tested on an SGI Indy running Irix version 6.5.4 and the newer "al" audio library. <a class="el" href="classRtAudio.html">RtAudio</a> does not compile under Irix version 6.3, mainly because the C++ compiler is too old. Despite the relatively slow speed of the Indy, <a class="el" href="classRtAudio.html">RtAudio</a> was found to behave quite well and input/output latency was very good. No problems were found with respect to using the pthread library.<h3><a class="anchor" name="windowsds">
Windows (DirectSound):</a></h3>
In order to compile <a class="el" href="classRtAudio.html">RtAudio</a> under Windows for the DirectSound API, you must have the header and source files for DirectSound version 5.0 or higher. As far as I know, there is no DirectSoundCapture support for Windows NT. Audio output latency with DirectSound can be reasonably good (on the order of 20 milliseconds). On the other hand, input audio latency tends to be terrible (100 milliseconds or more). Further, DirectSound drivers tend to crash easily when experimenting with buffer parameters. On my system, I found it necessary to use values around nBuffers = 8 and bufferSize = 512 to avoid crashes. <a class="el" href="classRtAudio.html">RtAudio</a> was originally developed with Visual C++ version 6.0.<h3><a class="anchor" name="windowsasio">
Windows (ASIO):</a></h3>
The Steinberg ASIO audio API is based on a callback scheme. In addition, the API allows only a single device driver to be loaded and accessed at a time. ASIO device drivers must be supplied by audio hardware manufacturers, though ASIO emulation is possible on top of systems with DirectSound drivers. The <em>numberOfBuffers</em> parameter to the <a class="el" href="classRtAudio.html#a3">RtAudio::openStream()</a> function has no affect in this implementation.<p>
A number of ASIO source and header files are required for use with <a class="el" href="classRtAudio.html">RtAudio</a>. Specifically, an <a class="el" href="classRtAudio.html">RtAudio</a> project must include the following files: <code>asio.h,cpp; asiodrivers.h,cpp; asiolist.h,cpp; asiodrvr.h; asiosys.h; ginclude.h; iasiodrv.h</code>. The Visual C++ projects found in <code>/tests/Windows/</code> compile both ASIO and DirectSound support.<h2><a class="anchor" name="acknowledge">
Acknowledgements</a></h2>
The <a class="el" href="classRtAudio.html">RtAudio</a> API incorporates many of the concepts developed in the <a href="http://www.portaudio.com/">PortAudio</a> project by Phil Burk and Ross Bencina. Early development also incorporated ideas from Bill Schottstaedt's <a href="http://www-ccrma.stanford.edu/software/snd/sndlib/">sndlib</a>. The CCRMA <a href="http://www-ccrma.stanford.edu/groups/soundwire/">SoundWire group</a> provided valuable feedback during the API proposal stages.<p>
The early 2.0 version of <a class="el" href="classRtAudio.html">RtAudio</a> was slowly developed over the course of many months while in residence at the <a href="http://www.iua.upf.es/">Institut Universitari de L'Audiovisual (IUA)</a> in Barcelona, Spain and the <a href="http://www.acoustics.hut.fi/">Laboratory of Acoustics and Audio Signal Processing</a> at the Helsinki University of Technology, Finland. Much subsequent development happened while working at the <a href="http://www-ccrma.stanford.edu/">Center for Computer Research in Music and Acoustics (CCRMA)</a> at <a href="http://www.stanford.edu/">Stanford University</a>. The most recent version of <a class="el" href="classRtAudio.html">RtAudio</a> was finished while working as an assistant professor of <a href="http://www.music.mcgill.ca/musictech/">Music Technology</a> at <a href="http://www.mcgill.ca/">McGill University</a>. This work was supported in part by the United States Air Force Office of Scientific Research (grant #F49620-99-1-0293).<h2><a class="anchor" name="license">
License</a></h2>
<a class="el" href="classRtAudio.html">RtAudio</a>: a realtime audio i/o C++ classes<br>
Copyright (c) 2001-2004 Gary P. Scavone<p>
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:<p>
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.<p>
Any person wishing to distribute modifications to the Software is requested to send the modifications to the original developer so that they can be incorporated into the canonical version.<p>
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. <HR>
<table><tr><td><img src="../images/mcgill.gif" width=165></td>
<td>&copy;2001-2004 Gary P. Scavone, McGill University. All Rights Reserved.<br>
Maintained by Gary P. Scavone, <a href="mailto:gary@music.mcgill.ca">gary@music.mcgill.ca</a></td></tr>
</table>
</BODY>
</HTML>

View File

@@ -1,28 +0,0 @@
<HTML>
<HEAD>
<TITLE>The RtAudio Tutorial</TITLE>
<LINK HREF="doxygen.css" REL="stylesheet" TYPE="text/css">
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<CENTER>
<a class="qindex" href="index.html">Tutorial</a> &nbsp; <a class="qindex" href="annotated.html">Class/Enum List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; </CENTER>
<HR>
<!-- Generated by Doxygen 1.3.4 -->
<h1>RtAudioDeviceInfo Member List</h1>This is the complete list of members for <a class="el" href="structRtAudioDeviceInfo.html">RtAudioDeviceInfo</a>, including all inherited members.<table>
<tr class="memlist"><td><a class="el" href="structRtAudioDeviceInfo.html#o4">duplexChannels</a></td><td><a class="el" href="structRtAudioDeviceInfo.html">RtAudioDeviceInfo</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="structRtAudioDeviceInfo.html#o3">inputChannels</a></td><td><a class="el" href="structRtAudioDeviceInfo.html">RtAudioDeviceInfo</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="structRtAudioDeviceInfo.html#o5">isDefault</a></td><td><a class="el" href="structRtAudioDeviceInfo.html">RtAudioDeviceInfo</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="structRtAudioDeviceInfo.html#o0">name</a></td><td><a class="el" href="structRtAudioDeviceInfo.html">RtAudioDeviceInfo</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="structRtAudioDeviceInfo.html#o7">nativeFormats</a></td><td><a class="el" href="structRtAudioDeviceInfo.html">RtAudioDeviceInfo</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="structRtAudioDeviceInfo.html#o2">outputChannels</a></td><td><a class="el" href="structRtAudioDeviceInfo.html">RtAudioDeviceInfo</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="structRtAudioDeviceInfo.html#o1">probed</a></td><td><a class="el" href="structRtAudioDeviceInfo.html">RtAudioDeviceInfo</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="structRtAudioDeviceInfo.html#o6">sampleRates</a></td><td><a class="el" href="structRtAudioDeviceInfo.html">RtAudioDeviceInfo</a></td><td></td></tr>
</table><HR>
<table><tr><td><img src="../images/mcgill.gif" width=165></td>
<td>&copy;2001-2004 Gary P. Scavone, McGill University. All Rights Reserved.<br>
Maintained by Gary P. Scavone, <a href="mailto:gary@music.mcgill.ca">gary@music.mcgill.ca</a></td></tr>
</table>
</BODY>
</HTML>

View File

@@ -1,226 +0,0 @@
<HTML>
<HEAD>
<TITLE>The RtAudio Tutorial</TITLE>
<LINK HREF="doxygen.css" REL="stylesheet" TYPE="text/css">
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<CENTER>
<a class="qindex" href="index.html">Tutorial</a> &nbsp; <a class="qindex" href="annotated.html">Class/Enum List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; </CENTER>
<HR>
<!-- Generated by Doxygen 1.3.4 -->
<h1>RtAudioDeviceInfo Struct Reference</h1>The public device information structure for returning queried values.
<a href="#_details">More...</a>
<p>
<code>#include &lt;<a class="el" href="RtAudio_8h-source.html">RtAudio.h</a>&gt;</code>
<p>
<a href="structRtAudioDeviceInfo-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Public Attributes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>std::string&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="structRtAudioDeviceInfo.html#o0">name</a></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>bool&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="structRtAudioDeviceInfo.html#o1">probed</a></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>int&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="structRtAudioDeviceInfo.html#o2">outputChannels</a></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>int&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="structRtAudioDeviceInfo.html#o3">inputChannels</a></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>int&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="structRtAudioDeviceInfo.html#o4">duplexChannels</a></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>bool&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="structRtAudioDeviceInfo.html#o5">isDefault</a></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>std::vector&lt; int &gt;&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="structRtAudioDeviceInfo.html#o6">sampleRates</a></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>RtAudioFormat&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="structRtAudioDeviceInfo.html#o7">nativeFormats</a></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
The public device information structure for returning queried values.
<p>
<hr><h2>Member Data Documentation</h2>
<a class="anchor" name="o0" doxytag="RtAudioDeviceInfo::name" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> std::string <a class="el" href="structRtAudioDeviceInfo.html#o0">RtAudioDeviceInfo::name</a>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Character string device identifier. </td>
</tr>
</table>
<a class="anchor" name="o1" doxytag="RtAudioDeviceInfo::probed" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> bool <a class="el" href="structRtAudioDeviceInfo.html#o1">RtAudioDeviceInfo::probed</a>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
true if the device capabilities were successfully probed. </td>
</tr>
</table>
<a class="anchor" name="o2" doxytag="RtAudioDeviceInfo::outputChannels" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> int <a class="el" href="structRtAudioDeviceInfo.html#o2">RtAudioDeviceInfo::outputChannels</a>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Maximum output channels supported by device. </td>
</tr>
</table>
<a class="anchor" name="o3" doxytag="RtAudioDeviceInfo::inputChannels" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> int <a class="el" href="structRtAudioDeviceInfo.html#o3">RtAudioDeviceInfo::inputChannels</a>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Maximum input channels supported by device. </td>
</tr>
</table>
<a class="anchor" name="o4" doxytag="RtAudioDeviceInfo::duplexChannels" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> int <a class="el" href="structRtAudioDeviceInfo.html#o4">RtAudioDeviceInfo::duplexChannels</a>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Maximum simultaneous input/output channels supported by device. </td>
</tr>
</table>
<a class="anchor" name="o5" doxytag="RtAudioDeviceInfo::isDefault" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> bool <a class="el" href="structRtAudioDeviceInfo.html#o5">RtAudioDeviceInfo::isDefault</a>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
true if this is the default output or input device. </td>
</tr>
</table>
<a class="anchor" name="o6" doxytag="RtAudioDeviceInfo::sampleRates" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> std::vector&lt;int&gt; <a class="el" href="structRtAudioDeviceInfo.html#o6">RtAudioDeviceInfo::sampleRates</a>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Supported sample rates (queried from list of standard rates). </td>
</tr>
</table>
<a class="anchor" name="o7" doxytag="RtAudioDeviceInfo::nativeFormats" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> RtAudioFormat <a class="el" href="structRtAudioDeviceInfo.html#o7">RtAudioDeviceInfo::nativeFormats</a>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Bit mask of supported data formats. </td>
</tr>
</table>
<hr>The documentation for this struct was generated from the following file:<ul>
<li><a class="el" href="RtAudio_8h-source.html">RtAudio.h</a></ul>
<HR>
<table><tr><td><img src="../images/mcgill.gif" width=165></td>
<td>&copy;2001-2004 Gary P. Scavone, McGill University. All Rights Reserved.<br>
Maintained by Gary P. Scavone, <a href="mailto:gary@music.mcgill.ca">gary@music.mcgill.ca</a></td></tr>
</table>
</BODY>
</HTML>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

View File

@@ -1,35 +0,0 @@
RtAudio - a set of C++ classes which provide a common API for realtime audio input/output across Linux (native ALSA, JACK, and OSS), SGI, Macintosh OS X (CoreAudio), and Windows (DirectSound and ASIO) operating systems.
By Gary P. Scavone, 2001-2004.
v3.0.1: (22 March 2004)
- bug fix in Windows DirectSound support for cards with output only
v3.0: (11 March 2004)
- added Linux Jack audio server support
- new multi-api support by subclassing all apis and making rtaudio a controller class
- added over/underload check to Mac OS X support
- new scheme for blocking functionality in callback-based apis (CoreAudio, ASIO, and JACK)
- removed multiple stream support (all stream indentifier arguments removed)
- various style and name changes to conform with standard C++ practice
v2.1.1: (24 October 2002)
- bug fix in duplex for Mac OS X and Windows ASIO code
- duplex example change in tutorial
v2.1: (7 October 2002)
- added Mac OS X CoreAudio support
- added Windows ASIO support
- API change to getDeviceInfo(): device argument must be an integer between 1 - getDeviceCount().
- "configure" support added for unix systems
- adopted MIT-like license
- various internal structural changes and bug fixes
v2.01: (27 April 2002)
- Windows destructor bug fix when no devices available
- RtAudioError class renamed to RtError
- Preprocessor definitions changed slightly (i.e. __LINUX_OSS_ to __LINUX_OSS__) to conform with new Synthesis ToolKit distribution
v2.0: (22 January 2002)
- first release of new independent class

View File

@@ -1,30 +0,0 @@
RtAudio - a set of C++ classes which provide a common API for realtime audio input/output across Linux (native ALSA, JACK, and OSS), SGI, Macintosh OS X (CoreAudio), and Windows (DirectSound and ASIO) operating systems.
By Gary P. Scavone, 2001-2004.
To configure and compile (on Unix systems):
1. Unpack the RtAudio distribution (tar -xzf rtaudio-x.x.tar.gz).
2. From within the directory containing this file, run configure:
./configure
3. From within the "tests" directory, type "make".
A few options can be passed to configure, including:
--enable-debug = enable various debug output
--with-alsa = choose native ALSA API support (linux only)
--with-jack = choose JACK server support (linux only)
--with-oss = choose OSS API support (linux only)
Typing "./configure --help" will display all the available options.
If you wish to use a different compiler than that selected by configure, specify that compiler in the command line (ex. to use CC):
./configure CXX=CC
For Windows Users:
Visual C++ 6.0 project files are included for the test programs in the /tests/Windows/ directory. These projects compile API support for both ASIO and DirectSound.

View File

@@ -1,67 +0,0 @@
RtAudio - a set of C++ classes which provide a common API for realtime audio input/output across Linux (native ALSA, JACK, and OSS), SGI, Macintosh OS X (CoreAudio), and Windows (DirectSound and ASIO) operating systems.
By Gary P. Scavone, 2001-2004.
Modified for Audacity distribution by Dominic Mazzoni, 2006. The
configure/make system builds librtaudio.a and rtaudio-config, and
ASIO has been removed for licensing reasons.
This distribution of RtAudio contains the following:
doc: RtAudio documentation (see doc/html/index.html)
tests: example RtAudio programs
tests/Windows: Visual C++ 6.0 test program workspace and projects
OVERVIEW:
RtAudio is a set of C++ classes which provide a common API (Application Programming Interface) for realtime audio input/output across Linux (native ALSA, JACK, and OSS), SGI, Macintosh OS X (CoreAudio), and Windows (DirectSound and ASIO) operating systems. RtAudio significantly simplifies the process of interacting with computer audio hardware. It was designed with the following goals:
- object oriented C++ design
- simple, common API across all supported platforms
- only two header files and one source file for easy inclusion in programming projects
- allow simultaneous multi-api support
- blocking functionality
- callback functionality
- extensive audio device parameter control
- audio device capability probing
- automatic internal conversion for data format, channel number compensation, de-interleaving, and byte-swapping
RtAudio incorporates the concept of audio streams, which represent audio output (playback) and/or input (recording). Available audio devices and their capabilities can be enumerated and then specified when opening a stream. Where applicable, multiple API support can be compiled and a particular API specified when creating an RtAudio instance.
The RtAudio API provides both blocking (synchronous) and callback (asyncronous) functionality. Callbacks are typically used in conjunction with graphical user interfaces (GUI). Blocking functionality is often necessary for explicit control of multiple input/output stream synchronization or when audio must be synchronized with other system events.
FURTHER READING:
For complete documentation on RtAudio, see the doc directory of the distribution or surf to http://music.mcgill.ca/~gary/rtaudio/.
LEGAL AND ETHICAL:
The RtAudio license is similar to the the MIT License, with the added "feature" that modifications be sent to the developer.
RtAudio: a set of realtime audio i/o C++ classes
Copyright (c) 2001-2004 Gary P. Scavone
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
Any person wishing to distribute modifications to the Software is
requested to send the modifications to the original developer so that
they can be incorporated into the canonical version.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@@ -1,16 +0,0 @@
#! /bin/sh
if (test "x$#" != "x1") ; then
echo "Usage: $0 [--libs | --cxxflags]"
exit;
fi
LIBRARY="@LIBS@ @frameworks@"
CFLAGS="@audio_apis@"
if (test "x$1" == "x--libs") ; then
echo "$LIBRARY"
elif (test "x$1" == "x--cflags") ; then
echo "$CFLAGS"
else
echo "Unknown option: $1"
fi

View File

@@ -1,58 +0,0 @@
### RtAudio tests Makefile - for various flavors of unix
PROGRAMS = info play_saw record_raw in_out play_raw twostreams call_saw call_inout
RM = /bin/rm
SRC_PATH = ../
INCLUDE = ../
OBJECT_PATH = @object_path@
vpath %.o $(OBJECT_PATH)
OBJECTS = RtAudio.o
CC = @CXX@
DEFS = @debug@
DEFS += @audio_apis@
CFLAGS = @cflags@
CFLAGS += @warn@ -I$(INCLUDE)
LIBRARY = @LIBS@
LIBRARY += @frameworks@
%.o : $(SRC_PATH)/%.cpp
$(CC) $(CFLAGS) $(DEFS) -c $(<) -o $(OBJECT_PATH)/$@
all : $(PROGRAMS)
info : info.cpp $(OBJECTS)
$(CC) $(CFLAGS) $(DEFS) -o info info.cpp $(OBJECT_PATH)/RtAudio.o $(LIBRARY)
play_saw : play_saw.cpp $(OBJECTS)
$(CC) $(CFLAGS) $(DEFS) -o play_saw play_saw.cpp $(OBJECT_PATH)/RtAudio.o $(LIBRARY)
play_raw : play_raw.cpp $(OBJECTS)
$(CC) $(CFLAGS) $(DEFS) -o play_raw play_raw.cpp $(OBJECT_PATH)/RtAudio.o $(LIBRARY)
record_raw : record_raw.cpp $(OBJECTS)
$(CC) $(CFLAGS) $(DEFS) -o record_raw record_raw.cpp $(OBJECT_PATH)/RtAudio.o $(LIBRARY)
in_out : in_out.cpp $(OBJECTS)
$(CC) $(CFLAGS) $(DEFS) -o in_out in_out.cpp $(OBJECT_PATH)/RtAudio.o $(LIBRARY)
twostreams : twostreams.cpp $(OBJECTS)
$(CC) $(CFLAGS) $(DEFS) -o twostreams twostreams.cpp $(OBJECT_PATH)/RtAudio.o $(LIBRARY)
call_saw : call_saw.cpp $(OBJECTS)
$(CC) $(CFLAGS) $(DEFS) -o call_saw call_saw.cpp $(OBJECT_PATH)/RtAudio.o $(LIBRARY)
call_inout : call_inout.cpp $(OBJECTS)
$(CC) $(CFLAGS) $(DEFS) -o call_inout call_inout.cpp $(OBJECT_PATH)/RtAudio.o $(LIBRARY)
clean :
-rm -f $(OBJECT_PATH)/*.o
-rm -f $(PROGRAMS)
-rm -f *~
distclean: clean
-rm -f Makefile
strip :
strip $(PROGRAMS)

View File

@@ -1,257 +0,0 @@
/*
Steinberg Audio Stream I/O API
(c) 1996, Steinberg Soft- und Hardware GmbH
asio.cpp
asio functions entries which translate the
asio interface to the asiodrvr class methods
*/
#include <string.h>
#include "asiosys.h" // platform definition
#include "asio.h"
#if MAC
#include "asiodrvr.h"
#pragma export on
AsioDriver *theAsioDriver = 0;
extern "C"
{
long main()
{
return 'ASIO';
}
#elif WINDOWS
#include "windows.h"
#include "iasiodrv.h"
#include "asiodrivers.h"
IASIO *theAsioDriver = 0;
extern AsioDrivers *asioDrivers;
#elif SGI || SUN || BEOS || LINUX
#include "asiodrvr.h"
static AsioDriver *theAsioDriver = 0;
#endif
//-----------------------------------------------------------------------------------------------------
ASIOError ASIOInit(ASIODriverInfo *info)
{
#if MAC || SGI || SUN || BEOS || LINUX
if(theAsioDriver)
{
delete theAsioDriver;
theAsioDriver = 0;
}
info->driverVersion = 0;
strcpy(info->name, "No ASIO Driver");
theAsioDriver = getDriver();
if(!theAsioDriver)
{
strcpy(info->errorMessage, "Not enough memory for the ASIO driver!");
return ASE_NotPresent;
}
if(!theAsioDriver->init(info->sysRef))
{
theAsioDriver->getErrorMessage(info->errorMessage);
delete theAsioDriver;
theAsioDriver = 0;
return ASE_NotPresent;
}
strcpy(info->errorMessage, "No ASIO Driver Error");
theAsioDriver->getDriverName(info->name);
info->driverVersion = theAsioDriver->getDriverVersion();
return ASE_OK;
#else
info->driverVersion = 0;
strcpy(info->name, "No ASIO Driver");
if(theAsioDriver) // must be loaded!
{
if(!theAsioDriver->init(info->sysRef))
{
theAsioDriver->getErrorMessage(info->errorMessage);
theAsioDriver = 0;
return ASE_NotPresent;
}
strcpy(info->errorMessage, "No ASIO Driver Error");
theAsioDriver->getDriverName(info->name);
info->driverVersion = theAsioDriver->getDriverVersion();
return ASE_OK;
}
return ASE_NotPresent;
#endif // !MAC
}
ASIOError ASIOExit(void)
{
if(theAsioDriver)
{
#if WINDOWS
asioDrivers->removeCurrentDriver();
#else
delete theAsioDriver;
#endif
}
theAsioDriver = 0;
return ASE_OK;
}
ASIOError ASIOStart(void)
{
if(!theAsioDriver)
return ASE_NotPresent;
return theAsioDriver->start();
}
ASIOError ASIOStop(void)
{
if(!theAsioDriver)
return ASE_NotPresent;
return theAsioDriver->stop();
}
ASIOError ASIOGetChannels(long *numInputChannels, long *numOutputChannels)
{
if(!theAsioDriver)
{
*numInputChannels = *numOutputChannels = 0;
return ASE_NotPresent;
}
return theAsioDriver->getChannels(numInputChannels, numOutputChannels);
}
ASIOError ASIOGetLatencies(long *inputLatency, long *outputLatency)
{
if(!theAsioDriver)
{
*inputLatency = *outputLatency = 0;
return ASE_NotPresent;
}
return theAsioDriver->getLatencies(inputLatency, outputLatency);
}
ASIOError ASIOGetBufferSize(long *minSize, long *maxSize, long *preferredSize, long *granularity)
{
if(!theAsioDriver)
{
*minSize = *maxSize = *preferredSize = *granularity = 0;
return ASE_NotPresent;
}
return theAsioDriver->getBufferSize(minSize, maxSize, preferredSize, granularity);
}
ASIOError ASIOCanSampleRate(ASIOSampleRate sampleRate)
{
if(!theAsioDriver)
return ASE_NotPresent;
return theAsioDriver->canSampleRate(sampleRate);
}
ASIOError ASIOGetSampleRate(ASIOSampleRate *currentRate)
{
if(!theAsioDriver)
return ASE_NotPresent;
return theAsioDriver->getSampleRate(currentRate);
}
ASIOError ASIOSetSampleRate(ASIOSampleRate sampleRate)
{
if(!theAsioDriver)
return ASE_NotPresent;
return theAsioDriver->setSampleRate(sampleRate);
}
ASIOError ASIOGetClockSources(ASIOClockSource *clocks, long *numSources)
{
if(!theAsioDriver)
{
*numSources = 0;
return ASE_NotPresent;
}
return theAsioDriver->getClockSources(clocks, numSources);
}
ASIOError ASIOSetClockSource(long reference)
{
if(!theAsioDriver)
return ASE_NotPresent;
return theAsioDriver->setClockSource(reference);
}
ASIOError ASIOGetSamplePosition(ASIOSamples *sPos, ASIOTimeStamp *tStamp)
{
if(!theAsioDriver)
return ASE_NotPresent;
return theAsioDriver->getSamplePosition(sPos, tStamp);
}
ASIOError ASIOGetChannelInfo(ASIOChannelInfo *info)
{
if(!theAsioDriver)
{
info->channelGroup = -1;
info->type = ASIOSTInt16MSB;
strcpy(info->name, "None");
return ASE_NotPresent;
}
return theAsioDriver->getChannelInfo(info);
}
ASIOError ASIOCreateBuffers(ASIOBufferInfo *bufferInfos, long numChannels,
long bufferSize, ASIOCallbacks *callbacks)
{
if(!theAsioDriver)
{
ASIOBufferInfo *info = bufferInfos;
for(long i = 0; i < numChannels; i++, info++)
info->buffers[0] = info->buffers[1] = 0;
return ASE_NotPresent;
}
return theAsioDriver->createBuffers(bufferInfos, numChannels, bufferSize, callbacks);
}
ASIOError ASIODisposeBuffers(void)
{
if(!theAsioDriver)
return ASE_NotPresent;
return theAsioDriver->disposeBuffers();
}
ASIOError ASIOControlPanel(void)
{
if(!theAsioDriver)
return ASE_NotPresent;
return theAsioDriver->controlPanel();
}
ASIOError ASIOFuture(long selector, void *opt)
{
if(!theAsioDriver)
return ASE_NotPresent;
return theAsioDriver->future(selector, opt);
}
ASIOError ASIOOutputReady(void)
{
if(!theAsioDriver)
return ASE_NotPresent;
return theAsioDriver->outputReady();
}
#if MAC
} // extern "C"
#pragma export off
#endif

View File

@@ -1,955 +0,0 @@
//---------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------
/*
Steinberg Audio Stream I/O API
(c) 1997 - 1999, Steinberg Soft- und Hardware GmbH
ASIO Interface Specification v 2.0
basic concept is an i/o synchronous double-buffer scheme:
on bufferSwitch(index == 0), host will read/write:
after ASIOStart(), the
read first input buffer A (index 0)
| will be invalid (empty)
* ------------------------
|------------------------|-----------------------|
| | |
| Input Buffer A (0) | Input Buffer B (1) |
| | |
|------------------------|-----------------------|
| | |
| Output Buffer A (0) | Output Buffer B (1) |
| | |
|------------------------|-----------------------|
* -------------------------
| before calling ASIOStart(),
write host will have filled output
buffer B (index 1) already
*please* take special care of proper statement of input
and output latencies (see ASIOGetLatencies()), these
control sequencer sync accuracy
*/
//---------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------
/*
prototypes summary:
ASIOError ASIOInit(ASIODriverInfo *info);
ASIOError ASIOExit(void);
ASIOError ASIOStart(void);
ASIOError ASIOStop(void);
ASIOError ASIOGetChannels(long *numInputChannels, long *numOutputChannels);
ASIOError ASIOGetLatencies(long *inputLatency, long *outputLatency);
ASIOError ASIOGetBufferSize(long *minSize, long *maxSize, long *preferredSize, long *granularity);
ASIOError ASIOCanSampleRate(ASIOSampleRate sampleRate);
ASIOError ASIOGetSampleRate(ASIOSampleRate *currentRate);
ASIOError ASIOSetSampleRate(ASIOSampleRate sampleRate);
ASIOError ASIOGetClockSources(ASIOClockSource *clocks, long *numSources);
ASIOError ASIOSetClockSource(long reference);
ASIOError ASIOGetSamplePosition (ASIOSamples *sPos, ASIOTimeStamp *tStamp);
ASIOError ASIOGetChannelInfo(ASIOChannelInfo *info);
ASIOError ASIOCreateBuffers(ASIOBufferInfo *bufferInfos, long numChannels,
long bufferSize, ASIOCallbacks *callbacks);
ASIOError ASIODisposeBuffers(void);
ASIOError ASIOControlPanel(void);
void *ASIOFuture(long selector, void *params);
ASIOError ASIOOutputReady(void);
*/
//---------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------
#ifndef __ASIO_H
#define __ASIO_H
// force 4 byte alignment
#if defined(_MSC_VER) && !defined(__MWERKS__)
#pragma pack(push,4)
#elif PRAGMA_ALIGN_SUPPORTED
#pragma options align = native
#endif
//- - - - - - - - - - - - - - - - - - - - - - - - -
// Type definitions
//- - - - - - - - - - - - - - - - - - - - - - - - -
// number of samples data type is 64 bit integer
#if NATIVE_INT64
typedef long long int ASIOSamples;
#else
typedef struct ASIOSamples {
unsigned long hi;
unsigned long lo;
} ASIOSamples;
#endif
// Timestamp data type is 64 bit integer,
// Time format is Nanoseconds.
#if NATIVE_INT64
typedef long long int ASIOTimeStamp ;
#else
typedef struct ASIOTimeStamp {
unsigned long hi;
unsigned long lo;
} ASIOTimeStamp;
#endif
// Samplerates are expressed in IEEE 754 64 bit double float,
// native format as host computer
#if IEEE754_64FLOAT
typedef double ASIOSampleRate;
#else
typedef struct ASIOSampleRate {
char ieee[8];
} ASIOSampleRate;
#endif
// Boolean values are expressed as long
typedef long ASIOBool;
enum {
ASIOFalse = 0,
ASIOTrue = 1
};
// Sample Types are expressed as long
typedef long ASIOSampleType;
enum {
ASIOSTInt16MSB = 0,
ASIOSTInt24MSB = 1, // used for 20 bits as well
ASIOSTInt32MSB = 2,
ASIOSTFloat32MSB = 3, // IEEE 754 32 bit float
ASIOSTFloat64MSB = 4, // IEEE 754 64 bit double float
// these are used for 32 bit data buffer, with different alignment of the data inside
// 32 bit PCI bus systems can be more easily used with these
ASIOSTInt32MSB16 = 8, // 32 bit data with 18 bit alignment
ASIOSTInt32MSB18 = 9, // 32 bit data with 18 bit alignment
ASIOSTInt32MSB20 = 10, // 32 bit data with 20 bit alignment
ASIOSTInt32MSB24 = 11, // 32 bit data with 24 bit alignment
ASIOSTInt16LSB = 16,
ASIOSTInt24LSB = 17, // used for 20 bits as well
ASIOSTInt32LSB = 18,
ASIOSTFloat32LSB = 19, // IEEE 754 32 bit float, as found on Intel x86 architecture
ASIOSTFloat64LSB = 20, // IEEE 754 64 bit double float, as found on Intel x86 architecture
// these are used for 32 bit data buffer, with different alignment of the data inside
// 32 bit PCI bus systems can more easily used with these
ASIOSTInt32LSB16 = 24, // 32 bit data with 18 bit alignment
ASIOSTInt32LSB18 = 25, // 32 bit data with 18 bit alignment
ASIOSTInt32LSB20 = 26, // 32 bit data with 20 bit alignment
ASIOSTInt32LSB24 = 27 // 32 bit data with 24 bit alignment
};
//- - - - - - - - - - - - - - - - - - - - - - - - -
// Error codes
//- - - - - - - - - - - - - - - - - - - - - - - - -
typedef long ASIOError;
enum {
ASE_OK = 0, // This value will be returned whenever the call succeeded
ASE_SUCCESS = 0x3f4847a0, // unique success return value for ASIOFuture calls
ASE_NotPresent = -1000, // hardware input or output is not present or available
ASE_HWMalfunction, // hardware is malfunctioning (can be returned by any ASIO function)
ASE_InvalidParameter, // input parameter invalid
ASE_InvalidMode, // hardware is in a bad mode or used in a bad mode
ASE_SPNotAdvancing, // hardware is not running when sample position is inquired
ASE_NoClock, // sample clock or rate cannot be determined or is not present
ASE_NoMemory // not enough memory for completing the request
};
//---------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------
//- - - - - - - - - - - - - - - - - - - - - - - - -
// Time Info support
//- - - - - - - - - - - - - - - - - - - - - - - - -
typedef struct ASIOTimeCode
{
double speed; // speed relation (fraction of nominal speed)
// optional; set to 0. or 1. if not supported
ASIOSamples timeCodeSamples; // time in samples
unsigned long flags; // some information flags (see below)
char future[64];
} ASIOTimeCode;
typedef enum ASIOTimeCodeFlags
{
kTcValid = 1,
kTcRunning = 1 << 1,
kTcReverse = 1 << 2,
kTcOnspeed = 1 << 3,
kTcStill = 1 << 4,
kTcSpeedValid = 1 << 8
} ASIOTimeCodeFlags;
typedef struct AsioTimeInfo
{
double speed; // absolute speed (1. = nominal)
ASIOTimeStamp systemTime; // system time related to samplePosition, in nanoseconds
// on mac, must be derived from Microseconds() (not UpTime()!)
// on windows, must be derived from timeGetTime()
ASIOSamples samplePosition;
ASIOSampleRate sampleRate; // current rate
unsigned long flags; // (see below)
char reserved[12];
} AsioTimeInfo;
typedef enum AsioTimeInfoFlags
{
kSystemTimeValid = 1, // must always be valid
kSamplePositionValid = 1 << 1, // must always be valid
kSampleRateValid = 1 << 2,
kSpeedValid = 1 << 3,
kSampleRateChanged = 1 << 4,
kClockSourceChanged = 1 << 5
} AsioTimeInfoFlags;
typedef struct ASIOTime // both input/output
{
long reserved[4]; // must be 0
struct AsioTimeInfo timeInfo; // required
struct ASIOTimeCode timeCode; // optional, evaluated if (timeCode.flags & kTcValid)
} ASIOTime;
/*
using time info:
it is recommended to use the new method with time info even if the asio
device does not support timecode; continuous calls to ASIOGetSamplePosition
and ASIOGetSampleRate are avoided, and there is a more defined relationship
between callback time and the time info.
see the example below.
to initiate time info mode, after you have received the callbacks pointer in
ASIOCreateBuffers, you will call the asioMessage callback with kAsioSupportsTimeInfo
as the argument. if this returns 1, host has accepted time info mode.
now host expects the new callback bufferSwitchTimeInfo to be used instead
of the old bufferSwitch method. the ASIOTime structure is assumed to be valid
and accessible until the callback returns.
using time code:
if the device supports reading time code, it will call host's asioMessage callback
with kAsioSupportsTimeCode as the selector. it may then fill the according
fields and set the kTcValid flag.
host will call the future method with the kAsioEnableTimeCodeRead selector when
it wants to enable or disable tc reading by the device. you should also support
the kAsioCanTimeInfo and kAsioCanTimeCode selectors in ASIOFuture (see example).
note:
the AsioTimeInfo/ASIOTimeCode pair is supposed to work in both directions.
as a matter of convention, the relationship between the sample
position counter and the time code at buffer switch time is
(ignoring offset between tc and sample pos when tc is running):
on input: sample 0 -> input buffer sample 0 -> time code 0
on output: sample 0 -> output buffer sample 0 -> time code 0
this means that for 'real' calculations, one has to take into account
the according latencies.
example:
ASIOTime asioTime;
in createBuffers()
{
memset(&asioTime, 0, sizeof(ASIOTime));
AsioTimeInfo* ti = &asioTime.timeInfo;
ti->sampleRate = theSampleRate;
ASIOTimeCode* tc = &asioTime.timeCode;
tc->speed = 1.;
timeInfoMode = false;
canTimeCode = false;
if(callbacks->asioMessage(kAsioSupportsTimeInfo, 0, 0, 0) == 1)
{
timeInfoMode = true;
#if kCanTimeCode
if(callbacks->asioMessage(kAsioSupportsTimeCode, 0, 0, 0) == 1)
canTimeCode = true;
#endif
}
}
void switchBuffers(long doubleBufferIndex, bool processNow)
{
if(timeInfoMode)
{
AsioTimeInfo* ti = &asioTime.timeInfo;
ti->flags = kSystemTimeValid | kSamplePositionValid | kSampleRateValid;
ti->systemTime = theNanoSeconds;
ti->samplePosition = theSamplePosition;
if(ti->sampleRate != theSampleRate)
ti->flags |= kSampleRateChanged;
ti->sampleRate = theSampleRate;
#if kCanTimeCode
if(canTimeCode && timeCodeEnabled)
{
ASIOTimeCode* tc = &asioTime.timeCode;
tc->timeCodeSamples = tcSamples; // tc in samples
tc->flags = kTcValid | kTcRunning | kTcOnspeed; // if so...
}
ASIOTime* bb = callbacks->bufferSwitchTimeInfo(&asioTime, doubleBufferIndex, processNow ? ASIOTrue : ASIOFalse);
#else
callbacks->bufferSwitchTimeInfo(&asioTime, doubleBufferIndex, processNow ? ASIOTrue : ASIOFalse);
#endif
}
else
callbacks->bufferSwitch(doubleBufferIndex, ASIOFalse);
}
ASIOError ASIOFuture(long selector, void *params)
{
switch(selector)
{
case kAsioEnableTimeCodeRead:
timeCodeEnabled = true;
return ASE_SUCCESS;
case kAsioDisableTimeCodeRead:
timeCodeEnabled = false;
return ASE_SUCCESS;
case kAsioCanTimeInfo:
return ASE_SUCCESS;
#if kCanTimeCode
case kAsioCanTimeCode:
return ASE_SUCCESS;
#endif
}
return ASE_NotPresent;
};
*/
//- - - - - - - - - - - - - - - - - - - - - - - - -
// application's audio stream handler callbacks
//- - - - - - - - - - - - - - - - - - - - - - - - -
typedef struct ASIOCallbacks
{
void (*bufferSwitch) (long doubleBufferIndex, ASIOBool directProcess);
// bufferSwitch indicates that both input and output are to be processed.
// the current buffer half index (0 for A, 1 for B) determines
// - the output buffer that the host should start to fill. the other buffer
// will be passed to output hardware regardless of whether it got filled
// in time or not.
// - the input buffer that is now filled with incoming data. Note that
// because of the synchronicity of i/o, the input always has at
// least one buffer latency in relation to the output.
// directProcess suggests to the host whether it should immedeately
// start processing (directProcess == ASIOTrue), or whether its process
// should be deferred because the call comes from a very low level
// (for instance, a high level priority interrupt), and direct processing
// would cause timing instabilities for the rest of the system. If in doubt,
// directProcess should be set to ASIOFalse.
// Note: bufferSwitch may be called at interrupt time for highest efficiency.
void (*sampleRateDidChange) (ASIOSampleRate sRate);
// gets called when the AudioStreamIO detects a sample rate change
// If sample rate is unknown, 0 is passed (for instance, clock loss
// when externally synchronized).
long (*asioMessage) (long selector, long value, void* message, double* opt);
// generic callback for various purposes, see selectors below.
// note this is only present if the asio version is 2 or higher
ASIOTime* (*bufferSwitchTimeInfo) (ASIOTime* params, long doubleBufferIndex, ASIOBool directProcess);
// new callback with time info. makes ASIOGetSamplePosition() and various
// calls to ASIOGetSampleRate obsolete,
// and allows for timecode sync etc. to be preferred; will be used if
// the driver calls asioMessage with selector kAsioSupportsTimeInfo.
} ASIOCallbacks;
// asioMessage selectors
enum
{
kAsioSelectorSupported = 1, // selector in <value>, returns 1L if supported,
// 0 otherwise
kAsioEngineVersion, // returns engine (host) asio implementation version,
// 2 or higher
kAsioResetRequest, // request driver reset. if accepted, this
// will close the driver (ASIO_Exit() ) and
// re-open it again (ASIO_Init() etc). some
// drivers need to reconfigure for instance
// when the sample rate changes, or some basic
// changes have been made in ASIO_ControlPanel().
// returns 1L; note the request is merely passed
// to the application, there is no way to determine
// if it gets accepted at this time (but it usually
// will be).
kAsioBufferSizeChange, // not yet supported, will currently always return 0L.
// for now, use kAsioResetRequest instead.
// once implemented, the new buffer size is expected
// in <value>, and on success returns 1L
kAsioResyncRequest, // the driver went out of sync, such that
// the timestamp is no longer valid. this
// is a request to re-start the engine and
// slave devices (sequencer). returns 1 for ok,
// 0 if not supported.
kAsioLatenciesChanged, // the drivers latencies have changed. The engine
// will refetch the latencies.
kAsioSupportsTimeInfo, // if host returns true here, it will expect the
// callback bufferSwitchTimeInfo to be called instead
// of bufferSwitch
kAsioSupportsTimeCode, // supports time code reading/writing
kAsioSupportsInputMonitor, // supports input monitoring
kAsioNumMessageSelectors
};
//---------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------
//- - - - - - - - - - - - - - - - - - - - - - - - -
// (De-)Construction
//- - - - - - - - - - - - - - - - - - - - - - - - -
typedef struct ASIODriverInfo
{
long asioVersion; // currently, 2
long driverVersion; // driver specific
char name[32];
char errorMessage[124];
void *sysRef; // on input: system reference
// (Windows: application main window handle, Mac & SGI: 0)
} ASIODriverInfo;
ASIOError ASIOInit(ASIODriverInfo *info);
/* Purpose:
Initialize the AudioStreamIO.
Parameter:
info: pointer to an ASIODriver structure:
- asioVersion:
- on input, the host version. *** Note *** this is 0 for earlier asio
implementations, and the asioMessage callback is implemeted
only if asioVersion is 2 or greater. sorry but due to a design fault
the driver doesn't have access to the host version in ASIOInit :-(
added selector for host (engine) version in the asioMessage callback
so we're ok from now on.
- on return, asio implementation version.
older versions are 1
if you support this version (namely, ASIO_outputReady() )
this should be 2 or higher. also see the note in
ASIO_getTimeStamp() !
- version: on return, the driver version (format is driver specific)
- name: on return, a null-terminated string containing the driver's name
- error message: on return, should contain a user message describing
the type of error that occured during ASIOInit(), if any.
- sysRef: platform specific
Returns:
If neither input nor output is present ASE_NotPresent
will be returned.
ASE_NoMemory, ASE_HWMalfunction are other possible error conditions
*/
ASIOError ASIOExit(void);
/* Purpose:
Terminates the AudioStreamIO.
Parameter:
None.
Returns:
If neither input nor output is present ASE_NotPresent
will be returned.
Notes: this implies ASIOStop() and ASIODisposeBuffers(),
meaning that no host callbacks must be accessed after ASIOExit().
*/
//- - - - - - - - - - - - - - - - - - - - - - - - -
// Start/Stop
//- - - - - - - - - - - - - - - - - - - - - - - - -
ASIOError ASIOStart(void);
/* Purpose:
Start input and output processing synchronously.
This will
- reset the sample counter to zero
- start the hardware (both input and output)
The first call to the hosts' bufferSwitch(index == 0) then tells
the host to read from input buffer A (index 0), and start
processing to output buffer A while output buffer B (which
has been filled by the host prior to calling ASIOStart())
is possibly sounding (see also ASIOGetLatencies())
Parameter:
None.
Returns:
If neither input nor output is present, ASE_NotPresent
will be returned.
If the hardware fails to start, ASE_HWMalfunction will be returned.
Notes:
There is no restriction on the time that ASIOStart() takes
to perform (that is, it is not considered a realtime trigger).
*/
ASIOError ASIOStop(void);
/* Purpose:
Stops input and output processing altogether.
Parameter:
None.
Returns:
If neither input nor output is present ASE_NotPresent
will be returned.
Notes:
On return from ASIOStop(), the driver must in no
case call the hosts' bufferSwitch() routine.
*/
//- - - - - - - - - - - - - - - - - - - - - - - - -
// Inquiry methods and sample rate
//- - - - - - - - - - - - - - - - - - - - - - - - -
ASIOError ASIOGetChannels(long *numInputChannels, long *numOutputChannels);
/* Purpose:
Returns number of individual input/output channels.
Parameter:
numInputChannels will hold the number of available input channels
numOutputChannels will hold the number of available output channels
Returns:
If no input/output is present ASE_NotPresent will be returned.
If only inputs, or only outputs are available, the according
other parameter will be zero, and ASE_OK is returned.
*/
ASIOError ASIOGetLatencies(long *inputLatency, long *outputLatency);
/* Purpose:
Returns the input and output latencies. This includes
device specific delays, like FIFOs etc.
Parameter:
inputLatency will hold the 'age' of the first sample frame
in the input buffer when the hosts reads it in bufferSwitch()
(this is theoretical, meaning it does not include the overhead
and delay between the actual physical switch, and the time
when bufferSitch() enters).
This will usually be the size of one block in sample frames, plus
device specific latencies.
outputLatency will specify the time between the buffer switch,
and the time when the next play buffer will start to sound.
The next play buffer is defined as the one the host starts
processing after (or at) bufferSwitch(), indicated by the
index parameter (0 for buffer A, 1 for buffer B).
It will usually be either one block, if the host writes directly
to a dma buffer, or two or more blocks if the buffer is 'latched' by
the driver. As an example, on ASIOStart(), the host will have filled
the play buffer at index 1 already; when it gets the callback (with
the parameter index == 0), this tells it to read from the input
buffer 0, and start to fill the play buffer 0 (assuming that now
play buffer 1 is already sounding). In this case, the output
latency is one block. If the driver decides to copy buffer 1
at that time, and pass it to the hardware at the next slot (which
is most commonly done, but should be avoided), the output latency
becomes two blocks instead, resulting in a total i/o latency of at least
3 blocks. As memory access is the main bottleneck in native dsp processing,
and to acheive less latency, it is highly recommended to try to avoid
copying (this is also why the driver is the owner of the buffers). To
summarize, the minimum i/o latency can be acheived if the input buffer
is processed by the host into the output buffer which will physically
start to sound on the next time slice. Also note that the host expects
the bufferSwitch() callback to be accessed for each time slice in order
to retain sync, possibly recursively; if it fails to process a block in
time, it will suspend its operation for some time in order to recover.
Returns:
If no input/output is present ASE_NotPresent will be returned.
*/
ASIOError ASIOGetBufferSize(long *minSize, long *maxSize, long *preferredSize, long *granularity);
/* Purpose:
Returns min, max, and preferred buffer sizes for input/output
Parameter:
minSize will hold the minimum buffer size
maxSize will hold the maxium possible buffer size
preferredSize will hold the preferred buffer size (a size which
best fits performance and hardware requirements)
granularity will hold the granularity at which buffer sizes
may differ. Usually, the buffer size will be a power of 2;
in this case, granularity will hold -1 on return, signalling
possible buffer sizes starting from minSize, increased in
powers of 2 up to maxSize.
Returns:
If no input/output is present ASE_NotPresent will be returned.
Notes:
When minimum and maximum buffer size are equal,
the preferred buffer size has to be the same value as well; granularity
should be 0 in this case.
*/
ASIOError ASIOCanSampleRate(ASIOSampleRate sampleRate);
/* Purpose:
Inquires the hardware for the available sample rates.
Parameter:
sampleRate is the rate in question.
Returns:
If the inquired sample rate is not supported, ASE_NoClock will be returned.
If no input/output is present ASE_NotPresent will be returned.
*/
ASIOError ASIOGetSampleRate(ASIOSampleRate *currentRate);
/* Purpose:
Get the current sample Rate.
Parameter:
currentRate will hold the current sample rate on return.
Returns:
If sample rate is unknown, sampleRate will be 0 and ASE_NoClock will be returned.
If no input/output is present ASE_NotPresent will be returned.
Notes:
*/
ASIOError ASIOSetSampleRate(ASIOSampleRate sampleRate);
/* Purpose:
Set the hardware to the requested sample Rate. If sampleRate == 0,
enable external sync.
Parameter:
sampleRate: on input, the requested rate
Returns:
If sampleRate is unknown ASE_NoClock will be returned.
If the current clock is external, and sampleRate is != 0,
ASE_InvalidMode will be returned
If no input/output is present ASE_NotPresent will be returned.
Notes:
*/
typedef struct ASIOClockSource
{
long index; // as used for ASIOSetClockSource()
long associatedChannel; // for instance, S/PDIF or AES/EBU
long associatedGroup; // see channel groups (ASIOGetChannelInfo())
ASIOBool isCurrentSource; // ASIOTrue if this is the current clock source
char name[32]; // for user selection
} ASIOClockSource;
ASIOError ASIOGetClockSources(ASIOClockSource *clocks, long *numSources);
/* Purpose:
Get the available external audio clock sources
Parameter:
clocks points to an array of ASIOClockSource structures:
- index: this is used to identify the clock source
when ASIOSetClockSource() is accessed, should be
an index counting from zero
- associatedInputChannel: the first channel of an associated
input group, if any.
- associatedGroup: the group index of that channel.
groups of channels are defined to seperate for
instance analog, S/PDIF, AES/EBU, ADAT connectors etc,
when present simultaniously. Note that associated channel
is enumerated according to numInputs/numOutputs, means it
is independant from a group (see also ASIOGetChannelInfo())
inputs are associated to a clock if the physical connection
transfers both data and clock (like S/PDIF, AES/EBU, or
ADAT inputs). if there is no input channel associated with
the clock source (like Word Clock, or internal oscillator), both
associatedChannel and associatedGroup should be set to -1.
- isCurrentSource: on exit, ASIOTrue if this is the current clock
source, ASIOFalse else
- name: a null-terminated string for user selection of the available sources.
numSources:
on input: the number of allocated array members
on output: the number of available clock sources, at least
1 (internal clock generator).
Returns:
If no input/output is present ASE_NotPresent will be returned.
Notes:
*/
ASIOError ASIOSetClockSource(long index);
/* Purpose:
Set the audio clock source
Parameter:
index as obtained from an inquiry to ASIOGetClockSources()
Returns:
If no input/output is present ASE_NotPresent will be returned.
If the clock can not be selected because an input channel which
carries the current clock source is active, ASE_InvalidMode
*may* be returned (this depends on the properties of the driver
and/or hardware).
Notes:
Should *not* return ASE_NoClock if there is no clock signal present
at the selected source; this will be inquired via ASIOGetSampleRate().
It should call the host callback procedure sampleRateHasChanged(),
if the switch causes a sample rate change, or if no external clock
is present at the selected source.
*/
ASIOError ASIOGetSamplePosition (ASIOSamples *sPos, ASIOTimeStamp *tStamp);
/* Purpose:
Inquires the sample position/time stamp pair.
Parameter:
sPos will hold the sample position on return. The sample
position is reset to zero when ASIOStart() gets called.
tStamp will hold the system time when the sample position
was latched.
Returns:
If no input/output is present, ASE_NotPresent will be returned.
If there is no clock, ASE_SPNotAdvancing will be returned.
Notes:
in order to be able to synchronise properly,
the sample position / time stamp pair must refer to the current block,
that is, the engine will call ASIOGetSamplePosition() in its bufferSwitch()
callback and expect the time for the current block. thus, when requested
in the very first bufferSwitch after ASIO_Start(), the sample position
should be zero, and the time stamp should refer to the very time where
the stream was started. it also means that the sample position must be
block aligned. the driver must ensure proper interpolation if the system
time can not be determined for the block position. the driver is responsible
for precise time stamps as it usually has most direct access to lower
level resources. proper behaviour of ASIO_GetSamplePosition() and ASIO_GetLatencies()
are essential for precise media synchronization!
*/
typedef struct ASIOChannelInfo
{
long channel; // on input, channel index
ASIOBool isInput; // on input
ASIOBool isActive; // on exit
long channelGroup; // dto
ASIOSampleType type; // dto
char name[32]; // dto
} ASIOChannelInfo;
ASIOError ASIOGetChannelInfo(ASIOChannelInfo *info);
/* Purpose:
retreive information about the nature of a channel
Parameter:
info: pointer to a ASIOChannelInfo structure with
- channel: on input, the channel index of the channel in question.
- isInput: on input, ASIOTrue if info for an input channel is
requested, else output
- channelGroup: on return, the channel group that the channel
belongs to. For drivers which support different types of
channels, like analog, S/PDIF, AES/EBU, ADAT etc interfaces,
there should be a reasonable grouping of these types. Groups
are always independant form a channel index, that is, a channel
index always counts from 0 to numInputs/numOutputs regardless
of the group it may belong to.
There will always be at least one group (group 0). Please
also note that by default, the host may decide to activate
channels 0 and 1; thus, these should belong to the most
useful type (analog i/o, if present).
- type: on return, contains the sample type of the channel
- isActive: on return, ASIOTrue if channel is active as it was
installed by ASIOCreateBuffers(), ASIOFalse else
- name: describing the type of channel in question. Used to allow
for user selection, and enabling of specific channels. examples:
"Analog In", "SPDIF Out" etc
Returns:
If no input/output is present ASE_NotPresent will be returned.
Notes:
If possible, the string should be organised such that the first
characters are most significantly describing the nature of the
port, to allow for identification even if the view showing the
port name is too small to display more than 8 characters, for
instance.
*/
//- - - - - - - - - - - - - - - - - - - - - - - - -
// Buffer preparation
//- - - - - - - - - - - - - - - - - - - - - - - - -
typedef struct ASIOBufferInfo
{
ASIOBool isInput; // on input: ASIOTrue: input, else output
long channelNum; // on input: channel index
void *buffers[2]; // on output: double buffer addresses
} ASIOBufferInfo;
ASIOError ASIOCreateBuffers(ASIOBufferInfo *bufferInfos, long numChannels,
long bufferSize, ASIOCallbacks *callbacks);
/* Purpose:
Allocates input/output buffers for all input and output channels to be activated.
Parameter:
bufferInfos is a pointer to an array of ASIOBufferInfo structures:
- isInput: on input, ASIOTrue if the buffer is to be allocated
for an input, output buffer else
- channelNum: on input, the index of the channel in question
(counting from 0)
- buffers: on exit, 2 pointers to the halves of the channels' double-buffer.
the size of the buffer(s) of course depend on both the ASIOSampleType
as obtained from ASIOGetChannelInfo(), and bufferSize
numChannels is the sum of all input and output channels to be created;
thus bufferInfos is a pointer to an array of numChannels ASIOBufferInfo
structures.
bufferSize selects one of the possible buffer sizes as obtained from
ASIOGetBufferSizes().
callbacks is a pointer to an ASIOCallbacks structure.
Returns:
If not enough memory is available ASE_NoMemory will be returned.
If no input/output is present ASE_NotPresent will be returned.
If bufferSize is not supported, or one or more of the bufferInfos elements
contain invalid settings, ASE_InvalidMode will be returned.
Notes:
If individual channel selection is not possible but requested,
the driver has to handle this. namely, bufferSwitch() will only
have filled buffers of enabled outputs. If possible, processing
and buss activities overhead should be avoided for channels which
were not enabled here.
*/
ASIOError ASIODisposeBuffers(void);
/* Purpose:
Releases all buffers for the device.
Parameter:
None.
Returns:
If no buffer were ever prepared, ASE_InvalidMode will be returned.
If no input/output is present ASE_NotPresent will be returned.
Notes:
This implies ASIOStop().
*/
ASIOError ASIOControlPanel(void);
/* Purpose:
request the driver to start a control panel component
for device specific user settings. This will not be
accessed on some platforms (where the component is accessed
instead).
Parameter:
None.
Returns:
If no panel is available ASE_NotPresent will be returned.
Actually, the return code is ignored.
Notes:
if the user applied settings which require a re-configuration
of parts or all of the enigine and/or driver (such as a change of
the block size), the asioMessage callback can be used (see
ASIO_Callbacks).
*/
ASIOError ASIOFuture(long selector, void *params);
/* Purpose:
various
Parameter:
selector: operation Code as to be defined. zero is reserved for
testing purposes.
params: depends on the selector; usually pointer to a structure
for passing and retreiving any type and amount of parameters.
Returns:
the return value is also selector dependant. if the selector
is unknown, ASE_InvalidParameter should be returned to prevent
further calls with this selector. on success, ASE_SUCCESS
must be returned (note: ASE_OK is *not* sufficient!)
Notes:
see selectors defined below.
*/
enum
{
kAsioEnableTimeCodeRead = 1, // no arguments
kAsioDisableTimeCodeRead, // no arguments
kAsioSetInputMonitor, // ASIOInputMonitor* in params
kAsioTransport, // ASIOTransportParameters* in params
kAsioSetInputGain, // ASIOChannelControls* in params, apply gain
kAsioGetInputMeter, // ASIOChannelControls* in params, fill meter
kAsioSetOutputGain, // ASIOChannelControls* in params, apply gain
kAsioGetOutputMeter, // ASIOChannelControls* in params, fill meter
kAsioCanInputMonitor, // no arguments for kAsioCanXXX selectors
kAsioCanTimeInfo,
kAsioCanTimeCode,
kAsioCanTransport,
kAsioCanInputGain,
kAsioCanInputMeter,
kAsioCanOutputGain,
kAsioCanOutputMeter
};
typedef struct ASIOInputMonitor
{
long input; // this input was set to monitor (or off), -1: all
long output; // suggested output for monitoring the input (if so)
long gain; // suggested gain, ranging 0 - 0x7fffffffL (-inf to +12 dB)
ASIOBool state; // ASIOTrue => on, ASIOFalse => off
long pan; // suggested pan, 0 => all left, 0x7fffffff => right
} ASIOInputMonitor;
typedef struct ASIOChannelControls
{
long channel; // on input, channel index
ASIOBool isInput; // on input
long gain; // on input, ranges 0 thru 0x7fffffff
long meter; // on return, ranges 0 thru 0x7fffffff
char future[32];
} ASIOChannelControls;
typedef struct ASIOTransportParameters
{
long command; // see enum below
ASIOSamples samplePosition;
long track;
long trackSwitches[16]; // 512 tracks on/off
char future[64];
} ASIOTransportParameters;
enum
{
kTransStart = 1,
kTransStop,
kTransLocate, // to samplePosition
kTransPunchIn,
kTransPunchOut,
kTransArmOn, // track
kTransArmOff, // track
kTransMonitorOn, // track
kTransMonitorOff, // track
kTransArm, // trackSwitches
kTransMonitor // trackSwitches
};
ASIOError ASIOOutputReady(void);
/* Purpose:
this tells the driver that the host has completed processing
the output buffers. if the data format required by the hardware
differs from the supported asio formats, but the hardware
buffers are DMA buffers, the driver will have to convert
the audio stream data; as the bufferSwitch callback is
usually issued at dma block switch time, the driver will
have to convert the *previous* host buffer, which increases
the output latency by one block.
when the host finds out that ASIOOutputReady() returns
true, it will issue this call whenever it completed
output processing. then the driver can convert the
host data directly to the dma buffer to be played next,
reducing output latency by one block.
another way to look at it is, that the buffer switch is called
in order to pass the *input* stream to the host, so that it can
process the input into the output, and the output stream is passed
to the driver when the host has completed its process.
Parameter:
None
Returns:
only if the above mentioned scenario is given, and a reduction
of output latency can be acheived by this mechanism, should
ASE_OK be returned. otherwise (and usually), ASE_NotPresent
should be returned in order to prevent further calls to this
function. note that the host may want to determine if it is
to use this when the system is not yet fully initialized, so
ASE_OK should always be returned if the mechanism makes sense.
Notes:
please remeber to adjust ASIOGetLatencies() according to
whether ASIOOutputReady() was ever called or not, if your
driver supports this scenario.
also note that the engine may fail to call ASIO_OutputReady()
in time in overload cases. as already mentioned, bufferSwitch
should be called for every block regardless of whether a block
could be processed in time.
*/
// restore old alignment
#if defined(_MSC_VER) && !defined(__MWERKS__)
#pragma pack(pop)
#elif PRAGMA_ALIGN_SUPPORTED
#pragma options align = reset
#endif
#endif

View File

@@ -1,186 +0,0 @@
#include <string.h>
#include "asiodrivers.h"
AsioDrivers* asioDrivers = 0;
bool loadAsioDriver(char *name);
bool loadAsioDriver(char *name)
{
if(!asioDrivers)
asioDrivers = new AsioDrivers();
if(asioDrivers)
return asioDrivers->loadDriver(name);
return false;
}
//------------------------------------------------------------------------------------
#if MAC
bool resolveASIO(unsigned long aconnID);
AsioDrivers::AsioDrivers() : CodeFragments("ASIO Drivers", 'AsDr', 'Asio')
{
connID = -1;
curIndex = -1;
}
AsioDrivers::~AsioDrivers()
{
removeCurrentDriver();
}
bool AsioDrivers::getCurrentDriverName(char *name)
{
if(curIndex >= 0)
return getName(curIndex, name);
return false;
}
long AsioDrivers::getDriverNames(char **names, long maxDrivers)
{
for(long i = 0; i < getNumFragments() && i < maxDrivers; i++)
getName(i, names[i]);
return getNumFragments() < maxDrivers ? getNumFragments() : maxDrivers;
}
bool AsioDrivers::loadDriver(char *name)
{
char dname[64];
unsigned long newID;
for(long i = 0; i < getNumFragments(); i++)
{
if(getName(i, dname) && !strcmp(name, dname))
{
if(newInstance(i, &newID))
{
if(resolveASIO(newID))
{
if(connID != -1)
removeInstance(curIndex, connID);
curIndex = i;
connID = newID;
return true;
}
}
break;
}
}
return false;
}
void AsioDrivers::removeCurrentDriver()
{
if(connID != -1)
removeInstance(curIndex, connID);
connID = -1;
curIndex = -1;
}
//------------------------------------------------------------------------------------
#elif WINDOWS
#include "iasiodrv.h"
extern IASIO* theAsioDriver;
AsioDrivers::AsioDrivers() : AsioDriverList()
{
curIndex = -1;
}
AsioDrivers::~AsioDrivers()
{
}
bool AsioDrivers::getCurrentDriverName(char *name)
{
if(curIndex >= 0)
return asioGetDriverName(curIndex, name, 32) == 0 ? true : false;
name[0] = 0;
return false;
}
long AsioDrivers::getDriverNames(char **names, long maxDrivers)
{
for(long i = 0; i < asioGetNumDev() && i < maxDrivers; i++)
asioGetDriverName(i, names[i], 32);
return asioGetNumDev() < maxDrivers ? asioGetNumDev() : maxDrivers;
}
bool AsioDrivers::loadDriver(char *name)
{
char dname[64];
char curName[64];
for(long i = 0; i < asioGetNumDev(); i++)
{
if(!asioGetDriverName(i, dname, 32) && !strcmp(name, dname))
{
curName[0] = 0;
getCurrentDriverName(curName); // in case we fail...
removeCurrentDriver();
if(!asioOpenDriver(i, (void **)&theAsioDriver))
{
curIndex = i;
return true;
}
else
{
theAsioDriver = 0;
if(curName[0] && strcmp(dname, curName))
loadDriver(curName); // try restore
}
break;
}
}
return false;
}
void AsioDrivers::removeCurrentDriver()
{
if(curIndex != -1)
asioCloseDriver(curIndex);
curIndex = -1;
}
#elif SGI || BEOS
#include "asiolist.h"
AsioDrivers::AsioDrivers()
: AsioDriverList()
{
curIndex = -1;
}
AsioDrivers::~AsioDrivers()
{
}
bool AsioDrivers::getCurrentDriverName(char *name)
{
return false;
}
long AsioDrivers::getDriverNames(char **names, long maxDrivers)
{
return 0;
}
bool AsioDrivers::loadDriver(char *name)
{
return false;
}
void AsioDrivers::removeCurrentDriver()
{
}
#else
#error implement me
#endif

View File

@@ -1,41 +0,0 @@
#ifndef __AsioDrivers__
#define __AsioDrivers__
#include "ginclude.h"
#if MAC
#include "CodeFragments.hpp"
class AsioDrivers : public CodeFragments
#elif WINDOWS
#include <windows.h>
#include "asiolist.h"
class AsioDrivers : public AsioDriverList
#elif SGI || BEOS
#include "asiolist.h"
class AsioDrivers : public AsioDriverList
#else
#error implement me
#endif
{
public:
AsioDrivers();
~AsioDrivers();
bool getCurrentDriverName(char *name);
long getDriverNames(char **names, long maxDrivers);
bool loadDriver(char *name);
void removeCurrentDriver();
long getCurrentDriverIndex() {return curIndex;}
protected:
unsigned long connID;
long curIndex;
};
#endif

View File

@@ -1,76 +0,0 @@
/*
Steinberg Audio Stream I/O API
(c) 1996, Steinberg Soft- und Hardware GmbH
charlie (May 1996)
asiodrvr.h
c++ superclass to implement asio functionality. from this,
you can derive whatever required
*/
#ifndef _asiodrvr_
#define _asiodrvr_
// cpu and os system we are running on
#include "asiosys.h"
// basic "C" interface
#include "asio.h"
class AsioDriver;
extern AsioDriver *getDriver(); // for generic constructor
#if WINDOWS
#include <windows.h>
#include "combase.h"
#include "iasiodrv.h"
class AsioDriver : public IASIO ,public CUnknown
{
public:
AsioDriver(LPUNKNOWN pUnk, HRESULT *phr);
DECLARE_IUNKNOWN
// Factory method
static CUnknown *CreateInstance(LPUNKNOWN pUnk, HRESULT *phr);
// IUnknown
virtual HRESULT STDMETHODCALLTYPE NonDelegatingQueryInterface(REFIID riid,void **ppvObject);
#else
class AsioDriver
{
public:
AsioDriver();
#endif
virtual ~AsioDriver();
virtual ASIOBool init(void* sysRef);
virtual void getDriverName(char *name); // max 32 bytes incl. terminating zero
virtual long getDriverVersion();
virtual void getErrorMessage(char *string); // max 124 bytes incl.
virtual ASIOError start();
virtual ASIOError stop();
virtual ASIOError getChannels(long *numInputChannels, long *numOutputChannels);
virtual ASIOError getLatencies(long *inputLatency, long *outputLatency);
virtual ASIOError getBufferSize(long *minSize, long *maxSize,
long *preferredSize, long *granularity);
virtual ASIOError canSampleRate(ASIOSampleRate sampleRate);
virtual ASIOError getSampleRate(ASIOSampleRate *sampleRate);
virtual ASIOError setSampleRate(ASIOSampleRate sampleRate);
virtual ASIOError getClockSources(ASIOClockSource *clocks, long *numSources);
virtual ASIOError setClockSource(long reference);
virtual ASIOError getSamplePosition(ASIOSamples *sPos, ASIOTimeStamp *tStamp);
virtual ASIOError getChannelInfo(ASIOChannelInfo *info);
virtual ASIOError createBuffers(ASIOBufferInfo *bufferInfos, long numChannels,
long bufferSize, ASIOCallbacks *callbacks);
virtual ASIOError disposeBuffers();
virtual ASIOError controlPanel();
virtual ASIOError future(long selector, void *opt);
virtual ASIOError outputReady();
};
#endif

View File

@@ -1,268 +0,0 @@
#include <windows.h>
#include "iasiodrv.h"
#include "asiolist.h"
#define ASIODRV_DESC "description"
#define INPROC_SERVER "InprocServer32"
#define ASIO_PATH "software\\asio"
#define COM_CLSID "clsid"
// ******************************************************************
// Local Functions
// ******************************************************************
static LONG findDrvPath (char *clsidstr,char *dllpath,int dllpathsize)
{
HKEY hkEnum,hksub,hkpath;
char databuf[512];
LONG cr,rc = -1;
DWORD datatype,datasize;
DWORD index;
OFSTRUCT ofs;
HFILE hfile;
BOOL found = FALSE;
CharLowerBuff(clsidstr,strlen(clsidstr));
if ((cr = RegOpenKey(HKEY_CLASSES_ROOT,COM_CLSID,&hkEnum)) == ERROR_SUCCESS) {
index = 0;
while (cr == ERROR_SUCCESS && !found) {
cr = RegEnumKey(hkEnum,index++,(LPTSTR)databuf,512);
if (cr == ERROR_SUCCESS) {
CharLowerBuff(databuf,strlen(databuf));
if (!(strcmp(databuf,clsidstr))) {
if ((cr = RegOpenKeyEx(hkEnum,(LPCTSTR)databuf,0,KEY_READ,&hksub)) == ERROR_SUCCESS) {
if ((cr = RegOpenKeyEx(hksub,(LPCTSTR)INPROC_SERVER,0,KEY_READ,&hkpath)) == ERROR_SUCCESS) {
datatype = REG_SZ; datasize = (DWORD)dllpathsize;
cr = RegQueryValueEx(hkpath,0,0,&datatype,(LPBYTE)dllpath,&datasize);
if (cr == ERROR_SUCCESS) {
memset(&ofs,0,sizeof(OFSTRUCT));
ofs.cBytes = sizeof(OFSTRUCT);
hfile = OpenFile(dllpath,&ofs,OF_EXIST);
if (hfile) rc = 0;
}
RegCloseKey(hkpath);
}
RegCloseKey(hksub);
}
found = TRUE; // break out
}
}
}
RegCloseKey(hkEnum);
}
return rc;
}
static LPASIODRVSTRUCT newDrvStruct (HKEY hkey,char *keyname,int drvID,LPASIODRVSTRUCT lpdrv)
{
HKEY hksub;
char databuf[256];
char dllpath[MAXPATHLEN];
WORD wData[100];
CLSID clsid;
DWORD datatype,datasize;
LONG cr,rc;
if (!lpdrv) {
if ((cr = RegOpenKeyEx(hkey,(LPCTSTR)keyname,0,KEY_READ,&hksub)) == ERROR_SUCCESS) {
datatype = REG_SZ; datasize = 256;
cr = RegQueryValueEx(hksub,COM_CLSID,0,&datatype,(LPBYTE)databuf,&datasize);
if (cr == ERROR_SUCCESS) {
rc = findDrvPath (databuf,dllpath,MAXPATHLEN);
if (rc == 0) {
lpdrv = new ASIODRVSTRUCT[1];
if (lpdrv) {
memset(lpdrv,0,sizeof(ASIODRVSTRUCT));
lpdrv->drvID = drvID;
MultiByteToWideChar(CP_ACP,0,(LPCSTR)databuf,-1,(LPWSTR)wData,100);
if ((cr = CLSIDFromString((LPOLESTR)wData,(LPCLSID)&clsid)) == S_OK) {
memcpy(&lpdrv->clsid,&clsid,sizeof(CLSID));
}
datatype = REG_SZ; datasize = 256;
cr = RegQueryValueEx(hksub,ASIODRV_DESC,0,&datatype,(LPBYTE)databuf,&datasize);
if (cr == ERROR_SUCCESS) {
strcpy(lpdrv->drvname,databuf);
}
else strcpy(lpdrv->drvname,keyname);
}
}
}
RegCloseKey(hksub);
}
}
else lpdrv->next = newDrvStruct(hkey,keyname,drvID+1,lpdrv->next);
return lpdrv;
}
static void deleteDrvStruct (LPASIODRVSTRUCT lpdrv)
{
IASIO *iasio;
if (lpdrv != 0) {
deleteDrvStruct(lpdrv->next);
if (lpdrv->asiodrv) {
iasio = (IASIO *)lpdrv->asiodrv;
iasio->Release();
}
delete lpdrv;
}
}
static LPASIODRVSTRUCT getDrvStruct (int drvID,LPASIODRVSTRUCT lpdrv)
{
while (lpdrv) {
if (lpdrv->drvID == drvID) return lpdrv;
lpdrv = lpdrv->next;
}
return 0;
}
// ******************************************************************
// ******************************************************************
// AsioDriverList
// ******************************************************************
AsioDriverList::AsioDriverList ()
{
HKEY hkEnum = 0;
char keyname[MAXDRVNAMELEN];
LPASIODRVSTRUCT pdl;
LONG cr;
DWORD index = 0;
BOOL fin = FALSE;
numdrv = 0;
lpdrvlist = 0;
cr = RegOpenKey(HKEY_LOCAL_MACHINE,ASIO_PATH,&hkEnum);
while (cr == ERROR_SUCCESS) {
if ((cr = RegEnumKey(hkEnum,index++,(LPTSTR)keyname,MAXDRVNAMELEN))== ERROR_SUCCESS) {
lpdrvlist = newDrvStruct (hkEnum,keyname,0,lpdrvlist);
}
else fin = TRUE;
}
if (hkEnum) RegCloseKey(hkEnum);
pdl = lpdrvlist;
while (pdl) {
numdrv++;
pdl = pdl->next;
}
if (numdrv) CoInitialize(0); // initialize COM
}
AsioDriverList::~AsioDriverList ()
{
if (numdrv) {
deleteDrvStruct(lpdrvlist);
CoUninitialize();
}
}
LONG AsioDriverList::asioGetNumDev (VOID)
{
return (LONG)numdrv;
}
LONG AsioDriverList::asioOpenDriver (int drvID,LPVOID *asiodrv)
{
LPASIODRVSTRUCT lpdrv = 0;
long rc;
if (!asiodrv) return DRVERR_INVALID_PARAM;
if ((lpdrv = getDrvStruct(drvID,lpdrvlist)) != 0) {
if (!lpdrv->asiodrv) {
rc = CoCreateInstance(lpdrv->clsid,0,CLSCTX_INPROC_SERVER,lpdrv->clsid,asiodrv);
if (rc == S_OK) {
lpdrv->asiodrv = *asiodrv;
return 0;
}
// else if (rc == REGDB_E_CLASSNOTREG)
// strcpy (info->messageText, "Driver not registered in the Registration Database!");
}
else rc = DRVERR_DEVICE_ALREADY_OPEN;
}
else rc = DRVERR_DEVICE_NOT_FOUND;
return rc;
}
LONG AsioDriverList::asioCloseDriver (int drvID)
{
LPASIODRVSTRUCT lpdrv = 0;
IASIO *iasio;
if ((lpdrv = getDrvStruct(drvID,lpdrvlist)) != 0) {
if (lpdrv->asiodrv) {
iasio = (IASIO *)lpdrv->asiodrv;
iasio->Release();
lpdrv->asiodrv = 0;
}
}
return 0;
}
LONG AsioDriverList::asioGetDriverName (int drvID,char *drvname,int drvnamesize)
{
LPASIODRVSTRUCT lpdrv = 0;
if (!drvname) return DRVERR_INVALID_PARAM;
if ((lpdrv = getDrvStruct(drvID,lpdrvlist)) != 0) {
if (strlen(lpdrv->drvname) < (unsigned int)drvnamesize) {
strcpy(drvname,lpdrv->drvname);
}
else {
memcpy(drvname,lpdrv->drvname,drvnamesize-4);
drvname[drvnamesize-4] = '.';
drvname[drvnamesize-3] = '.';
drvname[drvnamesize-2] = '.';
drvname[drvnamesize-1] = 0;
}
return 0;
}
return DRVERR_DEVICE_NOT_FOUND;
}
LONG AsioDriverList::asioGetDriverPath (int drvID,char *dllpath,int dllpathsize)
{
LPASIODRVSTRUCT lpdrv = 0;
if (!dllpath) return DRVERR_INVALID_PARAM;
if ((lpdrv = getDrvStruct(drvID,lpdrvlist)) != 0) {
if (strlen(lpdrv->dllpath) < (unsigned int)dllpathsize) {
strcpy(dllpath,lpdrv->dllpath);
return 0;
}
dllpath[0] = 0;
return DRVERR_INVALID_PARAM;
}
return DRVERR_DEVICE_NOT_FOUND;
}
LONG AsioDriverList::asioGetDriverCLSID (int drvID,CLSID *clsid)
{
LPASIODRVSTRUCT lpdrv = 0;
if (!clsid) return DRVERR_INVALID_PARAM;
if ((lpdrv = getDrvStruct(drvID,lpdrvlist)) != 0) {
memcpy(clsid,&lpdrv->clsid,sizeof(CLSID));
return 0;
}
return DRVERR_DEVICE_NOT_FOUND;
}

View File

@@ -1,46 +0,0 @@
#ifndef __asiolist__
#define __asiolist__
#define DRVERR -5000
#define DRVERR_INVALID_PARAM DRVERR-1
#define DRVERR_DEVICE_ALREADY_OPEN DRVERR-2
#define DRVERR_DEVICE_NOT_FOUND DRVERR-3
#define MAXPATHLEN 512
#define MAXDRVNAMELEN 128
struct asiodrvstruct
{
int drvID;
CLSID clsid;
char dllpath[MAXPATHLEN];
char drvname[MAXDRVNAMELEN];
LPVOID asiodrv;
struct asiodrvstruct *next;
};
typedef struct asiodrvstruct ASIODRVSTRUCT;
typedef ASIODRVSTRUCT *LPASIODRVSTRUCT;
class AsioDriverList {
public:
AsioDriverList();
~AsioDriverList();
LONG asioOpenDriver (int,VOID **);
LONG asioCloseDriver (int);
// nice to have
LONG asioGetNumDev (VOID);
LONG asioGetDriverName (int,char *,int);
LONG asioGetDriverPath (int,char *,int);
LONG asioGetDriverCLSID (int,CLSID *);
// or use directly access
LPASIODRVSTRUCT lpdrvlist;
int numdrv;
};
typedef class AsioDriverList *LPASIODRIVERLIST;
#endif

View File

@@ -1,82 +0,0 @@
#ifndef __asiosys__
#define __asiosys__
#ifdef WIN32
#undef MAC
#define PPC 0
#define WINDOWS 1
#define SGI 0
#define SUN 0
#define LINUX 0
#define BEOS 0
#define NATIVE_INT64 0
#define IEEE754_64FLOAT 1
#elif BEOS
#define MAC 0
#define PPC 0
#define WINDOWS 0
#define PC 0
#define SGI 0
#define SUN 0
#define LINUX 0
#define NATIVE_INT64 0
#define IEEE754_64FLOAT 1
#ifndef DEBUG
#define DEBUG 0
#if DEBUG
void DEBUGGERMESSAGE(char *string);
#else
#define DEBUGGERMESSAGE(a)
#endif
#endif
#elif SGI
#define MAC 0
#define PPC 0
#define WINDOWS 0
#define PC 0
#define SUN 0
#define LINUX 0
#define BEOS 0
#define NATIVE_INT64 0
#define IEEE754_64FLOAT 1
#ifndef DEBUG
#define DEBUG 0
#if DEBUG
void DEBUGGERMESSAGE(char *string);
#else
#define DEBUGGERMESSAGE(a)
#endif
#endif
#else // MAC
#define MAC 1
#define PPC 1
#define WINDOWS 0
#define PC 0
#define SGI 0
#define SUN 0
#define LINUX 0
#define BEOS 0
#define NATIVE_INT64 0
#define IEEE754_64FLOAT 1
#ifndef DEBUG
#define DEBUG 0
#if DEBUG
void DEBUGGERMESSAGE(char *string);
#else
#define DEBUGGERMESSAGE(a)
#endif
#endif
#endif
#endif

View File

@@ -1,150 +0,0 @@
# Microsoft Developer Studio Project File - Name="call_inout" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=call_inout - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "call_inout.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "call_inout.mak" CFG="call_inout - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "call_inout - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "call_inout - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "call_inout - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir ""
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_DS__" /D "__WINDOWS_ASIO__" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib dsound.lib /nologo /subsystem:console /machine:I386
!ELSEIF "$(CFG)" == "call_inout - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir ""
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_DS__" /D "__WINDOWS_ASIO__" /D "__RTAUDIO_DEBUG__" /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 dsound.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
!ENDIF
# Begin Target
# Name "call_inout - Win32 Release"
# Name "call_inout - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=.\asio.cpp
# End Source File
# Begin Source File
SOURCE=.\asiodrivers.cpp
# End Source File
# Begin Source File
SOURCE=.\asiolist.cpp
# End Source File
# Begin Source File
SOURCE=..\call_inout.cpp
# End Source File
# Begin Source File
SOURCE=..\..\RtAudio.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=.\asio.h
# End Source File
# Begin Source File
SOURCE=.\asiodrivers.h
# End Source File
# Begin Source File
SOURCE=.\asiodrvr.h
# End Source File
# Begin Source File
SOURCE=.\asiolist.h
# End Source File
# Begin Source File
SOURCE=.\asiosys.h
# End Source File
# Begin Source File
SOURCE=.\ginclude.h
# End Source File
# Begin Source File
SOURCE=.\iasiodrv.h
# End Source File
# Begin Source File
SOURCE=..\..\RtAudio.h
# End Source File
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# End Target
# End Project

View File

@@ -1,110 +0,0 @@
# Microsoft Developer Studio Project File - Name="call_playtwo" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=call_playtwo - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "call_playtwo.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "call_playtwo.mak" CFG="call_playtwo - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "call_playtwo - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "call_playtwo - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "call_playtwo - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir ""
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_DS__" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib dsound.lib /nologo /subsystem:console /machine:I386
!ELSEIF "$(CFG)" == "call_playtwo - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir ""
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_DS__" /D "__RTAUDIO_DEBUG__" /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 dsound.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
!ENDIF
# Begin Target
# Name "call_playtwo - Win32 Release"
# Name "call_playtwo - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=..\call_playtwo.cpp
# End Source File
# Begin Source File
SOURCE=..\..\RtAudio.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=..\..\RtAudio.h
# End Source File
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# End Target
# End Project

View File

@@ -1,150 +0,0 @@
# Microsoft Developer Studio Project File - Name="call_saw" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=call_saw - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "call_saw.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "call_saw.mak" CFG="call_saw - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "call_saw - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "call_saw - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "call_saw - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir ""
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_DS__" /D "__WINDOWS_ASIO__" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib dsound.lib /nologo /subsystem:console /machine:I386
!ELSEIF "$(CFG)" == "call_saw - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir ""
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_DS__" /D "__WINDOWS_ASIO__" /D "__RTAUDIO_DEBUG__" /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 dsound.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
!ENDIF
# Begin Target
# Name "call_saw - Win32 Release"
# Name "call_saw - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=.\asio.cpp
# End Source File
# Begin Source File
SOURCE=.\asiodrivers.cpp
# End Source File
# Begin Source File
SOURCE=.\asiolist.cpp
# End Source File
# Begin Source File
SOURCE=..\call_saw.cpp
# End Source File
# Begin Source File
SOURCE=..\..\RtAudio.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=.\asio.h
# End Source File
# Begin Source File
SOURCE=.\asiodrivers.h
# End Source File
# Begin Source File
SOURCE=.\asiodrvr.h
# End Source File
# Begin Source File
SOURCE=.\asiolist.h
# End Source File
# Begin Source File
SOURCE=.\asiosys.h
# End Source File
# Begin Source File
SOURCE=.\ginclude.h
# End Source File
# Begin Source File
SOURCE=.\iasiodrv.h
# End Source File
# Begin Source File
SOURCE=..\..\RtAudio.h
# End Source File
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# End Target
# End Project

View File

@@ -1,110 +0,0 @@
# Microsoft Developer Studio Project File - Name="call_twostreams" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=call_twostreams - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "call_twostreams.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "call_twostreams.mak" CFG="call_twostreams - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "call_twostreams - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "call_twostreams - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "call_twostreams - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir ""
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_DS__" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib dsound.lib /nologo /subsystem:console /machine:I386
!ELSEIF "$(CFG)" == "call_twostreams - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir ""
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_DS__" /D "__RTAUDIO_DEBUG__" /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 dsound.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
!ENDIF
# Begin Target
# Name "call_twostreams - Win32 Release"
# Name "call_twostreams - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=..\call_twostreams.cpp
# End Source File
# Begin Source File
SOURCE=..\..\RtAudio.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=..\..\RtAudio.h
# End Source File
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# End Target
# End Project

View File

@@ -1,38 +0,0 @@
#ifndef __gInclude__
#define __gInclude__
#if SGI
#undef BEOS
#undef MAC
#undef WINDOWS
//
#define ASIO_BIG_ENDIAN 1
#define ASIO_CPU_MIPS 1
#elif defined WIN32
#undef BEOS
#undef MAC
#undef SGI
#define WINDOWS 1
#define ASIO_LITTLE_ENDIAN 1
#define ASIO_CPU_X86 1
#elif BEOS
#undef MAC
#undef SGI
#undef WINDOWS
#define ASIO_LITTLE_ENDIAN 1
#define ASIO_CPU_X86 1
//
#else
#define MAC 1
#undef BEOS
#undef WINDOWS
#undef SGI
#define ASIO_BIG_ENDIAN 1
#define ASIO_CPU_PPC 1
#endif
// always
#define NATIVE_INT64 0
#define IEEE754_64FLOAT 1
#endif // __gInclude__

View File

@@ -1,37 +0,0 @@
#include "asiosys.h"
#include "asio.h"
/* Forward Declarations */
#ifndef __ASIODRIVER_FWD_DEFINED__
#define __ASIODRIVER_FWD_DEFINED__
typedef interface IASIO IASIO;
#endif /* __ASIODRIVER_FWD_DEFINED__ */
interface IASIO : public IUnknown
{
virtual ASIOBool init(void *sysHandle) = 0;
virtual void getDriverName(char *name) = 0;
virtual long getDriverVersion() = 0;
virtual void getErrorMessage(char *string) = 0;
virtual ASIOError start() = 0;
virtual ASIOError stop() = 0;
virtual ASIOError getChannels(long *numInputChannels, long *numOutputChannels) = 0;
virtual ASIOError getLatencies(long *inputLatency, long *outputLatency) = 0;
virtual ASIOError getBufferSize(long *minSize, long *maxSize,
long *preferredSize, long *granularity) = 0;
virtual ASIOError canSampleRate(ASIOSampleRate sampleRate) = 0;
virtual ASIOError getSampleRate(ASIOSampleRate *sampleRate) = 0;
virtual ASIOError setSampleRate(ASIOSampleRate sampleRate) = 0;
virtual ASIOError getClockSources(ASIOClockSource *clocks, long *numSources) = 0;
virtual ASIOError setClockSource(long reference) = 0;
virtual ASIOError getSamplePosition(ASIOSamples *sPos, ASIOTimeStamp *tStamp) = 0;
virtual ASIOError getChannelInfo(ASIOChannelInfo *info) = 0;
virtual ASIOError createBuffers(ASIOBufferInfo *bufferInfos, long numChannels,
long bufferSize, ASIOCallbacks *callbacks) = 0;
virtual ASIOError disposeBuffers() = 0;
virtual ASIOError controlPanel() = 0;
virtual ASIOError future(long selector,void *opt) = 0;
virtual ASIOError outputReady() = 0;
};

View File

@@ -1,150 +0,0 @@
# Microsoft Developer Studio Project File - Name="in_out" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=in_out - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "in_out.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "in_out.mak" CFG="in_out - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "in_out - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "in_out - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "in_out - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir ""
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_DS__" /D "__WINDOWS_ASIO__" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib dsound.lib /nologo /subsystem:console /machine:I386
!ELSEIF "$(CFG)" == "in_out - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir ""
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_DS__" /D "__WINDOWS_ASIO__" /D "__RTAUDIO_DEBUG__" /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 dsound.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
!ENDIF
# Begin Target
# Name "in_out - Win32 Release"
# Name "in_out - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=.\asio.cpp
# End Source File
# Begin Source File
SOURCE=.\asiodrivers.cpp
# End Source File
# Begin Source File
SOURCE=.\asiolist.cpp
# End Source File
# Begin Source File
SOURCE=..\in_out.cpp
# End Source File
# Begin Source File
SOURCE=..\..\RtAudio.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=.\asio.h
# End Source File
# Begin Source File
SOURCE=.\asiodrivers.h
# End Source File
# Begin Source File
SOURCE=.\asiodrvr.h
# End Source File
# Begin Source File
SOURCE=.\asiolist.h
# End Source File
# Begin Source File
SOURCE=.\asiosys.h
# End Source File
# Begin Source File
SOURCE=.\ginclude.h
# End Source File
# Begin Source File
SOURCE=.\iasiodrv.h
# End Source File
# Begin Source File
SOURCE=..\..\RtAudio.h
# End Source File
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# End Target
# End Project

View File

@@ -1,150 +0,0 @@
# Microsoft Developer Studio Project File - Name="info" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=info - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "info.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "info.mak" CFG="info - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "info - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "info - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "info - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir ""
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_DS__" /D "__WINDOWS_ASIO__" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib dsound.lib /nologo /subsystem:console /machine:I386
!ELSEIF "$(CFG)" == "info - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir ""
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_DS__" /D "__WINDOWS_ASIO__" /D "__RTAUDIO_DEBUG__" /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 dsound.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
!ENDIF
# Begin Target
# Name "info - Win32 Release"
# Name "info - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=.\asio.cpp
# End Source File
# Begin Source File
SOURCE=.\asiodrivers.cpp
# End Source File
# Begin Source File
SOURCE=.\asiolist.cpp
# End Source File
# Begin Source File
SOURCE=..\info.cpp
# End Source File
# Begin Source File
SOURCE=..\..\RtAudio.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=.\asio.h
# End Source File
# Begin Source File
SOURCE=.\asiodrivers.h
# End Source File
# Begin Source File
SOURCE=.\asiodrvr.h
# End Source File
# Begin Source File
SOURCE=.\asiolist.h
# End Source File
# Begin Source File
SOURCE=.\asiosys.h
# End Source File
# Begin Source File
SOURCE=.\ginclude.h
# End Source File
# Begin Source File
SOURCE=.\iasiodrv.h
# End Source File
# Begin Source File
SOURCE=..\..\RtAudio.h
# End Source File
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# End Target
# End Project

View File

@@ -1,150 +0,0 @@
# Microsoft Developer Studio Project File - Name="play_raw" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=play_raw - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "play_raw.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "play_raw.mak" CFG="play_raw - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "play_raw - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "play_raw - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "play_raw - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir ""
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_DS__" /D "__WINDOWS_ASIO__" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib dsound.lib /nologo /subsystem:console /machine:I386
!ELSEIF "$(CFG)" == "play_raw - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir ""
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_DS__" /D "__WINDOWS_ASIO__" /D "__RTAUDIO_DEBUG__" /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 dsound.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
!ENDIF
# Begin Target
# Name "play_raw - Win32 Release"
# Name "play_raw - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=.\asio.cpp
# End Source File
# Begin Source File
SOURCE=.\asiodrivers.cpp
# End Source File
# Begin Source File
SOURCE=.\asiolist.cpp
# End Source File
# Begin Source File
SOURCE=..\play_raw.cpp
# End Source File
# Begin Source File
SOURCE=..\..\RtAudio.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=.\asio.h
# End Source File
# Begin Source File
SOURCE=.\asiodrivers.h
# End Source File
# Begin Source File
SOURCE=.\asiodrvr.h
# End Source File
# Begin Source File
SOURCE=.\asiolist.h
# End Source File
# Begin Source File
SOURCE=.\asiosys.h
# End Source File
# Begin Source File
SOURCE=.\ginclude.h
# End Source File
# Begin Source File
SOURCE=.\iasiodrv.h
# End Source File
# Begin Source File
SOURCE=..\..\RtAudio.h
# End Source File
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# End Target
# End Project

View File

@@ -1,150 +0,0 @@
# Microsoft Developer Studio Project File - Name="play_saw" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=play_saw - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "play_saw.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "play_saw.mak" CFG="play_saw - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "play_saw - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "play_saw - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "play_saw - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir ""
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_DS__" /D "__WINDOWS_ASIO__" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib dsound.lib /nologo /subsystem:console /machine:I386
!ELSEIF "$(CFG)" == "play_saw - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir ""
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_DS__" /D "__WINDOWS_ASIO__" /D "__RTAUDIO_DEBUG__" /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 dsound.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
!ENDIF
# Begin Target
# Name "play_saw - Win32 Release"
# Name "play_saw - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=.\asio.cpp
# End Source File
# Begin Source File
SOURCE=.\asiodrivers.cpp
# End Source File
# Begin Source File
SOURCE=.\asiolist.cpp
# End Source File
# Begin Source File
SOURCE=..\play_saw.cpp
# End Source File
# Begin Source File
SOURCE=..\..\RtAudio.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=.\asio.h
# End Source File
# Begin Source File
SOURCE=.\asiodrivers.h
# End Source File
# Begin Source File
SOURCE=.\asiodrvr.h
# End Source File
# Begin Source File
SOURCE=.\asiolist.h
# End Source File
# Begin Source File
SOURCE=.\asiosys.h
# End Source File
# Begin Source File
SOURCE=.\ginclude.h
# End Source File
# Begin Source File
SOURCE=.\iasiodrv.h
# End Source File
# Begin Source File
SOURCE=..\..\RtAudio.h
# End Source File
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# End Target
# End Project

View File

@@ -1,150 +0,0 @@
# Microsoft Developer Studio Project File - Name="record_raw" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=record_raw - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "record_raw.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "record_raw.mak" CFG="record_raw - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "record_raw - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "record_raw - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "record_raw - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir ""
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_DS__" /D "__WINDOWS_ASIO__" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib dsound.lib /nologo /subsystem:console /machine:I386
!ELSEIF "$(CFG)" == "record_raw - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir ""
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_DS__" /D "__WINDOWS_ASIO__" /D "__RTAUDIO_DEBUG__" /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 dsound.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
!ENDIF
# Begin Target
# Name "record_raw - Win32 Release"
# Name "record_raw - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=.\asio.cpp
# End Source File
# Begin Source File
SOURCE=.\asiodrivers.cpp
# End Source File
# Begin Source File
SOURCE=.\asiolist.cpp
# End Source File
# Begin Source File
SOURCE=..\record_raw.cpp
# End Source File
# Begin Source File
SOURCE=..\..\RtAudio.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=.\asio.h
# End Source File
# Begin Source File
SOURCE=.\asiodrivers.h
# End Source File
# Begin Source File
SOURCE=.\asiodrvr.h
# End Source File
# Begin Source File
SOURCE=.\asiolist.h
# End Source File
# Begin Source File
SOURCE=.\asiosys.h
# End Source File
# Begin Source File
SOURCE=.\ginclude.h
# End Source File
# Begin Source File
SOURCE=.\iasiodrv.h
# End Source File
# Begin Source File
SOURCE=..\..\RtAudio.h
# End Source File
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# End Target
# End Project

View File

@@ -1,113 +0,0 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "call_inout"=".\call_inout.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "call_saw"=".\call_saw.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "in_out"=".\in_out.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "info"=".\info.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "play_raw"=".\play_raw.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "play_saw"=".\play_saw.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "record_raw"=".\record_raw.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "twostreams"=".\twostreams.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################

View File

@@ -1,150 +0,0 @@
# Microsoft Developer Studio Project File - Name="twostreams" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=twostreams - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "twostreams.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "twostreams.mak" CFG="twostreams - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "twostreams - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "twostreams - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "twostreams - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir ""
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_DS__" /D "__WINDOWS_ASIO__" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib dsound.lib /nologo /subsystem:console /machine:I386
!ELSEIF "$(CFG)" == "twostreams - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir ""
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_DS__" /D "__WINDOWS_ASIO__" /D "__RTAUDIO_DEBUG__" /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 dsound.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
!ENDIF
# Begin Target
# Name "twostreams - Win32 Release"
# Name "twostreams - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=.\asio.cpp
# End Source File
# Begin Source File
SOURCE=.\asiodrivers.cpp
# End Source File
# Begin Source File
SOURCE=.\asiolist.cpp
# End Source File
# Begin Source File
SOURCE=..\..\RtAudio.cpp
# End Source File
# Begin Source File
SOURCE=..\twostreams.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=.\asio.h
# End Source File
# Begin Source File
SOURCE=.\asiodrivers.h
# End Source File
# Begin Source File
SOURCE=.\asiodrvr.h
# End Source File
# Begin Source File
SOURCE=.\asiolist.h
# End Source File
# Begin Source File
SOURCE=.\asiosys.h
# End Source File
# Begin Source File
SOURCE=.\ginclude.h
# End Source File
# Begin Source File
SOURCE=.\iasiodrv.h
# End Source File
# Begin Source File
SOURCE=..\..\RtAudio.h
# End Source File
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# End Target
# End Project

View File

@@ -1,102 +0,0 @@
/******************************************/
/*
call_inout.cpp
by Gary P. Scavone, 2001
Records from default input and passes it
through to the output. Takes number of
channels and sample rate as input arguments.
Uses callback functionality.
*/
/******************************************/
#include "RtAudio.h"
#include <iostream>
/*
typedef signed long MY_TYPE;
#define FORMAT RTAUDIO_SINT24
typedef char MY_TYPE;
#define FORMAT RTAUDIO_SINT8
typedef signed short MY_TYPE;
#define FORMAT RTAUDIO_SINT16
typedef signed long MY_TYPE;
#define FORMAT RTAUDIO_SINT32
typedef float MY_TYPE;
#define FORMAT RTAUDIO_FLOAT32
*/
typedef double MY_TYPE;
#define FORMAT RTAUDIO_FLOAT64
void usage(void) {
/* Error function in case of incorrect command-line
argument specifications
*/
std::cout << "\nuseage: call_inout N fs device\n";
std::cout << " where N = number of channels,\n";
std::cout << " fs = the sample rate,\n";
std::cout << " and device = the device to use (default = 0).\n\n";
exit(0);
}
int inout(char *buffer, int buffer_size, void *)
{
// Surprise!! We do nothing to pass the data through.
return 0;
}
int main(int argc, char *argv[])
{
int chans, fs, device = 0;
RtAudio *audio;
char input;
// minimal command-line checking
if (argc != 3 && argc != 4 ) usage();
chans = (int) atoi(argv[1]);
fs = (int) atoi(argv[2]);
if ( argc == 4 )
device = (int) atoi(argv[3]);
// Open the realtime output device
int buffer_size = 512;
try {
audio = new RtAudio(device, chans, device, chans,
FORMAT, fs, &buffer_size, 8);
}
catch (RtError &error) {
error.printMessage();
exit(EXIT_FAILURE);
}
try {
audio->setStreamCallback(&inout, NULL);
audio->startStream();
}
catch (RtError &error) {
error.printMessage();
goto cleanup;
}
std::cout << "\nRunning ... press <enter> to quit (buffer size = " << buffer_size << ").\n";
std::cin.get(input);
try {
audio->stopStream();
}
catch (RtError &error) {
error.printMessage();
}
cleanup:
audio->closeStream();
delete audio;
return 0;
}

View File

@@ -1,130 +0,0 @@
/******************************************/
/*
call_saw.c
by Gary P. Scavone, 2001
Play sawtooth waveforms of distinct frequency.
Takes number of channels and sample rate as
input arguments. Use callback functionality.
*/
/******************************************/
#include "RtAudio.h"
#include <iostream>
/*
typedef signed long MY_TYPE;
#define FORMAT RTAUDIO_SINT24
#define SCALE 2147483647.0
typedef char MY_TYPE;
#define FORMAT RTAUDIO_SINT8
#define SCALE 127.0
typedef signed short MY_TYPE;
#define FORMAT RTAUDIO_SINT16
#define SCALE 32767.0
typedef signed long MY_TYPE;
#define FORMAT RTAUDIO_SINT32
#define SCALE 2147483647.0
*/
typedef float MY_TYPE;
#define FORMAT RTAUDIO_FLOAT32
#define SCALE 1.0
/*
typedef double MY_TYPE;
#define FORMAT RTAUDIO_FLOAT64
#define SCALE 1.0
*/
#define BASE_RATE 0.005
#define TIME 1.0
void usage(void) {
/* Error function in case of incorrect command-line
argument specifications
*/
std::cout << "\nuseage: call_saw N fs <device>\n";
std::cout << " where N = number of channels,\n";
std::cout << " fs = the sample rate,\n";
std::cout << " and device = the device to use (default = 0).\n\n";
exit(0);
}
int chans;
int saw(char *buffer, int buffer_size, void *data)
{
int i, j;
extern int chans;
MY_TYPE *my_buffer = (MY_TYPE *) buffer;
double *my_data = (double *) data;
for (i=0; i<buffer_size; i++) {
for (j=0; j<chans; j++) {
*my_buffer++ = (MY_TYPE) (my_data[j] * SCALE);
my_data[j] += BASE_RATE * (j+1+(j*0.1));
if (my_data[j] >= 1.0) my_data[j] -= 2.0;
}
}
return 0;
}
int main(int argc, char *argv[])
{
int buffer_size, fs, device = 0;
RtAudio *audio;
double *data;
char input;
// minimal command-line checking
if (argc != 3 && argc != 4 ) usage();
chans = (int) atoi(argv[1]);
fs = (int) atoi(argv[2]);
if ( argc == 4 )
device = (int) atoi(argv[3]);
// Open the realtime output device
buffer_size = 1024;
try {
audio = new RtAudio(device, chans, 0, 0,
FORMAT, fs, &buffer_size, 4);
}
catch (RtError &error) {
error.printMessage();
exit(EXIT_FAILURE);
}
data = (double *) calloc(chans, sizeof(double));
try {
audio->setStreamCallback(&saw, (void *)data);
audio->startStream();
}
catch (RtError &error) {
error.printMessage();
goto cleanup;
}
std::cout << "\nPlaying ... press <enter> to quit (buffer size = " << buffer_size << ").\n";
std::cin.get(input);
// Stop the stream.
try {
audio->stopStream();
}
catch (RtError &error) {
error.printMessage();
}
cleanup:
audio->closeStream();
delete audio;
if (data) free(data);
return 0;
}

View File

@@ -1,111 +0,0 @@
/******************************************/
/*
in_out.c
by Gary P. Scavone, 2001
Records from default input and passes it
through to the output. Takes number of
channels and sample rate as input arguments.
Use blocking functionality.
*/
/******************************************/
#include "RtAudio.h"
#include <iostream>
/*
typedef signed long MY_TYPE;
#define FORMAT RTAUDIO_SINT24
typedef char MY_TYPE;
#define FORMAT RTAUDIO_SINT8
typedef signed short MY_TYPE;
#define FORMAT RTAUDIO_SINT16
typedef signed long MY_TYPE;
#define FORMAT RTAUDIO_SINT32
typedef float MY_TYPE;
#define FORMAT RTAUDIO_FLOAT32
*/
typedef double MY_TYPE;
#define FORMAT RTAUDIO_FLOAT64
#define TIME 4.0
void usage(void) {
/* Error function in case of incorrect command-line
argument specifications
*/
std::cout << "\nuseage: in_out N fs <device>\n";
std::cout << " where N = number of channels,\n";
std::cout << " fs = the sample rate,\n";
std::cout << " and device = the device to use (default = 0).\n\n";
exit(0);
}
int main(int argc, char *argv[])
{
int chans, fs, buffer_size, device = 0;
long frames, counter = 0;
MY_TYPE *buffer;
RtAudio *audio;
// minimal command-line checking
if (argc != 3 && argc != 4 ) usage();
chans = (int) atoi(argv[1]);
fs = (int) atoi(argv[2]);
if ( argc == 4 )
device = (int) atoi(argv[3]);
// Open the realtime output device
buffer_size = 512;
try {
audio = new RtAudio(device, chans, device, chans,
FORMAT, fs, &buffer_size, 8);
}
catch (RtError &error) {
error.printMessage();
exit(EXIT_FAILURE);
}
frames = (long) (fs * TIME);
try {
buffer = (MY_TYPE *) audio->getStreamBuffer();
audio->startStream();
}
catch (RtError &error) {
error.printMessage();
goto cleanup;
}
std::cout << "\nRunning for " << TIME << " seconds ... fragment_size = " << buffer_size << std::endl;
while (counter < frames) {
try {
audio->tickStream();
}
catch (RtError &error) {
error.printMessage();
goto cleanup;
}
counter += buffer_size;
}
try {
audio->stopStream();
}
catch (RtError &error) {
error.printMessage();
}
cleanup:
audio->closeStream();
delete audio;
return 0;
}

View File

@@ -1,78 +0,0 @@
/******************************************/
/*
info.cpp
by Gary P. Scavone, 2001
Prints audio system/device info.
*/
/******************************************/
#include "RtAudio.h"
#include <iostream>
int main(int argc, char *argv[])
{
RtAudio *audio;
RtAudioDeviceInfo info;
try {
audio = new RtAudio();
}
catch (RtError &error) {
error.printMessage();
exit(EXIT_FAILURE);
}
int devices = audio->getDeviceCount();
std::cout << "\nFound " << devices << " device(s) ...\n";
for (int i=1; i<=devices; i++) {
try {
info = audio->getDeviceInfo(i);
}
catch (RtError &error) {
error.printMessage();
break;
}
std::cout << "\nDevice Name = " << info.name << '\n';
if (info.probed == false)
std::cout << "Probe Status = UNsuccessful\n";
else {
std::cout << "Probe Status = Successful\n";
std::cout << "Output Channels = " << info.outputChannels << '\n';
std::cout << "Input Channels = " << info.inputChannels << '\n';
std::cout << "Duplex Channels = " << info.duplexChannels << '\n';
if (info.isDefault) std::cout << "This is the default device.\n";
else std::cout << "This is NOT the default device.\n";
if ( info.nativeFormats == 0 )
std::cout << "No natively supported data formats(?)!";
else {
std::cout << "Natively supported data formats:\n";
if ( info.nativeFormats & RTAUDIO_SINT8 )
std::cout << " 8-bit int\n";
if ( info.nativeFormats & RTAUDIO_SINT16 )
std::cout << " 16-bit int\n";
if ( info.nativeFormats & RTAUDIO_SINT24 )
std::cout << " 24-bit int\n";
if ( info.nativeFormats & RTAUDIO_SINT32 )
std::cout << " 32-bit int\n";
if ( info.nativeFormats & RTAUDIO_FLOAT32 )
std::cout << " 32-bit float\n";
if ( info.nativeFormats & RTAUDIO_FLOAT64 )
std::cout << " 64-bit float\n";
}
if ( info.sampleRates.size() < 1 )
std::cout << "No supported sample rates found!";
else {
std::cout << "Supported sample rates = ";
for (unsigned int j=0; j<info.sampleRates.size(); j++)
std::cout << info.sampleRates[j] << " ";
}
std::cout << std::endl;
}
}
std::cout << std::endl;
delete audio;
return 0;
}

View File

@@ -1,132 +0,0 @@
/******************************************/
/*
play_raw.c
by Gary P. Scavone, 2001
Play a raw file. It is necessary that the
file be of the same format as defined below.
Uses blocking functionality.
*/
/******************************************/
#include "RtAudio.h"
#include <iostream>
#include <stdio.h>
/*
typedef char MY_TYPE;
#define FORMAT RTAUDIO_SINT8
#define SCALE 127.0
typedef signed short MY_TYPE;
#define FORMAT RTAUDIO_SINT16
#define SCALE 32767.0
typedef signed long MY_TYPE;
#define FORMAT RTAUDIO_SINT24
#define SCALE 8388607.0
typedef signed long MY_TYPE;
#define FORMAT RTAUDIO_SINT32
#define SCALE 2147483647.0
*/
typedef float MY_TYPE;
#define FORMAT RTAUDIO_FLOAT32
#define SCALE 1.0;
/*
typedef double MY_TYPE;
#define FORMAT RTAUDIO_FLOAT64
#define SCALE 1.0;
*/
void usage(void) {
/* Error function in case of incorrect command-line
argument specifications
*/
std::cout << "\nuseage: play_raw N fs file <device>\n";
std::cout << " where N = number of channels,\n";
std::cout << " fs = the sample rate, \n";
std::cout << " file = the raw file to play,\n";
std::cout << " and device = the device to use (default = 0).\n\n";
exit(0);
}
int main(int argc, char *argv[])
{
int chans, fs, buffer_size, count, device = 0;
long counter = 0;
MY_TYPE *buffer;
char *file;
FILE *fd;
RtAudio *audio;
// minimal command-line checking
if (argc != 4 && argc != 5 ) usage();
chans = (int) atoi(argv[1]);
fs = (int) atoi(argv[2]);
file = argv[3];
if ( argc == 5 )
device = (int) atoi(argv[4]);
fd = fopen(file,"rb");
if (!fd) {
std::cout << "can't find file!\n";
exit(0);
}
// Open the realtime output device
buffer_size = 512;
try {
audio = new RtAudio(device, chans, 0, 0,
FORMAT, fs, &buffer_size, 2);
}
catch (RtError &error) {
fclose(fd);
error.printMessage();
exit(EXIT_FAILURE);
}
try {
buffer = (MY_TYPE *) audio->getStreamBuffer();
audio->startStream();
}
catch (RtError &error) {
error.printMessage();
goto cleanup;
}
while (1) {
count = fread(buffer, chans * sizeof(MY_TYPE), buffer_size, fd);
if (count == buffer_size) {
try {
audio->tickStream();
}
catch (RtError &error) {
error.printMessage();
goto cleanup;
}
}
else
break;
counter += buffer_size;
}
try {
audio->stopStream();
}
catch (RtError &error) {
error.printMessage();
}
cleanup:
audio->closeStream();
delete audio;
fclose(fd);
return 0;
}

View File

@@ -1,129 +0,0 @@
/******************************************/
/*
play_saw.c
by Gary P. Scavone, 2001
Play sawtooth waveforms of distinct frequency.
Takes number of channels and sample rate as
input arguments. Uses blocking functionality.
*/
/******************************************/
#include "RtAudio.h"
#include <iostream>
/*
typedef signed long MY_TYPE;
#define FORMAT RTAUDIO_SINT24
#define SCALE 2147483647.0
typedef char MY_TYPE;
#define FORMAT RTAUDIO_SINT8
#define SCALE 127.0
*/
typedef signed short MY_TYPE;
#define FORMAT RTAUDIO_SINT16
#define SCALE 32767.0
/*
typedef signed long MY_TYPE;
#define FORMAT RTAUDIO_SINT32
#define SCALE 2147483647.0
typedef float MY_TYPE;
#define FORMAT RTAUDIO_FLOAT32
#define SCALE 1.0
typedef double MY_TYPE;
#define FORMAT RTAUDIO_FLOAT64
#define SCALE 1.0
*/
#define BASE_RATE 0.005
#define TIME 4.0
void usage(void) {
// Error function in case of incorrect command-line
// argument specifications.
std::cout << "\nuseage: play_saw N fs <device>\n";
std::cout << " where N = number of channels,\n";
std::cout << " fs = the sample rate,\n";
std::cout << " and device = the device to use (default = 0).\n\n";
exit(0);
}
int main(int argc, char *argv[])
{
int chans, fs, buffer_size, device = 0;
long frames, counter = 0, i, j;
MY_TYPE *buffer;
RtAudio *audio;
double *data = 0;
// minimal command-line checking
if (argc != 3 && argc != 4 ) usage();
chans = (int) atoi(argv[1]);
fs = (int) atoi(argv[2]);
if ( argc == 4 )
device = (int) atoi(argv[3]);
// Open the realtime output device
buffer_size = 512;
try {
audio = new RtAudio(device, chans, 0, 0,
FORMAT, fs, &buffer_size, 4);
}
catch (RtError &error) {
error.printMessage();
exit(EXIT_FAILURE);
}
frames = (long) (fs * TIME);
data = (double *) calloc(chans, sizeof(double));
try {
buffer = (MY_TYPE *) audio->getStreamBuffer();
audio->startStream();
}
catch (RtError &error) {
error.printMessage();
goto cleanup;
}
std::cout << "\nPlaying for " << TIME << " seconds ... buffer size = " << buffer_size << "." << std::endl;
while (counter < frames) {
for (i=0; i<buffer_size; i++) {
for (j=0; j<chans; j++) {
buffer[i*chans+j] = (MY_TYPE) (data[j] * SCALE);
data[j] += BASE_RATE * (j+1+(j*0.1));
if (data[j] >= 1.0) data[j] -= 2.0;
}
}
try {
audio->tickStream();
}
catch (RtError &error) {
error.printMessage();
goto cleanup;
}
counter += buffer_size;
}
try {
audio->stopStream();
}
catch (RtError &error) {
error.printMessage();
}
cleanup:
audio->closeStream();
delete audio;
if (data) free(data);
return 0;
}

View File

@@ -1,118 +0,0 @@
/******************************************/
/*
record_raw.c
by Gary P. Scavone, 2001
Records from default input. Takes
number of channels and sample rate
as input arguments. Uses blocking calls.
*/
/******************************************/
#include "RtAudio.h"
#include <iostream>
#include <stdio.h>
/*
typedef char MY_TYPE;
#define FORMAT RTAUDIO_SINT8
typedef signed short MY_TYPE;
#define FORMAT RTAUDIO_SINT16
typedef signed long MY_TYPE;
#define FORMAT RTAUDIO_SINT24
typedef signed long MY_TYPE;
#define FORMAT RTAUDIO_SINT32
*/
typedef float MY_TYPE;
#define FORMAT RTAUDIO_FLOAT32
/*
typedef double MY_TYPE;
#define FORMAT RTAUDIO_FLOAT64
*/
#define TIME 2.0
void usage(void) {
/* Error function in case of incorrect command-line
argument specifications
*/
std::cout << "\nuseage: record_raw N fs <device>\n";
std::cout << " where N = number of channels,\n";
std::cout << " fs = the sample rate,\n";
std::cout << " and device = the device to use (default = 0).\n\n";
exit(0);
}
int main(int argc, char *argv[])
{
int chans, fs, buffer_size, device = 0;
long frames, counter = 0;
MY_TYPE *buffer;
FILE *fd;
RtAudio *audio;
// minimal command-line checking
if (argc != 3 && argc != 4 ) usage();
chans = (int) atoi(argv[1]);
fs = (int) atoi(argv[2]);
if ( argc == 4 )
device = (int) atoi(argv[3]);
// Open the realtime output device
buffer_size = 512;
try {
audio = new RtAudio(0, 0, device, chans,
FORMAT, fs, &buffer_size, 8);
}
catch (RtError &error) {
error.printMessage();
exit(EXIT_FAILURE);
}
fd = fopen("test.raw","wb");
frames = (long) (fs * TIME);
try {
buffer = (MY_TYPE *) audio->getStreamBuffer();
audio->startStream();
}
catch (RtError &error) {
error.printMessage();
goto cleanup;
}
std::cout << "\nRecording for " << TIME << " seconds ... writing file test.raw (buffer size = " << buffer_size << ")." << std::endl;
while (counter < frames) {
try {
audio->tickStream();
}
catch (RtError &error) {
error.printMessage();
goto cleanup;
}
fwrite(buffer, sizeof(MY_TYPE), chans * buffer_size, fd);
counter += buffer_size;
}
try {
audio->stopStream();
}
catch (RtError &error) {
error.printMessage();
}
cleanup:
audio->closeStream();
delete audio;
fclose(fd);
return 0;
}

View File

@@ -1,221 +0,0 @@
/******************************************/
/*
twostreams.cpp
by Gary P. Scavone, 2001
Test executable for audio playback, recording,
duplex operation, stopping, starting, and
aborting operations. Takes number of channels
and sample rate as input arguments. Runs input
and output through two separate instances of RtAudio.
Uses blocking functionality.
*/
/******************************************/
#include "RtAudio.h"
#include <iostream>
/*
typedef signed long MY_TYPE;
#define FORMAT RTAUDIO_SINT24
#define SCALE 2147483647.0
typedef char MY_TYPE;
#define FORMAT RTAUDIO_SINT8
#define SCALE 127.0
typedef signed short MY_TYPE;
#define FORMAT RTAUDIO_SINT16
#define SCALE 32767.0
typedef signed long MY_TYPE;
#define FORMAT RTAUDIO_SINT32
#define SCALE 2147483647.0
*/
typedef float MY_TYPE;
#define FORMAT RTAUDIO_FLOAT32
#define SCALE 1.0
/*
typedef double MY_TYPE;
#define FORMAT RTAUDIO_FLOAT64
#define SCALE 1.0
*/
#define BASE_RATE 0.005
#define TIME 2.0
void usage(void) {
/* Error function in case of incorrect command-line
argument specifications
*/
std::cout << "\nuseage: twostreams N fs <device>\n";
std::cout << " where N = number of channels,\n";
std::cout << " fs = the sample rate,\n";
std::cout << " and device = the device to use (default = 0).\n\n";
exit(0);
}
int main(int argc, char *argv[])
{
int chans, fs, buffer_size, device = 0;
long frames, counter = 0, i, j;
MY_TYPE *buffer1, *buffer2;
RtAudio *stream1, *stream2;
FILE *fd;
double *data = 0;
// minimal command-line checking
if (argc != 3 && argc != 4 ) usage();
chans = (int) atoi(argv[1]);
fs = (int) atoi(argv[2]);
if ( argc == 4 )
device = (int) atoi(argv[3]);
// Open the realtime output device
buffer_size = 512;
try {
stream1 = new RtAudio(device, chans, 0, 0,
FORMAT, fs, &buffer_size, 8);
}
catch (RtError &error) {
error.printMessage();
exit(EXIT_FAILURE);
}
try {
stream2 = new RtAudio(0, 0, device, chans,
FORMAT, fs, &buffer_size, 8);
}
catch (RtError &error) {
delete stream1;
error.printMessage();
exit(EXIT_FAILURE);
}
try {
buffer1 = (MY_TYPE *) stream1->getStreamBuffer();
buffer2 = (MY_TYPE *) stream2->getStreamBuffer();
}
catch (RtError &error) {
error.printMessage();
goto cleanup;
}
frames = (long) (fs * TIME);
data = (double *) calloc(chans, sizeof(double));
try {
stream1->startStream();
}
catch (RtError &error) {
error.printMessage();
goto cleanup;
}
std::cout << "\nStarting sawtooth playback stream for " << TIME << " seconds." << std::endl;
while (counter < frames) {
for (i=0; i<buffer_size; i++) {
for (j=0; j<chans; j++) {
buffer1[i*chans+j] = (MY_TYPE) (data[j] * SCALE);
data[j] += BASE_RATE * (j+1+(j*0.1));
if (data[j] >= 1.0) data[j] -= 2.0;
}
}
try {
stream1->tickStream();
}
catch (RtError &error) {
error.printMessage();
goto cleanup;
}
counter += buffer_size;
}
std::cout << "\nStopping playback stream." << std::endl;
try {
stream1->stopStream();
}
catch (RtError &error) {
error.printMessage();
goto cleanup;
}
fd = fopen("test.raw","wb");
try {
stream2->startStream();
}
catch (RtError &error) {
error.printMessage();
goto cleanup;
}
counter = 0;
std::cout << "\nStarting recording stream for " << TIME << " seconds." << std::endl;
while (counter < frames) {
try {
stream2->tickStream();
}
catch (RtError &error) {
error.printMessage();
goto cleanup;
}
fwrite(buffer2, sizeof(MY_TYPE), chans * buffer_size, fd);
counter += buffer_size;
}
fclose(fd);
std::cout << "\nAborting recording." << std::endl;
try {
stream2->abortStream();
stream1->startStream();
stream2->startStream();
}
catch (RtError &error) {
error.printMessage();
goto cleanup;
}
counter = 0;
std::cout << "\nStarting playback and record streams (quasi-duplex) for " << TIME << " seconds." << std::endl;
while (counter < frames) {
try {
stream2->tickStream();
memcpy(buffer1, buffer2, sizeof(MY_TYPE) * chans * buffer_size);
stream1->tickStream();
}
catch (RtError &error) {
error.printMessage();
goto cleanup;
}
counter += buffer_size;
}
std::cout << "\nStopping both streams." << std::endl;
try {
stream1->stopStream();
stream2->stopStream();
}
catch (RtError &error) {
error.printMessage();
}
cleanup:
stream1->closeStream();
stream2->closeStream();
delete stream1;
delete stream2;
if (data) free(data);
return 0;
}