summaryrefslogtreecommitdiff
path: root/doc/latex
diff options
context:
space:
mode:
Diffstat (limited to 'doc/latex')
-rw-r--r--doc/latex/Makefile31
-rw-r--r--doc/latex/RtAudio_8h.tex29
-rw-r--r--doc/latex/annotated.tex6
-rw-r--r--doc/latex/classRtAudio.tex254
-rw-r--r--doc/latex/classRtAudioError.tex135
-rw-r--r--doc/latex/doxygen.sty65
-rw-r--r--doc/latex/files.tex4
-rw-r--r--doc/latex/index.tex595
-rw-r--r--doc/latex/refman.tex42
-rw-r--r--doc/latex/structRtAudio_1_1RTAUDIO__DEVICE.tex106
-rw-r--r--doc/latex/tutorial_8txt.tex2
11 files changed, 1269 insertions, 0 deletions
diff --git a/doc/latex/Makefile b/doc/latex/Makefile
new file mode 100644
index 0000000..f0e40cb
--- /dev/null
+++ b/doc/latex/Makefile
@@ -0,0 +1,31 @@
+all: refman.dvi
+
+ps: refman.ps
+
+pdf: refman.pdf
+
+ps_2on1: refman_2on1.ps
+
+pdf_2on1: refman_2on1.pdf
+
+refman.ps: refman.dvi
+ dvips -o refman.ps refman.dvi
+
+refman.pdf: refman.ps
+ ps2pdf refman.ps refman.pdf
+
+refman_2on1.ps: refman.ps
+ psnup -2 refman.ps >refman_2on1.ps
+
+refman_2on1.pdf: refman_2on1.ps
+ ps2pdf refman_2on1.ps refman_2on1.pdf
+
+refman.dvi: refman.tex doxygen.sty
+ echo "Running latex..."
+ latex refman.tex
+ echo "Running makeindex..."
+ makeindex refman.idx
+ echo "Rerunning latex...."
+ latex refman.tex
+clean:
+ rm -f *.ps *.dvi *.aux *.toc *.idx *.ind *.ilg *.log *.out
diff --git a/doc/latex/RtAudio_8h.tex b/doc/latex/RtAudio_8h.tex
new file mode 100644
index 0000000..2fb23e1
--- /dev/null
+++ b/doc/latex/RtAudio_8h.tex
@@ -0,0 +1,29 @@
+\section{Rt\-Audio.h File Reference}
+\label{RtAudio_8h}\index{RtAudio.h@{Rt\-Audio.h}}
+{\tt \#include $<$map$>$}\par
+\subsection*{Compounds}
+\begin{CompactItemize}
+\item
+class {\bf Rt\-Audio\-Error}
+\item
+class {\bf Rt\-Audio}
+\item
+struct {\bf Rt\-Audio::RTAUDIO\_\-DEVICE}
+\item
+struct {\bf Rt\-Audio::RTAUDIO\_\-STREAM}
+\end{CompactItemize}
+\subsection*{Defines}
+\begin{CompactItemize}
+\item
+\#define {\bf \_\-\_\-Rt\-Audio\_\-h}
+\end{CompactItemize}
+
+
+\subsection{Define Documentation}
+\index{RtAudio.h@{Rt\-Audio.h}!__RtAudio_h@{\_\-\_\-RtAudio\_\-h}}
+\index{__RtAudio_h@{\_\-\_\-RtAudio\_\-h}!RtAudio.h@{Rt\-Audio.h}}
+\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define \_\-\_\-Rt\-Audio\_\-h}\label{RtAudio_8h_a0}
+
+
+{\bf Value:}\footnotesize\begin{verbatim}
+\end{verbatim}\normalsize
diff --git a/doc/latex/annotated.tex b/doc/latex/annotated.tex
new file mode 100644
index 0000000..1682a4f
--- /dev/null
+++ b/doc/latex/annotated.tex
@@ -0,0 +1,6 @@
+\section{Rt\-Audio Compound List}
+Here are the classes, structs, unions and interfaces with brief descriptions:\begin{CompactList}
+\item\contentsline{section}{{\bf Rt\-Audio} }{\pageref{classRtAudio}}{}
+\item\contentsline{section}{{\bf Rt\-Audio::RTAUDIO\_\-DEVICE} }{\pageref{structRtAudio_1_1RTAUDIO__DEVICE}}{}
+\item\contentsline{section}{{\bf Rt\-Audio\-Error} }{\pageref{classRtAudioError}}{}
+\end{CompactList}
diff --git a/doc/latex/classRtAudio.tex b/doc/latex/classRtAudio.tex
new file mode 100644
index 0000000..af914e0
--- /dev/null
+++ b/doc/latex/classRtAudio.tex
@@ -0,0 +1,254 @@
+\section{Rt\-Audio Class Reference}
+\label{classRtAudio}\index{RtAudio@{Rt\-Audio}}
+{\tt \#include $<$Rt\-Audio.h$>$}
+
+\subsection*{Public Types}
+\begin{CompactItemize}
+\item
+typedef unsigned long {\bf RTAUDIO\_\-FORMAT}
+\item
+typedef int ($\ast$ {\bf RTAUDIO\_\-CALLBACK} )(char $\ast$buffer, int buffer\-Size, void $\ast$user\-Data)
+\item
+enum \{ {\bf MAX\_\-SAMPLE\_\-RATES} = 14
+ \}
+\end{CompactItemize}
+\subsection*{Public Methods}
+\begin{CompactItemize}
+\item
+{\bf Rt\-Audio} ()
+\begin{CompactList}\small\item\em The default constructor.\item\end{CompactList}\item
+{\bf Rt\-Audio} (int $\ast$stream\-ID, int output\-Device, int output\-Channels, int input\-Device, int input\-Channels, {\bf RTAUDIO\_\-FORMAT} format, int sample\-Rate, int $\ast$buffer\-Size, int number\-Of\-Buffers)
+\begin{CompactList}\small\item\em A constructor which can be used to open a stream during instantiation.\item\end{CompactList}\item
+{\bf $\sim$Rt\-Audio} ()
+\begin{CompactList}\small\item\em The destructor.\item\end{CompactList}\item
+int {\bf open\-Stream} (int output\-Device, int output\-Channels, int input\-Device, int input\-Channels, {\bf RTAUDIO\_\-FORMAT} format, int sample\-Rate, int $\ast$buffer\-Size, int number\-Of\-Buffers)
+\begin{CompactList}\small\item\em A public method for opening a stream with the specified parameters.\item\end{CompactList}\item
+void {\bf set\-Stream\-Callback} (int stream\-ID, {\bf RTAUDIO\_\-CALLBACK} callback, void $\ast$user\-Data)
+\begin{CompactList}\small\item\em A public method which sets a user-defined callback function for a given stream.\item\end{CompactList}\item
+void {\bf cancel\-Stream\-Callback} (int stream\-ID)
+\begin{CompactList}\small\item\em A public method which cancels a callback process and function for a given stream.\item\end{CompactList}\item
+int {\bf get\-Device\-Count} (void)
+\begin{CompactList}\small\item\em A public method which returns the number of audio devices found.\item\end{CompactList}\item
+void {\bf get\-Device\-Info} (int device, {\bf RTAUDIO\_\-DEVICE} $\ast$info)
+\begin{CompactList}\small\item\em Fill a user-supplied {\bf RTAUDIO\_\-DEVICE} {\rm (p.\,\pageref{structRtAudio_1_1RTAUDIO__DEVICE})} structure for a specified device.\item\end{CompactList}\item
+char$\ast$ const {\bf get\-Stream\-Buffer} (int stream\-ID)
+\begin{CompactList}\small\item\em A public method which returns a pointer to the buffer for an open stream.\item\end{CompactList}\item
+void {\bf tick\-Stream} (int stream\-ID)
+\begin{CompactList}\small\item\em Public method used to trigger processing of input/output data for a stream.\item\end{CompactList}\item
+void {\bf close\-Stream} (int stream\-ID)
+\begin{CompactList}\small\item\em Public method which closes a stream and frees any associated buffers.\item\end{CompactList}\item
+void {\bf start\-Stream} (int stream\-ID)
+\begin{CompactList}\small\item\em Public method which starts a stream.\item\end{CompactList}\item
+void {\bf stop\-Stream} (int stream\-ID)
+\begin{CompactList}\small\item\em Stop a stream, allowing any samples remaining in the queue to be played out and/or read in.\item\end{CompactList}\item
+void {\bf abort\-Stream} (int stream\-ID)
+\begin{CompactList}\small\item\em Stop a stream, discarding any samples remaining in the input/output queue.\item\end{CompactList}\item
+int {\bf stream\-Will\-Block} (int stream\-ID)
+\begin{CompactList}\small\item\em Queries a stream to determine whether a call to the {\bf tick\-Stream}() {\rm (p.\,\pageref{classRtAudio_a9})} method will block.\item\end{CompactList}\end{CompactItemize}
+\subsection*{Static Public Attributes}
+\begin{CompactItemize}
+\item
+const {\bf RTAUDIO\_\-FORMAT} {\bf RTAUDIO\_\-SINT8}
+\item
+const {\bf RTAUDIO\_\-FORMAT} {\bf RTAUDIO\_\-SINT16}
+\item
+const {\bf RTAUDIO\_\-FORMAT} {\bf RTAUDIO\_\-SINT24}
+\item
+const {\bf RTAUDIO\_\-FORMAT} {\bf RTAUDIO\_\-SINT32}
+\item
+const {\bf RTAUDIO\_\-FORMAT} {\bf RTAUDIO\_\-FLOAT32}
+\item
+const {\bf RTAUDIO\_\-FORMAT} {\bf RTAUDIO\_\-FLOAT64}
+\end{CompactItemize}
+
+
+\subsection{Member Typedef Documentation}
+\index{RtAudio@{Rt\-Audio}!RTAUDIO_FORMAT@{RTAUDIO\_\-FORMAT}}
+\index{RTAUDIO_FORMAT@{RTAUDIO\_\-FORMAT}!RtAudio@{Rt\-Audio}}
+\subsubsection{\setlength{\rightskip}{0pt plus 5cm}typedef unsigned long Rt\-Audio::RTAUDIO\_\-FORMAT}\label{classRtAudio_s0}
+
+
+\index{RtAudio@{Rt\-Audio}!RTAUDIO_CALLBACK@{RTAUDIO\_\-CALLBACK}}
+\index{RTAUDIO_CALLBACK@{RTAUDIO\_\-CALLBACK}!RtAudio@{Rt\-Audio}}
+\subsubsection{\setlength{\rightskip}{0pt plus 5cm}typedef int($\ast$ Rt\-Audio::RTAUDIO\_\-CALLBACK)(char $\ast$buffer, int buffer\-Size, void $\ast$user\-Data)}\label{classRtAudio_s1}
+
+
+
+
+\subsection{Member Enumeration Documentation}
+\subsubsection{\setlength{\rightskip}{0pt plus 5cm}anonymous enum}\label{classRtAudio_s3}
+
+
+\begin{Desc}
+\item[{\bf Enumeration values:}]\par
+\begin{description}
+\index{MAX_SAMPLE_RATES@{MAX\_\-SAMPLE\_\-RATES}!RtAudio@{Rt\-Audio}}\index{RtAudio@{RtAudio}!MAX_SAMPLE_RATES@{MAX\_\-SAMPLE\_\-RATES}}\item[
+{\em MAX\_\-SAMPLE\_\-RATES}\label{classRtAudio_s3s2}
+]\end{description}
+\end{Desc}
+
+
+
+\subsection{Constructor \& Destructor Documentation}
+\index{RtAudio@{Rt\-Audio}!RtAudio@{RtAudio}}
+\index{RtAudio@{RtAudio}!RtAudio@{Rt\-Audio}}
+\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Rt\-Audio::Rt\-Audio ()}\label{classRtAudio_a0}
+
+
+The default 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 {\bf Rt\-Audio\-Error} {\rm (p.\,\pageref{classRtAudioError})} error can be thrown if no devices are found or if a memory allocation error occurs. \index{RtAudio@{Rt\-Audio}!RtAudio@{RtAudio}}
+\index{RtAudio@{RtAudio}!RtAudio@{Rt\-Audio}}
+\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Rt\-Audio::Rt\-Audio (int $\ast$ {\em stream\-ID}, int {\em output\-Device}, int {\em output\-Channels}, int {\em input\-Device}, int {\em input\-Channels}, {\bf RTAUDIO\_\-FORMAT} {\em format}, int {\em sample\-Rate}, int $\ast$ {\em buffer\-Size}, int {\em number\-Of\-Buffers})}\label{classRtAudio_a1}
+
+
+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 {\bf get\-Device\-Info}() {\rm (p.\,\pageref{classRtAudio_a7})} 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 \char`\"{}stream\-ID\char`\"{} pointer. An {\bf Rt\-Audio\-Error} {\rm (p.\,\pageref{classRtAudioError})} can be thrown if no devices are found for the given parameters, if a memory allocation error occurs, or if a driver error occurs. \begin{Desc}
+\item[{\bf See also: }]\par
+{\bf open\-Stream}() {\rm (p.\,\pageref{classRtAudio_a3})} \end{Desc}
+\index{RtAudio@{Rt\-Audio}!~RtAudio@{$\sim$RtAudio}}
+\index{~RtAudio@{$\sim$RtAudio}!RtAudio@{Rt\-Audio}}
+\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Rt\-Audio::$\sim$Rt\-Audio ()}\label{classRtAudio_a2}
+
+
+The destructor.
+
+Stops and closes any open streams and devices and deallocates buffer and structure memory.
+
+\subsection{Member Function Documentation}
+\index{RtAudio@{Rt\-Audio}!openStream@{openStream}}
+\index{openStream@{openStream}!RtAudio@{Rt\-Audio}}
+\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int Rt\-Audio::open\-Stream (int {\em output\-Device}, int {\em output\-Channels}, int {\em input\-Device}, int {\em input\-Channels}, {\bf RTAUDIO\_\-FORMAT} {\em format}, int {\em sample\-Rate}, int $\ast$ {\em buffer\-Size}, int {\em number\-Of\-Buffers})}\label{classRtAudio_a3}
+
+
+A public method for opening a stream with the specified parameters.
+
+If successful, the opened stream ID is returned. Otherwise, an {\bf Rt\-Audio\-Error} {\rm (p.\,\pageref{classRtAudioError})} is thrown.\begin{Desc}
+\item[{\bf Parameters: }]\par
+\begin{description}
+\item[
+{\em output\-Device:}]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 {\bf get\-Device\-Info}() {\rm (p.\,\pageref{classRtAudio_a7})} method. \item[
+{\em output\-Channels:}]The desired number of output channels. If equal to zero, the output\-Device identifier is ignored. \item[
+{\em input\-Device:}]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 {\bf get\-Device\-Info}() {\rm (p.\,\pageref{classRtAudio_a7})} method. \item[
+{\em input\-Channels:}]The desired number of input channels. If equal to zero, the input\-Device identifier is ignored. \item[
+{\em format:}]An RTAUDIO\_\-FORMAT specifying the desired sample data format. \item[
+{\em sample\-Rate:}]The desired sample rate (sample frames per second). \item[
+{\em buffer\-Size:}]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. \item[
+{\em number\-Of\-Buffers:}]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. \end{description}
+\end{Desc}
+\index{RtAudio@{Rt\-Audio}!setStreamCallback@{setStreamCallback}}
+\index{setStreamCallback@{setStreamCallback}!RtAudio@{Rt\-Audio}}
+\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Rt\-Audio::set\-Stream\-Callback (int {\em stream\-ID}, {\bf RTAUDIO\_\-CALLBACK} {\em callback}, void $\ast$ {\em user\-Data})}\label{classRtAudio_a4}
+
+
+A public method which sets a user-defined callback function for a given stream.
+
+This method assigns a callback function to a specific, previously opened stream for non-blocking stream functionality. A separate process is initiated, though the user function is called only when the stream is \char`\"{}running\char`\"{} (between calls to the {\bf start\-Stream}() {\rm (p.\,\pageref{classRtAudio_a11})} and {\bf stop\-Stream}() {\rm (p.\,\pageref{classRtAudio_a12})} methods, respectively). The callback process remains active for the duration of the stream and is automatically shutdown when the stream is closed (via the {\bf close\-Stream}() {\rm (p.\,\pageref{classRtAudio_a10})} method or by object destruction). The callback process can also be shutdown and the user function de-referenced through an explicit call to the {\bf cancel\-Stream\-Callback}() {\rm (p.\,\pageref{classRtAudio_a5})} method. Note that a single stream can use only blocking or callback functionality at the same time, though it is possible to alternate modes on the same stream through the use of the {\bf set\-Stream\-Callback}() {\rm (p.\,\pageref{classRtAudio_a4})} and {\bf cancel\-Stream\-Callback}() {\rm (p.\,\pageref{classRtAudio_a5})} methods (the blocking {\bf tick\-Stream}() {\rm (p.\,\pageref{classRtAudio_a9})} method can be used before a callback is set and/or after a callback is cancelled). An {\bf Rt\-Audio\-Error} {\rm (p.\,\pageref{classRtAudioError})} will be thrown for an invalid device argument. \index{RtAudio@{Rt\-Audio}!cancelStreamCallback@{cancelStreamCallback}}
+\index{cancelStreamCallback@{cancelStreamCallback}!RtAudio@{Rt\-Audio}}
+\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Rt\-Audio::cancel\-Stream\-Callback (int {\em stream\-ID})}\label{classRtAudio_a5}
+
+
+A public method which cancels a callback process and function for a given stream.
+
+This method shuts down a callback process and de-references the user function for a specific stream. Callback functionality can subsequently be restarted on the stream via the {\bf set\-Stream\-Callback}() {\rm (p.\,\pageref{classRtAudio_a4})} method. An {\bf Rt\-Audio\-Error} {\rm (p.\,\pageref{classRtAudioError})} will be thrown for an invalid device argument. \index{RtAudio@{Rt\-Audio}!getDeviceCount@{getDeviceCount}}
+\index{getDeviceCount@{getDeviceCount}!RtAudio@{Rt\-Audio}}
+\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int Rt\-Audio::get\-Device\-Count (void)}\label{classRtAudio_a6}
+
+
+A public method which returns the number of audio devices found.
+
+\index{RtAudio@{Rt\-Audio}!getDeviceInfo@{getDeviceInfo}}
+\index{getDeviceInfo@{getDeviceInfo}!RtAudio@{Rt\-Audio}}
+\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Rt\-Audio::get\-Device\-Info (int {\em device}, {\bf RTAUDIO\_\-DEVICE} $\ast$ {\em info})}\label{classRtAudio_a7}
+
+
+Fill a user-supplied {\bf RTAUDIO\_\-DEVICE} {\rm (p.\,\pageref{structRtAudio_1_1RTAUDIO__DEVICE})} structure for a specified device.
+
+Any device between 0 and {\bf get\-Device\-Count}() {\rm (p.\,\pageref{classRtAudio_a6})}-1 is valid. If a device is busy or otherwise unavailable, the structure member \char`\"{}probed\char`\"{} has a value of \char`\"{}false\char`\"{}. The system default input and output devices are referenced by device identifier = 0. On systems which allow dynamic default device settings, the default devices are not identified by name (specific device enumerations are assigned device identifiers $>$ 0). An {\bf Rt\-Audio\-Error} {\rm (p.\,\pageref{classRtAudioError})} will be thrown for an invalid device argument. \index{RtAudio@{Rt\-Audio}!getStreamBuffer@{getStreamBuffer}}
+\index{getStreamBuffer@{getStreamBuffer}!RtAudio@{Rt\-Audio}}
+\subsubsection{\setlength{\rightskip}{0pt plus 5cm}char $\ast$const Rt\-Audio::get\-Stream\-Buffer (int {\em stream\-ID})}\label{classRtAudio_a8}
+
+
+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 {\bf tick\-Stream}() {\rm (p.\,\pageref{classRtAudio_a9})} method. An {\bf Rt\-Audio\-Error} {\rm (p.\,\pageref{classRtAudioError})} will be thrown for an invalid stream identifier. \index{RtAudio@{Rt\-Audio}!tickStream@{tickStream}}
+\index{tickStream@{tickStream}!RtAudio@{Rt\-Audio}}
+\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Rt\-Audio::tick\-Stream (int {\em stream\-ID})}\label{classRtAudio_a9}
+
+
+Public method used to trigger processing of input/output data for a stream.
+
+This method blocks until all buffer data is read/written. An {\bf Rt\-Audio\-Error} {\rm (p.\,\pageref{classRtAudioError})} will be thrown for an invalid stream identifier or if a driver error occurs. \index{RtAudio@{Rt\-Audio}!closeStream@{closeStream}}
+\index{closeStream@{closeStream}!RtAudio@{Rt\-Audio}}
+\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Rt\-Audio::close\-Stream (int {\em stream\-ID})}\label{classRtAudio_a10}
+
+
+Public method which closes a stream and frees any associated buffers.
+
+If an invalid stream identifier is specified, this method issues a warning and returns (an {\bf Rt\-Audio\-Error} {\rm (p.\,\pageref{classRtAudioError})} is not thrown). \index{RtAudio@{Rt\-Audio}!startStream@{startStream}}
+\index{startStream@{startStream}!RtAudio@{Rt\-Audio}}
+\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Rt\-Audio::start\-Stream (int {\em stream\-ID})}\label{classRtAudio_a11}
+
+
+Public method which starts a stream.
+
+An {\bf Rt\-Audio\-Error} {\rm (p.\,\pageref{classRtAudioError})} will be thrown for an invalid stream identifier or if a driver error occurs. \index{RtAudio@{Rt\-Audio}!stopStream@{stopStream}}
+\index{stopStream@{stopStream}!RtAudio@{Rt\-Audio}}
+\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Rt\-Audio::stop\-Stream (int {\em stream\-ID})}\label{classRtAudio_a12}
+
+
+Stop a stream, allowing any samples remaining in the queue to be played out and/or read in.
+
+An {\bf Rt\-Audio\-Error} {\rm (p.\,\pageref{classRtAudioError})} will be thrown for an invalid stream identifier or if a driver error occurs. \index{RtAudio@{Rt\-Audio}!abortStream@{abortStream}}
+\index{abortStream@{abortStream}!RtAudio@{Rt\-Audio}}
+\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Rt\-Audio::abort\-Stream (int {\em stream\-ID})}\label{classRtAudio_a13}
+
+
+Stop a stream, discarding any samples remaining in the input/output queue.
+
+An {\bf Rt\-Audio\-Error} {\rm (p.\,\pageref{classRtAudioError})} will be thrown for an invalid stream identifier or if a driver error occurs. \index{RtAudio@{Rt\-Audio}!streamWillBlock@{streamWillBlock}}
+\index{streamWillBlock@{streamWillBlock}!RtAudio@{Rt\-Audio}}
+\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int Rt\-Audio::stream\-Will\-Block (int {\em stream\-ID})}\label{classRtAudio_a14}
+
+
+Queries a stream to determine whether a call to the {\bf tick\-Stream}() {\rm (p.\,\pageref{classRtAudio_a9})} method will block.
+
+A return value of 0 indicates that the stream will NOT block. A positive return value indicates the number of sample frames that cannot yet be processed without blocking.
+
+\subsection{Member Data Documentation}
+\index{RtAudio@{Rt\-Audio}!RTAUDIO_SINT8@{RTAUDIO\_\-SINT8}}
+\index{RTAUDIO_SINT8@{RTAUDIO\_\-SINT8}!RtAudio@{Rt\-Audio}}
+\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const {\bf RTAUDIO\_\-FORMAT} Rt\-Audio::RTAUDIO\_\-SINT8\hspace{0.3cm}{\tt [static]}}\label{classRtAudio_p0}
+
+
+\index{RtAudio@{Rt\-Audio}!RTAUDIO_SINT16@{RTAUDIO\_\-SINT16}}
+\index{RTAUDIO_SINT16@{RTAUDIO\_\-SINT16}!RtAudio@{Rt\-Audio}}
+\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const {\bf RTAUDIO\_\-FORMAT} Rt\-Audio::RTAUDIO\_\-SINT16\hspace{0.3cm}{\tt [static]}}\label{classRtAudio_p1}
+
+
+\index{RtAudio@{Rt\-Audio}!RTAUDIO_SINT24@{RTAUDIO\_\-SINT24}}
+\index{RTAUDIO_SINT24@{RTAUDIO\_\-SINT24}!RtAudio@{Rt\-Audio}}
+\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const {\bf RTAUDIO\_\-FORMAT} Rt\-Audio::RTAUDIO\_\-SINT24\hspace{0.3cm}{\tt [static]}}\label{classRtAudio_p2}
+
+
+Upper 3 bytes of 32-bit integer. \index{RtAudio@{Rt\-Audio}!RTAUDIO_SINT32@{RTAUDIO\_\-SINT32}}
+\index{RTAUDIO_SINT32@{RTAUDIO\_\-SINT32}!RtAudio@{Rt\-Audio}}
+\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const {\bf RTAUDIO\_\-FORMAT} Rt\-Audio::RTAUDIO\_\-SINT32\hspace{0.3cm}{\tt [static]}}\label{classRtAudio_p3}
+
+
+\index{RtAudio@{Rt\-Audio}!RTAUDIO_FLOAT32@{RTAUDIO\_\-FLOAT32}}
+\index{RTAUDIO_FLOAT32@{RTAUDIO\_\-FLOAT32}!RtAudio@{Rt\-Audio}}
+\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const {\bf RTAUDIO\_\-FORMAT} Rt\-Audio::RTAUDIO\_\-FLOAT32\hspace{0.3cm}{\tt [static]}}\label{classRtAudio_p4}
+
+
+Normalized between plus/minus 1.0. \index{RtAudio@{Rt\-Audio}!RTAUDIO_FLOAT64@{RTAUDIO\_\-FLOAT64}}
+\index{RTAUDIO_FLOAT64@{RTAUDIO\_\-FLOAT64}!RtAudio@{Rt\-Audio}}
+\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const {\bf RTAUDIO\_\-FORMAT} Rt\-Audio::RTAUDIO\_\-FLOAT64\hspace{0.3cm}{\tt [static]}}\label{classRtAudio_p5}
+
+
+Normalized between plus/minus 1.0.
+
+The documentation for this class was generated from the following file:\begin{CompactItemize}
+\item
+{\bf Rt\-Audio.h}\end{CompactItemize}
diff --git a/doc/latex/classRtAudioError.tex b/doc/latex/classRtAudioError.tex
new file mode 100644
index 0000000..5201ef3
--- /dev/null
+++ b/doc/latex/classRtAudioError.tex
@@ -0,0 +1,135 @@
+\section{Rt\-Audio\-Error Class Reference}
+\label{classRtAudioError}\index{RtAudioError@{Rt\-Audio\-Error}}
+{\tt \#include $<$Rt\-Audio.h$>$}
+
+\subsection*{Public Types}
+\begin{CompactItemize}
+\item
+enum {\bf TYPE} \{ {\bf WARNING},
+{\bf DEBUG\_\-WARNING},
+{\bf UNSPECIFIED},
+{\bf NO\_\-DEVICES\_\-FOUND},
+{\bf INVALID\_\-DEVICE},
+{\bf INVALID\_\-STREAM},
+{\bf MEMORY\_\-ERROR},
+{\bf INVALID\_\-PARAMETER},
+{\bf DRIVER\_\-ERROR},
+{\bf SYSTEM\_\-ERROR},
+{\bf THREAD\_\-ERROR}
+ \}
+\end{CompactItemize}
+\subsection*{Public Methods}
+\begin{CompactItemize}
+\item
+{\bf Rt\-Audio\-Error} (const char $\ast$p, {\bf TYPE} tipe=Rt\-Audio\-Error::UNSPECIFIED)
+\begin{CompactList}\small\item\em The constructor.\item\end{CompactList}\item
+virtual {\bf $\sim$Rt\-Audio\-Error} (void)
+\begin{CompactList}\small\item\em The destructor.\item\end{CompactList}\item
+virtual void {\bf print\-Message} (void)
+\begin{CompactList}\small\item\em Prints \char`\"{}thrown\char`\"{} error message to stdout.\item\end{CompactList}\item
+virtual const {\bf TYPE}\& {\bf get\-Type} (void)
+\begin{CompactList}\small\item\em Returns the \char`\"{}thrown\char`\"{} error message TYPE.\item\end{CompactList}\item
+virtual const char$\ast$ {\bf get\-Message} (void)
+\begin{CompactList}\small\item\em Returns the \char`\"{}thrown\char`\"{} error message string.\item\end{CompactList}\end{CompactItemize}
+\subsection*{Protected Attributes}
+\begin{CompactItemize}
+\item
+char {\bf error\_\-message} [256]
+\item
+{\bf TYPE} {\bf type}
+\end{CompactItemize}
+
+
+\subsection{Member Enumeration Documentation}
+\index{RtAudioError@{Rt\-Audio\-Error}!TYPE@{TYPE}}
+\index{TYPE@{TYPE}!RtAudioError@{Rt\-Audio\-Error}}
+\subsubsection{\setlength{\rightskip}{0pt plus 5cm}enum Rt\-Audio\-Error::TYPE}\label{classRtAudioError_s11}
+
+
+\begin{Desc}
+\item[{\bf Enumeration values:}]\par
+\begin{description}
+\index{WARNING@{WARNING}!RtAudioError@{Rt\-Audio\-Error}}\index{RtAudioError@{RtAudioError}!WARNING@{WARNING}}\item[
+{\em WARNING}\label{classRtAudioError_s11s0}
+]\index{DEBUG_WARNING@{DEBUG\_\-WARNING}!RtAudioError@{Rt\-Audio\-Error}}\index{RtAudioError@{RtAudioError}!DEBUG_WARNING@{DEBUG\_\-WARNING}}\item[
+{\em DEBUG\_\-WARNING}\label{classRtAudioError_s11s1}
+]\index{UNSPECIFIED@{UNSPECIFIED}!RtAudioError@{Rt\-Audio\-Error}}\index{RtAudioError@{RtAudioError}!UNSPECIFIED@{UNSPECIFIED}}\item[
+{\em UNSPECIFIED}\label{classRtAudioError_s11s2}
+]\index{NO_DEVICES_FOUND@{NO\_\-DEVICES\_\-FOUND}!RtAudioError@{Rt\-Audio\-Error}}\index{RtAudioError@{RtAudioError}!NO_DEVICES_FOUND@{NO\_\-DEVICES\_\-FOUND}}\item[
+{\em NO\_\-DEVICES\_\-FOUND}\label{classRtAudioError_s11s3}
+]\index{INVALID_DEVICE@{INVALID\_\-DEVICE}!RtAudioError@{Rt\-Audio\-Error}}\index{RtAudioError@{RtAudioError}!INVALID_DEVICE@{INVALID\_\-DEVICE}}\item[
+{\em INVALID\_\-DEVICE}\label{classRtAudioError_s11s4}
+]\index{INVALID_STREAM@{INVALID\_\-STREAM}!RtAudioError@{Rt\-Audio\-Error}}\index{RtAudioError@{RtAudioError}!INVALID_STREAM@{INVALID\_\-STREAM}}\item[
+{\em INVALID\_\-STREAM}\label{classRtAudioError_s11s5}
+]\index{MEMORY_ERROR@{MEMORY\_\-ERROR}!RtAudioError@{Rt\-Audio\-Error}}\index{RtAudioError@{RtAudioError}!MEMORY_ERROR@{MEMORY\_\-ERROR}}\item[
+{\em MEMORY\_\-ERROR}\label{classRtAudioError_s11s6}
+]\index{INVALID_PARAMETER@{INVALID\_\-PARAMETER}!RtAudioError@{Rt\-Audio\-Error}}\index{RtAudioError@{RtAudioError}!INVALID_PARAMETER@{INVALID\_\-PARAMETER}}\item[
+{\em INVALID\_\-PARAMETER}\label{classRtAudioError_s11s7}
+]\index{DRIVER_ERROR@{DRIVER\_\-ERROR}!RtAudioError@{Rt\-Audio\-Error}}\index{RtAudioError@{RtAudioError}!DRIVER_ERROR@{DRIVER\_\-ERROR}}\item[
+{\em DRIVER\_\-ERROR}\label{classRtAudioError_s11s8}
+]\index{SYSTEM_ERROR@{SYSTEM\_\-ERROR}!RtAudioError@{Rt\-Audio\-Error}}\index{RtAudioError@{RtAudioError}!SYSTEM_ERROR@{SYSTEM\_\-ERROR}}\item[
+{\em SYSTEM\_\-ERROR}\label{classRtAudioError_s11s9}
+]\index{THREAD_ERROR@{THREAD\_\-ERROR}!RtAudioError@{Rt\-Audio\-Error}}\index{RtAudioError@{RtAudioError}!THREAD_ERROR@{THREAD\_\-ERROR}}\item[
+{\em THREAD\_\-ERROR}\label{classRtAudioError_s11s10}
+]\end{description}
+\end{Desc}
+
+
+
+\subsection{Constructor \& Destructor Documentation}
+\index{RtAudioError@{Rt\-Audio\-Error}!RtAudioError@{RtAudioError}}
+\index{RtAudioError@{RtAudioError}!RtAudioError@{Rt\-Audio\-Error}}
+\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Rt\-Audio\-Error::Rt\-Audio\-Error (const char $\ast$ {\em p}, {\bf TYPE} {\em tipe} = Rt\-Audio\-Error::UNSPECIFIED)}\label{classRtAudioError_a0}
+
+
+The constructor.
+
+\index{RtAudioError@{Rt\-Audio\-Error}!~RtAudioError@{$\sim$RtAudioError}}
+\index{~RtAudioError@{$\sim$RtAudioError}!RtAudioError@{Rt\-Audio\-Error}}
+\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Rt\-Audio\-Error::$\sim$Rt\-Audio\-Error (void)\hspace{0.3cm}{\tt [virtual]}}\label{classRtAudioError_a1}
+
+
+The destructor.
+
+
+
+\subsection{Member Function Documentation}
+\index{RtAudioError@{Rt\-Audio\-Error}!printMessage@{printMessage}}
+\index{printMessage@{printMessage}!RtAudioError@{Rt\-Audio\-Error}}
+\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Rt\-Audio\-Error::print\-Message (void)\hspace{0.3cm}{\tt [virtual]}}\label{classRtAudioError_a2}
+
+
+Prints \char`\"{}thrown\char`\"{} error message to stdout.
+
+\index{RtAudioError@{Rt\-Audio\-Error}!getType@{getType}}
+\index{getType@{getType}!RtAudioError@{Rt\-Audio\-Error}}
+\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const {\bf TYPE} \& Rt\-Audio\-Error::get\-Type (void)\hspace{0.3cm}{\tt [inline, virtual]}}\label{classRtAudioError_a3}
+
+
+Returns the \char`\"{}thrown\char`\"{} error message TYPE.
+
+\index{RtAudioError@{Rt\-Audio\-Error}!getMessage@{getMessage}}
+\index{getMessage@{getMessage}!RtAudioError@{Rt\-Audio\-Error}}
+\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const char $\ast$ Rt\-Audio\-Error::get\-Message (void)\hspace{0.3cm}{\tt [inline, virtual]}}\label{classRtAudioError_a4}
+
+
+Returns the \char`\"{}thrown\char`\"{} error message string.
+
+
+
+\subsection{Member Data Documentation}
+\index{RtAudioError@{Rt\-Audio\-Error}!error_message@{error\_\-message}}
+\index{error_message@{error\_\-message}!RtAudioError@{Rt\-Audio\-Error}}
+\subsubsection{\setlength{\rightskip}{0pt plus 5cm}char Rt\-Audio\-Error::error\_\-message\hspace{0.3cm}{\tt [protected]}}\label{classRtAudioError_n0}
+
+
+\index{RtAudioError@{Rt\-Audio\-Error}!type@{type}}
+\index{type@{type}!RtAudioError@{Rt\-Audio\-Error}}
+\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf TYPE} Rt\-Audio\-Error::type\hspace{0.3cm}{\tt [protected]}}\label{classRtAudioError_n1}
+
+
+
+
+The documentation for this class was generated from the following file:\begin{CompactItemize}
+\item
+{\bf Rt\-Audio.h}\end{CompactItemize}
diff --git a/doc/latex/doxygen.sty b/doc/latex/doxygen.sty
new file mode 100644
index 0000000..afd8b88
--- /dev/null
+++ b/doc/latex/doxygen.sty
@@ -0,0 +1,65 @@
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{doxygen}
+\RequirePackage{calc}
+\RequirePackage{array}
+\pagestyle{fancyplain}
+\addtolength{\headwidth}{\marginparsep}
+\addtolength{\headwidth}{\marginparwidth}
+\newcommand{\clearemptydoublepage}{\newpage{\pagestyle{empty}\cleardoublepage}}
+\renewcommand{\chaptermark}[1]{\markboth{#1}{}}
+\renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}}
+\lhead[\fancyplain{}{\bfseries\thepage}]
+ {\fancyplain{}{\bfseries\rightmark}}
+\rhead[\fancyplain{}{\bfseries\leftmark}]
+ {\fancyplain{}{\bfseries\thepage}}
+\rfoot[\fancyplain{}{\bfseries\scriptsize Generated at Tue Jan 22 15:27:40 2002 for Rt\-Audio by Doxygen written by Dimitri van Heesch \copyright~1997-2001}]{}
+\lfoot[]{\fancyplain{}{\bfseries\scriptsize Generated at Tue Jan 22 15:27:40 2002 for Rt\-Audio by Doxygen written by Dimitri van Heesch \copyright~1997-2001}}
+\cfoot{}
+\newenvironment{CompactList}
+{\begin{list}{}{
+ \setlength{\leftmargin}{0.5cm}
+ \setlength{\itemsep}{0pt}
+ \setlength{\parsep}{0pt}
+ \setlength{\topsep}{0pt}
+ \renewcommand{\makelabel}{}}}
+{\end{list}}
+\newenvironment{CompactItemize}
+{
+ \begin{itemize}
+ \setlength{\itemsep}{-3pt}
+ \setlength{\parsep}{0pt}
+ \setlength{\topsep}{0pt}
+ \setlength{\partopsep}{0pt}
+}
+{\end{itemize}}
+\newcommand{\PBS}[1]{\let\temp=\\#1\let\\=\temp}
+\newlength{\tmplength}
+\newenvironment{TabularC}[1]
+{
+\setlength{\tmplength}
+ {\linewidth/(#1)-\tabcolsep*2-\arrayrulewidth*(#1+1)/(#1)}
+ \par\begin{tabular*}{\linewidth}
+ {*{#1}{|>{\PBS\raggedright\hspace{0pt}}p{\the\tmplength}}|}
+}
+{\end{tabular*}\par}
+\newcommand{\entrylabel}[1]{
+ {\parbox[b]{\labelwidth-4pt}{\makebox[0pt][l]{\textbf{#1}}\\}}}
+\newenvironment{Desc}
+{\begin{list}{}
+ {
+ \settowidth{\labelwidth}{40pt}
+ \setlength{\leftmargin}{\labelwidth}
+ \setlength{\parsep}{0pt}
+ \setlength{\itemsep}{-4pt}
+ \renewcommand{\makelabel}{\entrylabel}
+ }
+}
+{\end{list}}
+\newenvironment{Indent}
+ {\begin{list}{}{\setlength{\leftmargin}{0.5cm}}
+ \item[]\ignorespaces}
+ {\unskip\end{list}}
+\setlength{\parindent}{0cm}
+\setlength{\parskip}{0.2cm}
+\addtocounter{secnumdepth}{1}
+\sloppy
diff --git a/doc/latex/files.tex b/doc/latex/files.tex
new file mode 100644
index 0000000..1176050
--- /dev/null
+++ b/doc/latex/files.tex
@@ -0,0 +1,4 @@
+\section{Rt\-Audio File List}
+Here is a list of all files with brief descriptions:\begin{CompactList}
+\item\contentsline{section}{{\bf Rt\-Audio.h} }{\pageref{RtAudio_8h}}{}
+\end{CompactList}
diff --git a/doc/latex/index.tex b/doc/latex/index.tex
new file mode 100644
index 0000000..a6b14c0
--- /dev/null
+++ b/doc/latex/index.tex
@@ -0,0 +1,595 @@
+
+
+\begin{center}
+ {\bf Introduction} {\rm (p.\,\pageref{intro})} \ \ {\bf Download} {\rm (p.\,\pageref{download})} \ \ {\bf Getting Started} {\rm (p.\,\pageref{start})} \ \ {\bf Error Handling} {\rm (p.\,\pageref{error})} \ \ {\bf Probing Device Capabilities} {\rm (p.\,\pageref{probing})} \ \ {\bf Device Settings} {\rm (p.\,\pageref{settings})} \ \ {\bf Playback (blocking functionality)} {\rm (p.\,\pageref{playbackb})} \ \ {\bf Playback (callback functionality)} {\rm (p.\,\pageref{playbackc})} \ \ {\bf Recording} {\rm (p.\,\pageref{recording})} \ \ {\bf Duplex Mode} {\rm (p.\,\pageref{duplex})} \ \ {\bf Summary of Methods} {\rm (p.\,\pageref{methods})} \ \ {\bf Compiling} {\rm (p.\,\pageref{compiling})} \ \ {\bf OS Notes} {\rm (p.\,\pageref{osnotes})} \ \ {\bf Acknowledgments} {\rm (p.\,\pageref{acknowledge})} \end{center}
+
+
+\section{Introduction}\label{intro}
+
+
+{\bf Rt\-Audio} {\rm (p.\,\pageref{classRtAudio})} is a C++ class which provides a common API (Application Programming Interface) for realtime audio input/output across Linux (native ALSA and OSS), SGI, and Windows operating systems. {\bf Rt\-Audio} {\rm (p.\,\pageref{classRtAudio})} significantly simplifies the process of interacting with computer audio hardware. It was designed with the following goals:
+
+\begin{CompactItemize}
+ \item
+object oriented C++ design \item
+simple, common API across all supported platforms \item
+single independent header and source file for easy inclusion in programming projects (no libraries!) \item
+blocking functionality \item
+callback functionality \item
+extensive audio device parameter control \item
+audio device capability probing \item
+automatic internal conversion for data format, channel number compensation, de-interleaving, and byte-swapping \item
+control over multiple audio streams and devices with a single instance \end{CompactItemize}
+
+
+{\bf Rt\-Audio} {\rm (p.\,\pageref{classRtAudio})} 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. Multiple streams can run at the same time and, when allowed by the underlying audio API, a single device can serve multiple streams.
+
+The {\bf Rt\-Audio} {\rm (p.\,\pageref{classRtAudio})} 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{Download}\label{download}
+
+
+Latest Release (22 January 2002): {\tt Version 2.0 (111 k\-B tar/gzipped)}
+
+\section{Getting Started}\label{start}
+
+
+The first thing that must be done when using {\bf Rt\-Audio} {\rm (p.\,\pageref{classRtAudio})} is to create an instance of the class. The default constructor {\bf Rt\-Audio::Rt\-Audio}() {\rm (p.\,\pageref{classRtAudio_a0})} scans the underlying audio system to verify that at least one device is available. {\bf Rt\-Audio} {\rm (p.\,\pageref{classRtAudio})} 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:
+
+\footnotesize\begin{verbatim}#include "RtAudio.h"
+
+int main()
+{
+ RtAudio *audio;
+
+ // Default RtAudio constructor
+ try {
+ audio = new RtAudio();
+ }
+ catch (RtAudioError &error) {
+ // Handle the exception here
+ }
+
+ // Clean up
+ delete audio;
+}\end{verbatim}\normalsize
+
+
+Obviously, this example doesn't demonstrate any of the real functionality of {\bf Rt\-Audio} {\rm (p.\,\pageref{classRtAudio})}. However, all uses of {\bf Rt\-Audio} {\rm (p.\,\pageref{classRtAudio})} 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 Handling}\label{error}
+
+
+{\bf Rt\-Audio} {\rm (p.\,\pageref{classRtAudio})} uses a C++ exception handler called {\bf Rt\-Audio\-Error} {\rm (p.\,\pageref{classRtAudioError})}, which is declared and defined within the {\bf Rt\-Audio} {\rm (p.\,\pageref{classRtAudio})} class files. The {\bf Rt\-Audio\-Error} {\rm (p.\,\pageref{classRtAudioError})} class is quite simple but it does allow errors to be \char`\"{}caught\char`\"{} by {\bf Rt\-Audio\-Error::TYPE} {\rm (p.\,\pageref{classRtAudioError_s11})}. Almost all {\bf Rt\-Audio} {\rm (p.\,\pageref{classRtAudio})} methods can \char`\"{}throw\char`\"{} an {\bf Rt\-Audio\-Error} {\rm (p.\,\pageref{classRtAudioError})}, most typically if an invalid stream identifier is supplied to a method or a driver error occurs. There are a number of cases within {\bf Rt\-Audio} {\rm (p.\,\pageref{classRtAudio})} where warning messages may be displayed but an exception is not thrown. There is a private {\bf Rt\-Audio} {\rm (p.\,\pageref{classRtAudio})} method, error(), which can be modified to globally control how these messages are handled and reported.
+
+\section{Probing Device Capabilities}\label{probing}
+
+
+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.
+
+\footnotesize\begin{verbatim}// probe.cpp
+
+#include <iostream.h>
+#include "RtAudio.h"
+
+int main()
+{
+ RtAudio *audio;
+
+ // Default RtAudio constructor
+ try {
+ audio = new RtAudio();
+ }
+ catch (RtAudioError &error) {
+ error.printMessage();
+ exit(EXIT_FAILURE);
+ }
+
+ // Determine the number of devices available
+ int devices = audio->getDeviceCount();
+
+ // Scan through devices for various capabilities
+ RtAudio::RTAUDIO_DEVICE info;
+ for (int i=0; i<devices; i++) {
+
+ try {
+ audio->getDeviceInfo(i, &info);
+ }
+ catch (RtAudioError &error) {
+ error.printMessage();
+ break;
+ }
+
+ // Print, for example, the maximum number of output channels for each device
+ cout << "device = " << i;
+ cout << ": maximum output channels = " << info.maxOutputChannels << endl;
+ }
+
+ // Clean up
+ delete audio;
+
+ return 0;
+}\end{verbatim}\normalsize
+
+
+The RTAUDIO\_\-DEVICE structure is defined in {\bf Rt\-Audio.h} and provides a variety of information useful in assessing the capabilities of a device:
+
+\footnotesize\begin{verbatim} typedef struct {
+ char name[128];
+ DEVICE_ID id[2]; // No value reported by getDeviceInfo().
+ bool probed; // true if the device probe was successful.
+ int maxOutputChannels;
+ int maxInputChannels;
+ int maxDuplexChannels;
+ int minOutputChannels;
+ int minInputChannels;
+ int minDuplexChannels;
+ bool hasDuplexSupport; // true if duplex supported
+ int nSampleRates; // Number of discrete rates, or -1 if range supported.
+ double sampleRates[MAX_SAMPLE_RATES]; // Supported sample rates, or {min, max} if range.
+ RTAUDIO_FORMAT nativeFormats;
+ } RTAUDIO_DEVICE;\end{verbatim}\normalsize
+
+
+The following data formats are defined and fully supported by {\bf Rt\-Audio} {\rm (p.\,\pageref{classRtAudio})}:
+
+\footnotesize\begin{verbatim} typedef unsigned long RTAUDIO_FORMAT;
+ static const RTAUDIO_FORMAT RTAUDIO_SINT8; // Signed 8-bit integer
+ static const RTAUDIO_FORMAT RTAUDIO_SINT16; // Signed 16-bit integer
+ static const RTAUDIO_FORMAT RTAUDIO_SINT24; // Signed 24-bit integer
+ static const RTAUDIO_FORMAT RTAUDIO_SINT32; // Signed 32-bit integer
+ static const RTAUDIO_FORMAT RTAUDIO_FLOAT32; // 32-bit float
+ static const RTAUDIO_FORMAT RTAUDIO_FLOAT64; // 64-bit double\end{verbatim}\normalsize
+
+
+The {\em native\-Formats} member of the {\bf Rt\-Audio::RTAUDIO\_\-DEVICE} {\rm (p.\,\pageref{structRtAudio_1_1RTAUDIO__DEVICE})} structure is a bit mask of the above formats which are natively supported by the device. However, {\bf Rt\-Audio} {\rm (p.\,\pageref{classRtAudio})} will automatically provide format conversion if a particular format is not natively supported. When the {\em probed} member of the RTAUDIO\_\-DEVICE structure is false, the remaining structure members are likely unknown and the device is probably unusable.
+
+In general, the user need not be concerned with the minimum channel values reported in the RTAUDIO\_\-DEVICE structure. While some audio devices may require a minimum channel value $>$ 1, {\bf Rt\-Audio} {\rm (p.\,\pageref{classRtAudio})} 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} 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.
+
+\section{Device Settings}\label{settings}
+
+
+The next step in using {\bf Rt\-Audio} {\rm (p.\,\pageref{classRtAudio})} is to open a stream with a particular set of device settings.
+
+\footnotesize\begin{verbatim}#include "RtAudio.h"
+
+int main()
+{
+ int channels = 2;
+ int sample_rate = 44100;
+ int buffer_size = 256; // 256 sample frames
+ int n_buffers = 4; // number of internal buffers used by device
+ int device = 0; // 0 indicates the default or first available device
+ int stream; // our stream identifier
+ RtAudio *audio;
+
+ // Instantiate RtAudio and open a stream within a try/catch block
+ try {
+ audio = new RtAudio();
+ stream = audio->openStream(device, channels, 0, 0, RtAudio::RTAUDIO_FLOAT32,
+ sample_rate, &buffer_size, n_buffers);
+ }
+ catch (RtAudioError &error) {
+ error.printMessage();
+ exit(EXIT_FAILURE);
+ }
+
+ // Clean up
+ delete audio;
+
+ return 0;
+}\end{verbatim}\normalsize
+
+
+The {\bf Rt\-Audio::open\-Stream}() {\rm (p.\,\pageref{classRtAudio_a3})} method attempts to open a stream with a specified set of parameter values. When successful, a stream identifier is returned. In this case, we attempt to open a playback stream on device 0 with two channels, 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, {\bf Rt\-Audio} {\rm (p.\,\pageref{classRtAudio})} first attempts to open the default audio device with the given parameters. If that attempt fails, an attempt is made to find a device or set of devices which will meet the given parameters. If all attempts are unsuccessful, an {\bf Rt\-Audio\-Error} {\rm (p.\,\pageref{classRtAudioError})} is thrown. When a non-zero device value is specified, an attempt is made to open that device only.
+
+{\bf Rt\-Audio} {\rm (p.\,\pageref{classRtAudio})} provides four signed integer and two floating point data formats which can be specified using the {\bf Rt\-Audio::RTAUDIO\_\-FORMAT} {\rm (p.\,\pageref{classRtAudio_s0})} parameter values mentioned earlier. If the opened device does not natively support the given format, {\bf Rt\-Audio} {\rm (p.\,\pageref{classRtAudio})} will automatically perform the necessary data format conversion.
+
+Buffer sizes in {\bf Rt\-Audio} {\rm (p.\,\pageref{classRtAudio})} are {\em ALWAYS} given in sample frame units. For example, if you open an output stream with 4 channels and set {\em buffer\-Size} to 512, you will have to write 2048 samples of data to the output buffer within your callback or between calls to {\bf Rt\-Audio::tick\-Stream}() {\rm (p.\,\pageref{classRtAudio_a9})}. In this case, a single sample frame of data contains 4 samples of data.
+
+The {\em buffer\-Size} 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 n\-Buffers} parameter is used in setting the underlying device buffer parameters. Both the {\em buffer\-Size} and {\em n\-Buffers} parameters can be used to control stream latency though there is no guarantee that the passed values will be those used by a device. 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 buffer\-Size} parameter is passed as a pointer and the actual value used by the stream is set during the device setup procedure. {\em buffer\-Size} values should be a power of two. Optimal and allowable buffer values tend to vary between systems and devices. Check the {\bf OS Notes} {\rm (p.\,\pageref{osnotes})} 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, {\bf Rt\-Audio} {\rm (p.\,\pageref{classRtAudio})} does not attempt to query a device's capabilities or use previously reported values when opening a device. Instead, {\bf Rt\-Audio} {\rm (p.\,\pageref{classRtAudio})} simply attempts to set the given parameters on a specified device and then checks whether the setup is successful or not.
+
+\section{Playback (blocking functionality)}\label{playbackb}
+
+
+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.
+
+\footnotesize\begin{verbatim}// playback.cpp
+
+#include "RtAudio.h"
+
+int main()
+{
+ int count;
+ int channels = 2;
+ int sample_rate = 44100;
+ int buffer_size = 256; // 256 sample frames
+ int n_buffers = 4; // number of internal buffers used by device
+ float *buffer;
+ int device = 0; // 0 indicates the default or first available device
+ int stream; // our stream identifier
+ RtAudio *audio;
+
+ // Open a stream during RtAudio instantiation
+ try {
+ audio = new RtAudio(&stream, device, channels, 0, 0, RtAudio::RTAUDIO_FLOAT32,
+ sample_rate, &buffer_size, n_buffers);
+ }
+ catch (RtAudioError &error) {
+ error.printMessage();
+ exit(EXIT_FAILURE);
+ }
+
+ try {
+ // Get a pointer to the stream buffer
+ buffer = (float *) audio->getStreamBuffer(stream);
+
+ // Start the stream
+ audio->startStream(stream);
+ }
+ catch (RtAudioError &error) {
+ error.printMessage();
+ goto cleanup;
+ }
+
+ // An example loop which runs for about 40000 sample frames
+ count = 0;
+ while (count < 40000) {
+ // Generate your samples and fill the buffer with buffer_size sample frames of data
+ ...
+
+ // Trigger the output of the data buffer
+ try {
+ audio->tickStream(stream);
+ }
+ catch (RtAudioError &error) {
+ error.printMessage();
+ goto cleanup;
+ }
+
+ count += buffer_size;
+ }
+
+ try {
+ // Stop and close the stream
+ audio->stopStream(stream);
+ audio->closeStream(stream);
+ }
+ catch (RtAudioError &error) {
+ error.printMessage();
+ }
+
+ cleanup:
+ delete audio;
+
+ return 0;
+}\end{verbatim}\normalsize
+
+
+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 {\bf Rt\-Audio::open\-Stream}() {\rm (p.\,\pageref{classRtAudio_a3})} method. Again, we have specified a device value of 0, indicating that the default or first available device meeting the given parameters should be used. The integer identifier of the opened stream is returned via the {\em stream} pointer value. An attempt is made to open the stream with the specified {\em buffer\-Size} 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 {\bf Rt\-Audio} {\rm (p.\,\pageref{classRtAudio})} destructor if an exception is thrown during instantiation.
+
+Because {\bf Rt\-Audio} {\rm (p.\,\pageref{classRtAudio})} can be used to simultaneously control more than a single stream, it is necessary that the stream identifier be provided to nearly all public methods. Assuming the constructor is successful, it is necessary to get a pointer to the buffer, provided by {\bf Rt\-Audio} {\rm (p.\,\pageref{classRtAudio})}, for use in feeding data to/from the opened stream. Note that the user should {\em NOT} attempt to deallocate the stream buffer memory ... memory management for the stream buffer will be automatically controlled by {\bf Rt\-Audio} {\rm (p.\,\pageref{classRtAudio})}. After starting the stream with {\bf Rt\-Audio::start\-Stream}() {\rm (p.\,\pageref{classRtAudio_a11})}, one simply fills that buffer, which is of length equal to the returned {\em buffer\-Size} value, with interleaved audio data (in the specified format) for playback. Finally, a call to the {\bf Rt\-Audio::tick\-Stream}() {\rm (p.\,\pageref{classRtAudio_a9})} routine triggers a blocking write call for the stream.
+
+In general, one should call the {\bf Rt\-Audio::stop\-Stream}() {\rm (p.\,\pageref{classRtAudio_a12})} and {\bf Rt\-Audio::close\-Stream}() {\rm (p.\,\pageref{classRtAudio_a10})} methods after finishing with a stream. However, both methods will implicitly be called during object destruction if necessary.
+
+\section{Playback (callback functionality)}\label{playbackc}
+
+
+The primary difference in using {\bf Rt\-Audio} {\rm (p.\,\pageref{classRtAudio})} with callback functionality involves the creation of a user-defined callback function. Here is an example which produces a sawtooth waveform for playback.
+
+\footnotesize\begin{verbatim}#include <iostream.h>
+#include "RtAudio.h"
+
+// Two-channel sawtooth wave generator.
+int sawtooth(char *buffer, int buffer_size, void *data)
+{
+ int i, j;
+ double *my_buffer = (double *) buffer;
+ double *my_data = (double *) data;
+
+ // Write interleaved audio data.
+ for (i=0; i<buffer_size; i++) {
+ for (j=0; j<2; j++) {
+ *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 sample_rate = 44100;
+ int buffer_size = 256; // 256 sample frames
+ int n_buffers = 4; // number of internal buffers used by device
+ int device = 0; // 0 indicates the default or first available device
+ int stream; // our stream identifier
+ double data[2];
+ char input;
+ RtAudio *audio;
+
+ // Open a stream during RtAudio instantiation
+ try {
+ audio = new RtAudio(&stream, device, channels, 0, 0, RtAudio::RTAUDIO_FLOAT64,
+ sample_rate, &buffer_size, n_buffers);
+ }
+ catch (RtAudioError &error) {
+ error.printMessage();
+ exit(EXIT_FAILURE);
+ }
+
+ try {
+ // Set the stream callback function
+ audio->setStreamCallback(stream, &sawtooth, (void *)data);
+
+ // Start the stream
+ audio->startStream(stream);
+ }
+ catch (RtAudioError &error) {
+ error.printMessage();
+ goto cleanup;
+ }
+
+ cout << "\nPlaying ... press <enter> to quit.\n";
+ cin.get(input);
+
+ try {
+ // Stop and close the stream
+ audio->stopStream(stream);
+ audio->closeStream(stream);
+ }
+ catch (RtAudioError &error) {
+ error.printMessage();
+ }
+
+ cleanup:
+ delete audio;
+
+ return 0;
+}\end{verbatim}\normalsize
+
+
+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 {\bf Rt\-Audio::set\-Stream\-Callback}() {\rm (p.\,\pageref{classRtAudio_a4})}. This method will spawn a new process (or thread) which automatically calls the callback function when more data is needed. Note that the callback function is called only when the stream is \char`\"{}running\char`\"{} (between calls to the {\bf Rt\-Audio::start\-Stream}() {\rm (p.\,\pageref{classRtAudio_a11})} and {\bf Rt\-Audio::stop\-Stream}() {\rm (p.\,\pageref{classRtAudio_a12})} methods). The last argument to {\bf Rt\-Audio::set\-Stream\-Callback}() {\rm (p.\,\pageref{classRtAudio_a4})} 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 {\bf Rt\-Audio::stop\-Stream}() {\rm (p.\,\pageref{classRtAudio_a12})}. 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 {\bf Rt\-Audio::set\-Stream\-Callback} {\rm (p.\,\pageref{classRtAudio_a4})}, the callback process will continue to run for the life of the stream (until the stream is closed with {\bf Rt\-Audio::close\-Stream}() {\rm (p.\,\pageref{classRtAudio_a10})} or the {\bf Rt\-Audio} {\rm (p.\,\pageref{classRtAudio})} instance is deleted). It is possible to disassociate a callback function and cancel its process for an open stream using the {\bf Rt\-Audio::cancel\-Stream\-Callback}() {\rm (p.\,\pageref{classRtAudio_a5})} method. The stream can then be used with blocking functionality or a new callback can be associated with it.
+
+\section{Recording}\label{recording}
+
+
+Using {\bf Rt\-Audio} {\rm (p.\,\pageref{classRtAudio})} for audio input is almost identical to the way it is used for playback. Here's the blocking playback example rewritten for recording:
+
+\footnotesize\begin{verbatim}// record.cpp
+
+#include "RtAudio.h"
+
+int main()
+{
+ int count;
+ int channels = 2;
+ int sample_rate = 44100;
+ int buffer_size = 256; // 256 sample frames
+ int n_buffers = 4; // number of internal buffers used by device
+ float *buffer;
+ int device = 0; // 0 indicates the default or first available device
+ int stream; // our stream identifier
+ RtAudio *audio;
+
+ // Instantiate RtAudio and open a stream.
+ try {
+ audio = new RtAudio(&stream, 0, 0, device, channels,
+ RtAudio::RTAUDIO_FLOAT32, sample_rate, &buffer_size, n_buffers);
+ }
+ catch (RtAudioError &error) {
+ error.printMessage();
+ exit(EXIT_FAILURE);
+ }
+
+ try {
+ // Get a pointer to the stream buffer
+ buffer = (float *) audio->getStreamBuffer(stream);
+
+ // Start the stream
+ audio->startStream(stream);
+ }
+ catch (RtAudioError &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(stream);
+ }
+ catch (RtAudioError &error) {
+ error.printMessage();
+ goto cleanup;
+ }
+
+ // Process the input samples (buffer_size sample frames) that were read
+ ...
+
+ count += buffer_size;
+ }
+
+ try {
+ // Stop the stream
+ audio->stopStream(stream);
+ }
+ catch (RtAudioError &error) {
+ error.printMessage();
+ }
+
+ cleanup:
+ delete audio;
+
+ return 0;
+}\end{verbatim}\normalsize
+
+
+In this example, the stream was opened for recording with a non-zero {\em input\-Channels} 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 Mode}\label{duplex}
+
+
+Finally, it is easy to use {\bf Rt\-Audio} {\rm (p.\,\pageref{classRtAudio})} for simultaneous audio input/output, or duplex operation. In this example, we use a callback function and pass our recorded data directly through for playback.
+
+\footnotesize\begin{verbatim}// duplex.cpp
+
+#include <iostream.h>
+#include "RtAudio.h"
+
+// Pass-through function.
+int pass(char *buffer, int buffer_size, void *)
+{
+ // Surprise!! We do nothing to pass the data through.
+ return 0;
+}
+
+int main()
+{
+ int channels = 2;
+ int sample_rate = 44100;
+ int buffer_size = 256; // 256 sample frames
+ int n_buffers = 4; // number of internal buffers used by device
+ int device = 0; // 0 indicates the default or first available device
+ int stream; // our stream identifier
+ double data[2];
+ char input;
+ RtAudio *audio;
+
+ // Open a stream during RtAudio instantiation
+ try {
+ audio = new RtAudio(&stream, device, channels, device, channels, RtAudio::RTAUDIO_FLOAT64,
+ sample_rate, &buffer_size, n_buffers);
+ }
+ catch (RtAudioError &error) {
+ error.printMessage();
+ exit(EXIT_FAILURE);
+ }
+
+ try {
+ // Set the stream callback function
+ audio->setStreamCallback(stream, &pass, NULL);
+
+ // Start the stream
+ audio->startStream(stream);
+ }
+ catch (RtAudioError &error) {
+ error.printMessage();
+ goto cleanup;
+ }
+
+ cout << "\nRunning duplex ... press <enter> to quit.\n";
+ cin.get(input);
+
+ try {
+ // Stop and close the stream
+ audio->stopStream(stream);
+ audio->closeStream(stream);
+ }
+ catch (RtAudioError &error) {
+ error.printMessage();
+ }
+
+ cleanup:
+ delete audio;
+
+ return 0;
+}\end{verbatim}\normalsize
+
+
+When an {\bf Rt\-Audio} {\rm (p.\,\pageref{classRtAudio})} stream is running in duplex mode (nonzero input {\em AND} output channels), the audio write (playback) operation always occurs before the audio read (record) operation. This sequence allows the use of a single buffer to store both output and input data.
+
+As we see with this example, the write-read sequence of operations does not preclude the use of {\bf Rt\-Audio} {\rm (p.\,\pageref{classRtAudio})} in situations where input data is first processed and then output through a duplex stream. When the stream buffer is first allocated, it is initialized with zeros, which produces no audible result when output to the device. In this example, anything recorded by the audio stream input will be played out during the next round of audio processing.
+
+Note that duplex operation can also be achieved by opening one output stream and one input stream using the same or different devices. However, there may be timing problems when attempting to use two different devices, due to possible device clock variations. This becomes even more difficult to achieve using two separate callback streams because it is not possible to explicitly control the calling order of the callback functions.
+
+\section{Summary of Methods}\label{methods}
+
+
+The following is short summary of public methods (not including constructors and the destructor) provided by {\bf Rt\-Audio} {\rm (p.\,\pageref{classRtAudio})}:
+
+\begin{CompactItemize}
+ \item
+{\bf Rt\-Audio::open\-Stream}() {\rm (p.\,\pageref{classRtAudio_a3})}: opens a stream with the specified parameters. \item
+{\bf Rt\-Audio::set\-Stream\-Callback}() {\rm (p.\,\pageref{classRtAudio_a4})}: sets a user-defined callback function for a given stream. \item
+{\bf Rt\-Audio::cancel\-Stream\-Callback}() {\rm (p.\,\pageref{classRtAudio_a5})}: cancels a callback process and function for a given stream. \item
+{\bf Rt\-Audio::get\-Device\-Count}() {\rm (p.\,\pageref{classRtAudio_a6})}: returns the number of audio devices available. \item
+{\bf Rt\-Audio::get\-Device\-Info}() {\rm (p.\,\pageref{classRtAudio_a7})}: fills a user-supplied RTAUDIO\_\-DEVICE structure for a specified device. \item
+{\bf Rt\-Audio::get\-Stream\-Buffer}() {\rm (p.\,\pageref{classRtAudio_a8})}: returns a pointer to the stream buffer. \item
+{\bf Rt\-Audio::tick\-Stream}() {\rm (p.\,\pageref{classRtAudio_a9})}: triggers processing of input/output data for a stream (blocking). \item
+{\bf Rt\-Audio::close\-Stream}() {\rm (p.\,\pageref{classRtAudio_a10})}: closes the specified stream (implicitly called during object destruction). Once a stream is closed, the stream identifier is invalid and should not be used in calling any other {\bf Rt\-Audio} {\rm (p.\,\pageref{classRtAudio})} methods. \item
+{\bf Rt\-Audio::start\-Stream}() {\rm (p.\,\pageref{classRtAudio_a11})}: (re)starts the specified stream, typically after it has been stopped with either stop\-Stream() or abort\-Stream() or after first opening the stream. \item
+{\bf Rt\-Audio::stop\-Stream}() {\rm (p.\,\pageref{classRtAudio_a12})}: stops the specified stream, allowing any remaining samples in the queue to be played out and/or read in. This does not implicitly call {\bf Rt\-Audio::close\-Stream}() {\rm (p.\,\pageref{classRtAudio_a10})}. \item
+{\bf Rt\-Audio::abort\-Stream}() {\rm (p.\,\pageref{classRtAudio_a13})}: stops the specified stream, discarding any remaining samples in the queue. This does not implicitly call close\-Stream(). \item
+{\bf Rt\-Audio::stream\-Will\-Block}() {\rm (p.\,\pageref{classRtAudio_a14})}: queries a stream to determine whether a call to the {\em tick\-Stream()} method will block. A return value of 0 indicates that the stream will NOT block. A positive return value indicates the number of sample frames that cannot yet be processed without blocking. \end{CompactItemize}
+
+
+\section{Compiling}\label{compiling}
+
+
+In order to compile {\bf Rt\-Audio} {\rm (p.\,\pageref{classRtAudio})} for a specific OS and audio API, it is necessary to supply the appropriate preprocessor definition and library within the compiler statement:
+
+
+
+ \begin{TabularC}{5}
+\hline
+{\bf OS:} &{\bf Audio API:} &{\bf Preprocessor Definition:} &{\bf Library:} &{\bf Example Compiler Statement:} \\\hline
+Linux &ALSA &\_\-\_\-LINUX\_\-ALSA\_\- &{\tt libasound, libpthread} &{\tt g++ -Wall -D\_\-\_\-LINUX\_\-ALSA\_\- -o probe probe.cpp Rt\-Audio.cpp -lasound -lpthread} \\\hline
+Linux &OSS &\_\-\_\-LINUX\_\-OSS\_\- &{\tt libpthread} &{\tt g++ -Wall -D\_\-\_\-LINUX\_\-OSS\_\- -o probe probe.cpp Rt\-Audio.cpp -lpthread} \\\hline
+Irix &AL &\_\-\_\-IRIX\_\-AL\_\- &{\tt libaudio, libpthread} &{\tt CC -Wall -D\_\-\_\-IRIX\_\-AL\_\- -o probe probe.cpp Rt\-Audio.cpp -laudio -lpthread} \\\hline
+Windows &Direct Sound &\_\-\_\-WINDOWS\_\-DS\_\- &{\tt dsound.lib (ver. 5.0 or higher), multithreaded} &{\em compiler specific} \\\hline
+\end{TabularC}
+
+
+
+
+The example compiler statements above could be used to compile the {\tt probe.cpp} example file, assuming that {\tt probe.cpp}, {\tt {\bf Rt\-Audio.h}}, and {\tt Rt\-Audio.cpp} all exist in the same directory.
+
+\section{OS Notes}\label{osnotes}
+
+
+{\bf Rt\-Audio} {\rm (p.\,\pageref{classRtAudio})} is designed to provide a common API across the various supported operating systems and audio libraries. Despite that, however, some issues need to be mentioned with regard to each.
+
+\subsection{Linux:}\label{linux}
+
+
+{\bf Rt\-Audio} {\rm (p.\,\pageref{classRtAudio})} for Linux was developed under Redhat distributions 7.0 - 7.2. Two different audio APIs are supported on Linux platforms: OSS and {\tt ALSA}. The OSS API has existed for at least 6 years and the Linux kernel is distributed with free versions of OSS audio drivers. Therefore, a generic Linux system is most likely to have OSS support. The ALSA API is relatively new and at this time is not part of the Linux kernel distribution. Work is in progress to make ALSA part of the 2.5 development kernel series. Despite that, the ALSA API offers significantly better functionality than the OSS API. {\bf Rt\-Audio} {\rm (p.\,\pageref{classRtAudio})} provides support for the 0.9 and higher versions of ALSA. Input/output latency on the order of 15-20 milliseconds can typically be achieved under both OSS or ALSA by fine-tuning the {\bf Rt\-Audio} {\rm (p.\,\pageref{classRtAudio})} 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 {\bf Rt\-Audio} {\rm (p.\,\pageref{classRtAudio})} tests, it is recommended that the native ALSA implementation of {\bf Rt\-Audio} {\rm (p.\,\pageref{classRtAudio})} be used on systems which have ALSA drivers installed.
+
+The ALSA implementation of {\bf Rt\-Audio} {\rm (p.\,\pageref{classRtAudio})} makes no use of the ALSA \char`\"{}plug\char`\"{} interface. All necessary data format conversions, channel compensation, deinterleaving, and byte-swapping is handled by internal {\bf Rt\-Audio} {\rm (p.\,\pageref{classRtAudio})} routines.
+
+\subsection{Irix (SGI):}\label{irix}
+
+
+The Irix version of {\bf Rt\-Audio} {\rm (p.\,\pageref{classRtAudio})} was written and tested on an SGI Indy running Irix version 6.5 and the newer \char`\"{}al\char`\"{} audio library. {\bf Rt\-Audio} {\rm (p.\,\pageref{classRtAudio})} does not compile under Irix version 6.3 because the C++ compiler is too old. Despite the relatively slow speed of the Indy, {\bf Rt\-Audio} {\rm (p.\,\pageref{classRtAudio})} 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{Windows:}\label{windows}
+
+
+{\bf Rt\-Audio} {\rm (p.\,\pageref{classRtAudio})} under Windows is written using the Direct\-Sound API. In order to compile {\bf Rt\-Audio} {\rm (p.\,\pageref{classRtAudio})} under Windows, you must have the header and source files for Direct\-Sound version 0.5 or higher. As far as I know, you cannot compile {\bf Rt\-Audio} {\rm (p.\,\pageref{classRtAudio})} for Windows NT because there is not sufficient Direct\-Sound support. Audio output latency with Direct\-Sound 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, Direct\-Sound drivers tend to crash easily when experimenting with buffer parameters. On my system, I found it necessary to use values around n\-Buffers = 8 and buffer\-Size = 512 to avoid crashing my system. {\bf Rt\-Audio} {\rm (p.\,\pageref{classRtAudio})} was developed with Visual C++ version 6.0. I was forced in several instances to modify code in order to get it to compile under the non-standard version of C++ that Microsoft so unprofessionally implemented. We can only hope that the developers of Visual C++ 7.0 will have time to read the C++ standard.
+
+\section{Acknowledgments}\label{acknowledge}
+
+
+The {\bf Rt\-Audio} {\rm (p.\,\pageref{classRtAudio})} API incorporates many of the concepts developed in the {\tt Port\-Audio} project by Phil Burk and Ross Bencina. Early development also incorporated ideas from Bill Schottstaedt's {\tt sndlib}. The CCRMA {\tt Sound\-Wire group} provided valuable feedback during the API proposal stages.
+
+{\bf Rt\-Audio} {\rm (p.\,\pageref{classRtAudio})} was slowly developed over the course of many months while in residence at the {\tt Institut Universitari de L'Audiovisual (IUA)} in Barcelona, Spain, the {\tt Laboratory of Acoustics and Audio Signal Processing} at the Helsinki University of Technology, Finland, and the {\tt Center for Computer Research in Music and Acoustics (CCRMA)} at {\tt Stanford University}. This work was supported in part by the United States Air Force Office of Scientific Research (grant \#F49620-99-1-0293).
+
+These documentation files were generated using {\tt doxygen} by Dimitri van Heesch.
+
diff --git a/doc/latex/refman.tex b/doc/latex/refman.tex
new file mode 100644
index 0000000..06dfb7d
--- /dev/null
+++ b/doc/latex/refman.tex
@@ -0,0 +1,42 @@
+\documentclass[a4paper]{book}
+\usepackage{a4wide}
+\usepackage{makeidx}
+\usepackage{fancyhdr}
+\usepackage{graphicx}
+\usepackage{float}
+\usepackage{alltt}
+\usepackage{doxygen}
+\makeindex
+\setcounter{tocdepth}{1}
+\setlength{\footrulewidth}{0.4pt}
+\begin{document}
+\begin{titlepage}
+\vspace*{7cm}
+\begin{center}
+{\Large Rt\-Audio Reference Manual}\\
+\vspace*{1cm}
+{\large Generated by Doxygen 1.2.8.1}\\
+\vspace*{0.5cm}
+{\small Tue Jan 22 15:27:40 2002}\\
+\end{center}
+\end{titlepage}
+\clearemptydoublepage
+\pagenumbering{roman}
+\tableofcontents
+\clearemptydoublepage
+\pagenumbering{arabic}
+\chapter{The {\bf Rt\-Audio} {\rm (p.\,\pageref{classRtAudio})} Tutorial}
+\label{index}\input{index}
+\chapter{Rt\-Audio Compound Index}
+\input{annotated}
+\chapter{Rt\-Audio File Index}
+\input{files}
+\chapter{Rt\-Audio Class Documentation}
+\input{classRtAudio}
+\include{structRtAudio_1_1RTAUDIO__DEVICE}
+\include{classRtAudioError}
+\chapter{Rt\-Audio File Documentation}
+\input{RtAudio_8h}
+\include{tutorial_8txt}
+\printindex
+\end{document}
diff --git a/doc/latex/structRtAudio_1_1RTAUDIO__DEVICE.tex b/doc/latex/structRtAudio_1_1RTAUDIO__DEVICE.tex
new file mode 100644
index 0000000..3f09092
--- /dev/null
+++ b/doc/latex/structRtAudio_1_1RTAUDIO__DEVICE.tex
@@ -0,0 +1,106 @@
+\section{Rt\-Audio::RTAUDIO\_\-DEVICE Struct Reference}
+\label{structRtAudio_1_1RTAUDIO__DEVICE}\index{RtAudio::RTAUDIO_DEVICE@{Rt\-Audio::RTAUDIO\_\-DEVICE}}
+{\tt \#include $<$Rt\-Audio.h$>$}
+
+\subsection*{Public Attributes}
+\begin{CompactItemize}
+\item
+char {\bf name} [128]
+\item
+DEVICE\_\-ID {\bf id} [2]
+\item
+bool {\bf probed}
+\item
+int {\bf max\-Output\-Channels}
+\item
+int {\bf max\-Input\-Channels}
+\item
+int {\bf max\-Duplex\-Channels}
+\item
+int {\bf min\-Output\-Channels}
+\item
+int {\bf min\-Input\-Channels}
+\item
+int {\bf min\-Duplex\-Channels}
+\item
+bool {\bf has\-Duplex\-Support}
+\item
+int {\bf n\-Sample\-Rates}
+\item
+int {\bf sample\-Rates} [MAX\_\-SAMPLE\_\-RATES]
+\item
+{\bf RTAUDIO\_\-FORMAT} {\bf native\-Formats}
+\end{CompactItemize}
+
+
+\subsection{Member Data Documentation}
+\index{RtAudio::RTAUDIO_DEVICE@{Rt\-Audio::RTAUDIO\_\-DEVICE}!name@{name}}
+\index{name@{name}!RtAudio::RTAUDIO_DEVICE@{Rt\-Audio::RTAUDIO\_\-DEVICE}}
+\subsubsection{\setlength{\rightskip}{0pt plus 5cm}char Rt\-Audio::RTAUDIO\_\-DEVICE::name}\label{structRtAudio_1_1RTAUDIO__DEVICE_m0}
+
+
+\index{RtAudio::RTAUDIO_DEVICE@{Rt\-Audio::RTAUDIO\_\-DEVICE}!id@{id}}
+\index{id@{id}!RtAudio::RTAUDIO_DEVICE@{Rt\-Audio::RTAUDIO\_\-DEVICE}}
+\subsubsection{\setlength{\rightskip}{0pt plus 5cm}DEVICE\_\-ID Rt\-Audio::RTAUDIO\_\-DEVICE::id}\label{structRtAudio_1_1RTAUDIO__DEVICE_m1}
+
+
+No value reported by {\bf get\-Device\-Info}() {\rm (p.\,\pageref{classRtAudio_a7})}. \index{RtAudio::RTAUDIO_DEVICE@{Rt\-Audio::RTAUDIO\_\-DEVICE}!probed@{probed}}
+\index{probed@{probed}!RtAudio::RTAUDIO_DEVICE@{Rt\-Audio::RTAUDIO\_\-DEVICE}}
+\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool Rt\-Audio::RTAUDIO\_\-DEVICE::probed}\label{structRtAudio_1_1RTAUDIO__DEVICE_m2}
+
+
+true if the device capabilities were successfully probed. \index{RtAudio::RTAUDIO_DEVICE@{Rt\-Audio::RTAUDIO\_\-DEVICE}!maxOutputChannels@{maxOutputChannels}}
+\index{maxOutputChannels@{maxOutputChannels}!RtAudio::RTAUDIO_DEVICE@{Rt\-Audio::RTAUDIO\_\-DEVICE}}
+\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int Rt\-Audio::RTAUDIO\_\-DEVICE::max\-Output\-Channels}\label{structRtAudio_1_1RTAUDIO__DEVICE_m3}
+
+
+\index{RtAudio::RTAUDIO_DEVICE@{Rt\-Audio::RTAUDIO\_\-DEVICE}!maxInputChannels@{maxInputChannels}}
+\index{maxInputChannels@{maxInputChannels}!RtAudio::RTAUDIO_DEVICE@{Rt\-Audio::RTAUDIO\_\-DEVICE}}
+\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int Rt\-Audio::RTAUDIO\_\-DEVICE::max\-Input\-Channels}\label{structRtAudio_1_1RTAUDIO__DEVICE_m4}
+
+
+\index{RtAudio::RTAUDIO_DEVICE@{Rt\-Audio::RTAUDIO\_\-DEVICE}!maxDuplexChannels@{maxDuplexChannels}}
+\index{maxDuplexChannels@{maxDuplexChannels}!RtAudio::RTAUDIO_DEVICE@{Rt\-Audio::RTAUDIO\_\-DEVICE}}
+\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int Rt\-Audio::RTAUDIO\_\-DEVICE::max\-Duplex\-Channels}\label{structRtAudio_1_1RTAUDIO__DEVICE_m5}
+
+
+\index{RtAudio::RTAUDIO_DEVICE@{Rt\-Audio::RTAUDIO\_\-DEVICE}!minOutputChannels@{minOutputChannels}}
+\index{minOutputChannels@{minOutputChannels}!RtAudio::RTAUDIO_DEVICE@{Rt\-Audio::RTAUDIO\_\-DEVICE}}
+\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int Rt\-Audio::RTAUDIO\_\-DEVICE::min\-Output\-Channels}\label{structRtAudio_1_1RTAUDIO__DEVICE_m6}
+
+
+\index{RtAudio::RTAUDIO_DEVICE@{Rt\-Audio::RTAUDIO\_\-DEVICE}!minInputChannels@{minInputChannels}}
+\index{minInputChannels@{minInputChannels}!RtAudio::RTAUDIO_DEVICE@{Rt\-Audio::RTAUDIO\_\-DEVICE}}
+\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int Rt\-Audio::RTAUDIO\_\-DEVICE::min\-Input\-Channels}\label{structRtAudio_1_1RTAUDIO__DEVICE_m7}
+
+
+\index{RtAudio::RTAUDIO_DEVICE@{Rt\-Audio::RTAUDIO\_\-DEVICE}!minDuplexChannels@{minDuplexChannels}}
+\index{minDuplexChannels@{minDuplexChannels}!RtAudio::RTAUDIO_DEVICE@{Rt\-Audio::RTAUDIO\_\-DEVICE}}
+\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int Rt\-Audio::RTAUDIO\_\-DEVICE::min\-Duplex\-Channels}\label{structRtAudio_1_1RTAUDIO__DEVICE_m8}
+
+
+\index{RtAudio::RTAUDIO_DEVICE@{Rt\-Audio::RTAUDIO\_\-DEVICE}!hasDuplexSupport@{hasDuplexSupport}}
+\index{hasDuplexSupport@{hasDuplexSupport}!RtAudio::RTAUDIO_DEVICE@{Rt\-Audio::RTAUDIO\_\-DEVICE}}
+\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool Rt\-Audio::RTAUDIO\_\-DEVICE::has\-Duplex\-Support}\label{structRtAudio_1_1RTAUDIO__DEVICE_m9}
+
+
+true if device supports duplex mode. \index{RtAudio::RTAUDIO_DEVICE@{Rt\-Audio::RTAUDIO\_\-DEVICE}!nSampleRates@{nSampleRates}}
+\index{nSampleRates@{nSampleRates}!RtAudio::RTAUDIO_DEVICE@{Rt\-Audio::RTAUDIO\_\-DEVICE}}
+\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int Rt\-Audio::RTAUDIO\_\-DEVICE::n\-Sample\-Rates}\label{structRtAudio_1_1RTAUDIO__DEVICE_m10}
+
+
+Number of discrete rates or -1 if range supported. \index{RtAudio::RTAUDIO_DEVICE@{Rt\-Audio::RTAUDIO\_\-DEVICE}!sampleRates@{sampleRates}}
+\index{sampleRates@{sampleRates}!RtAudio::RTAUDIO_DEVICE@{Rt\-Audio::RTAUDIO\_\-DEVICE}}
+\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int Rt\-Audio::RTAUDIO\_\-DEVICE::sample\-Rates}\label{structRtAudio_1_1RTAUDIO__DEVICE_m11}
+
+
+Supported rates or (min, max) if range. \index{RtAudio::RTAUDIO_DEVICE@{Rt\-Audio::RTAUDIO\_\-DEVICE}!nativeFormats@{nativeFormats}}
+\index{nativeFormats@{nativeFormats}!RtAudio::RTAUDIO_DEVICE@{Rt\-Audio::RTAUDIO\_\-DEVICE}}
+\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf RTAUDIO\_\-FORMAT} Rt\-Audio::RTAUDIO\_\-DEVICE::native\-Formats}\label{structRtAudio_1_1RTAUDIO__DEVICE_m12}
+
+
+Bit mask of supported data formats.
+
+The documentation for this struct was generated from the following file:\begin{CompactItemize}
+\item
+{\bf Rt\-Audio.h}\end{CompactItemize}
diff --git a/doc/latex/tutorial_8txt.tex b/doc/latex/tutorial_8txt.tex
new file mode 100644
index 0000000..5bedf13
--- /dev/null
+++ b/doc/latex/tutorial_8txt.tex
@@ -0,0 +1,2 @@
+\section{tutorial.txt File Reference}
+\label{tutorial_8txt}\index{tutorial.txt@{tutorial.txt}}