Browse Source

Version 3.0.2

tags/3.0.2
Gary Scavone Stephen Sinclair 11 years ago
parent
commit
fdc3f15bec
24 changed files with 2476 additions and 704 deletions
  1. +1444
    -661
      RtAudio.cpp
  2. +107
    -9
      RtAudio.h
  3. +1
    -1
      RtError.h
  4. +0
    -1
      configure.ac
  5. +1
    -1
      doc/doxygen/footer.html
  6. +47
    -15
      doc/doxygen/tutorial.txt
  7. +15
    -1
      doc/release.txt
  8. +2
    -2
      install
  9. +2
    -2
      readme
  10. +0
    -0
      tests/Windows/rtaudiotest/Release/.placeholder
  11. +91
    -0
      tests/Windows/rtaudiotest/StdOpt.cpp
  12. +186
    -0
      tests/Windows/rtaudiotest/StdOpt.h
  13. +8
    -0
      tests/Windows/rtaudiotest/readme.txt
  14. +386
    -0
      tests/Windows/rtaudiotest/rtaudiotest.cpp
  15. +146
    -0
      tests/Windows/rtaudiotest/rtaudiotest.dsp
  16. +29
    -0
      tests/Windows/rtaudiotest/rtaudiotest.dsw
  17. +3
    -3
      tests/call_inout.cpp
  18. +2
    -2
      tests/call_saw.cpp
  19. +1
    -1
      tests/in_out.cpp
  20. +1
    -1
      tests/info.cpp
  21. +1
    -1
      tests/play_raw.cpp
  22. +1
    -1
      tests/play_saw.cpp
  23. +1
    -1
      tests/record_raw.cpp
  24. +1
    -1
      tests/twostreams.cpp

+ 1444
- 661
RtAudio.cpp
File diff suppressed because it is too large
View File


+ 107
- 9
RtAudio.h View File

@@ -9,8 +9,8 @@

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

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

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
@@ -37,7 +37,7 @@
*/
/************************************************************************/

// RtAudio: Version 3.0.1, 22 March 2004
// RtAudio: Version 3.0.2 (14 October 2005)

#ifndef __RTAUDIO_H
#define __RTAUDIO_H
@@ -127,17 +127,27 @@ class RtApi
{
public:

enum StreamState {
STREAM_STOPPED,
STREAM_RUNNING
};

RtApi();
virtual ~RtApi();
void openStream( int outputDevice, int outputChannels,
int inputDevice, int inputChannels,
RtAudioFormat format, int sampleRate,
int *bufferSize, int numberOfBuffers );
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();
RtApi::StreamState getStreamState() const;
virtual void tickStream() = 0;
virtual void closeStream();
virtual void startStream() = 0;
@@ -158,9 +168,13 @@ protected:
UNINITIALIZED = -75
};

enum StreamState {
STREAM_STOPPED,
STREAM_RUNNING
// A protected structure used for buffer conversion.
struct ConvertInfo {
int channels;
int inJump, outJump;
RtAudioFormat inFormat, outFormat;
std::vector<int> inOffset;
std::vector<int> outOffset;
};

// A protected structure for audio streams.
@@ -183,10 +197,10 @@ protected:
RtAudioFormat deviceFormat[2]; // Playback and record, respectively.
StreamMutex mutex;
CallbackInfo callbackInfo;
ConvertInfo convertInfo[2];

RtApiStream()
:apiHandle(0), userBuffer(0), deviceBuffer(0) {}
// mode(UNINITIALIZED), state(STREAM_STOPPED),
};

// A protected device structure for audio devices.
@@ -217,7 +231,7 @@ protected:
typedef float Float32;
typedef double Float64;

char message_[256];
char message_[1024];
int nDevices_;
std::vector<RtApiDevice> devices_;
RtApiStream stream_;
@@ -281,7 +295,7 @@ protected:
Protected method used to perform format, channel number, and/or interleaving
conversions between the user and device buffers.
*/
void convertStreamBuffer( StreamMode mode );
void convertBuffer( char *outBuffer, char *inBuffer, ConvertInfo &info );

//! Protected common method used to perform byte-swapping on buffers.
void byteSwapBuffer( char *buffer, int samples, RtAudioFormat format );
@@ -350,6 +364,20 @@ public:
RtAudioFormat format, int sampleRate,
int *bufferSize, int numberOfBuffers, RtAudioApi api=UNSPECIFIED );

//! An overloaded constructor which opens a stream and also returns \c numberOfBuffers parameter via pointer argument.
/*!
See the previous constructor call for details. This overloaded
version differs only in that it takes a pointer argument for the
\c numberOfBuffers parameter and returns the value used by the
audio device (which may be different from that requested). Note
that the \c numberofBuffers parameter is not used with the Linux
Jack, Macintosh CoreAudio, and Windows ASIO APIs.
*/
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
@@ -389,6 +417,20 @@ public:
RtAudioFormat format, int sampleRate,
int *bufferSize, int numberOfBuffers );

//! A public method for opening a stream and also returning \c numberOfBuffers parameter via pointer argument.
/*!
See the previous function call for details. This overloaded
version differs only in that it takes a pointer argument for the
\c numberOfBuffers parameter and returns the value used by the
audio device (which may be different from that requested). Note
that the \c numberofBuffers parameter is not used with the Linux
Jack, Macintosh CoreAudio, and Windows ASIO APIs.
*/
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
@@ -634,6 +676,53 @@ public:
void setStreamCallback( RtAudioCallback callback, void *userData );
void cancelStreamCallback();

public:
// \brief Internal structure that provide debug information on the state of a running DSound device.
struct RtDsStatistics {
// \brief Sample Rate.
long sampleRate;
// \brief The size of one sample * number of channels on the input device.
int inputFrameSize;
// \brief The size of one sample * number of channels on the output device.
int outputFrameSize;
/* \brief The number of times the read pointer had to be adjusted to avoid reading from an unsafe buffer position.
*
* This field is only used when running in DUPLEX mode. INPUT mode devices just wait until the data is
* available.
*/
int numberOfReadOverruns;
// \brief The number of times the write pointer had to be adjusted to avoid writing in an unsafe buffer position.
int numberOfWriteUnderruns;
// \brief Number of bytes by attribute to buffer configuration by which writing must lead the current write pointer.
int writeDeviceBufferLeadBytes;
// \brief Number of bytes by attributable to the device driver by which writing must lead the current write pointer on this output device.
unsigned long writeDeviceSafeLeadBytes;
// \brief Number of bytes by which reading must trail the current read pointer on this input device.
unsigned long readDeviceSafeLeadBytes;
/* \brief Estimated latency in seconds.
*
* For INPUT mode devices, based the latency of the device's safe read pointer, plus one buffer's
* worth of additional latency.
*
* For OUTPUT mode devices, the latency of the device's safe write pointer, plus N buffers of
* additional buffer latency.
*
* For DUPLEX devices, the sum of latencies for both input and output devices. DUPLEX devices
* also back off the read pointers an additional amount in order to maintain synchronization
* between out-of-phase read and write pointers. This time is also included.
*
* Note that most software packages report latency between the safe write pointer
* and the software lead pointer, excluding the hardware device's safe write pointer
* latency. Figures of 1 or 2ms of latency on Windows audio devices are invariably of this type.
* The reality is that hardware devices often have latencies of 30ms or more (often much
* higher for duplex operation).
*/

double latency;
};
// \brief Report on the current state of a running DSound device.
static RtDsStatistics getDsStatistics();

private:

void initialize(void);
@@ -641,6 +730,12 @@ public:
bool probeDeviceOpen( int device, StreamMode mode, int channels,
int sampleRate, RtAudioFormat format,
int *bufferSize, int numberOfBuffers );

bool coInitialized;
bool buffersRolling;
long duplexPrerollBytes;
static RtDsStatistics statistics;

};

#endif
@@ -674,6 +769,9 @@ public:
bool probeDeviceOpen( int device, StreamMode mode, int channels,
int sampleRate, RtAudioFormat format,
int *bufferSize, int numberOfBuffers );

bool coInitialized;

};

#endif


+ 1
- 1
RtError.h View File

@@ -39,7 +39,7 @@ protected:

public:
//! The constructor.
RtError(const std::string& message, Type type = RtError::UNSPECIFIED) : message_(message), type_(type){}
RtError(const std::string& message, Type type = RtError::UNSPECIFIED) : message_(message), type_(type) {}

//! The destructor.
virtual ~RtError(void) {};


+ 0
- 1
configure.ac View File

@@ -80,7 +80,6 @@ case $host in
[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!) )
;;

*)


+ 1
- 1
doc/doxygen/footer.html View File

@@ -1,7 +1,7 @@
<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>
<td>&copy;2001-2005 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>



+ 47
- 15
doc/doxygen/tutorial.txt View File

@@ -1,8 +1,6 @@
/*! \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>
<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 wishlist &nbsp;&nbsp; \ref acknowledge &nbsp;&nbsp; \ref license</CENTER>

\section intro Introduction

@@ -38,7 +36,7 @@ The RtError class declaration and definition have been extracted to a separate f

\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>
Latest Release (14 October 2005): <A href="http://music.mcgill.ca/~gary/rtaudio/release/rtaudio-3.0.2.tar.gz">Version 3.0.2</A>

\section start Getting Started

@@ -52,7 +50,7 @@ The first thing that must be done when using RtAudio is to create an instance of

int main()
{
RtAudio *audio;
RtAudio *audio = 0;

// Default RtAudio constructor
try {
@@ -89,7 +87,7 @@ A programmer may wish to query the available audio device capabilities before de

int main()
{
RtAudio *audio;
RtAudio *audio = 0;

// Default RtAudio constructor
try {
@@ -176,7 +174,7 @@ int main()
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;
RtAudio *audio = 0;

// Instantiate RtAudio and open a stream within a try/catch block
try {
@@ -230,7 +228,7 @@ int main()
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;
RtAudio *audio = 0;

// Open a stream during RtAudio instantiation
try {
@@ -333,7 +331,7 @@ int main()
int device = 0; // 0 indicates the default or first available device
double data[2];
char input;
RtAudio *audio;
RtAudio *audio = 0;

// Open a stream during RtAudio instantiation
try {
@@ -401,7 +399,7 @@ int main()
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;
RtAudio *audio = 0;

// Instantiate RtAudio and open a stream.
try {
@@ -496,7 +494,7 @@ int main()
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;
RtAudio *audio = 0;

// Open a stream during RtAudio instantiation
try {
@@ -683,17 +681,51 @@ The Steinberg ASIO audio API is based on a callback scheme. In addition, the AP

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 wishlist Possible Future Changes

\section acknowledge Acknowledgements
There are a few issues that still need to be addressed in future versions of RtAudio, including:

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.
<ul>
<li>Provide a mechanism so the user can "pre-fill" audio output buffers to allow precise measurement of an acoustic response;</li>
<li>Allow the user to read / write non-interleaved data to / from the audio buffer;</li>
<li>Further support in Windows OS for multi-channel (>2) input / output. This is currently only possible with ASIO interface (in large part due to limitations with the DirectSound API). But perhaps a port to the WinMM API should be investigated?</li>
<li>Investigate the possibility of allowing the user to select specific channels of a soundcard. For example, if an audio device supports 8 channels and the user wishes to send data out channels 7-8 only, it is currently necessary to open all 8 channels and write the two channels of output data to the correct positions in each audio frame of an interleaved data buffer.</li>
</ul>

\section acknowledge Acknowledgements

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).
Thanks to Robin Davies for a number of bug fixes and improvements to
the DirectSound and ASIO implementations in the 3.0.2 release!

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
Copyright (c) 2001-2005 Gary P. Scavone

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files


+ 15
- 1
doc/release.txt View File

@@ -1,6 +1,20 @@
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.
By Gary P. Scavone, 2001-2005.

v3.0.2: (14 October 2005)
- modification of ALSA read/write order to fix duplex under/overruns
- added synchronization of input/output devices for ALSA duplex operation
- cleaned up and improved error reporting throughout
- bug fix in Windows DirectSound support for 8-bit audio
- bug fix in Windows DirectSound support during device capture query
- added ASIOOutputReady() call near end of callbackEvent to fix some driver behavior
- added #include <stdio.h> to RtAudio.cpp
- fixed bug in RtApiCore for duplex operation with different I/O devices
- improvements to DirectX pointer chasing (by Robin Davies)
- backdoor RtDsStatistics hook provides DirectX performance information (by Robin Davies)
- bug fix for non-power-of-two Asio granularity used by Edirol PCR-A30 (by Robin Davies)
- auto-call CoInitialize for DSOUND and ASIO platforms (by Robin Davies)

v3.0.1: (22 March 2004)
- bug fix in Windows DirectSound support for cards with output only


+ 2
- 2
install View File

@@ -1,6 +1,6 @@
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.
By Gary P. Scavone, 2001-2005.

To configure and compile (on Unix systems):

@@ -18,7 +18,7 @@ A few options can be passed to configure, including:
--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.
Typing "./configure --help" will display all the available options. Note that you can provide more than one "--with-" flag to the configure script to enable multiple API support.

If you wish to use a different compiler than that selected by configure, specify that compiler in the command line (ex. to use CC):



+ 2
- 2
readme View File

@@ -1,6 +1,6 @@
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.
By Gary P. Scavone, 2001-2005.

This distribution of RtAudio contains the following:

@@ -38,7 +38,7 @@ 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
Copyright (c) 2001-2005 Gary P. Scavone

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files


+ 0
- 0
tests/Windows/rtaudiotest/Release/.placeholder View File


+ 91
- 0
tests/Windows/rtaudiotest/StdOpt.cpp View File

@@ -0,0 +1,91 @@
/************************************************************************/
/*! \class CommandLine
\brief Command-line option parser.
Copyright (c) 2005 Robin Davies.
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.
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.
*/
/************************************************************************/
#include ".\stdopt.h"
using namespace stdopt;
CommandLine::CommandLine()
{
}
void CommandLine::ProcessCommandLine(int argc, char**argv)
{
std::vector<std::string> cmdline;
for (int i = 0; i < argc; ++i) {
cmdline.push_back(argv[i]);
}
ProcessCommandLine(cmdline);
}
const CommandLine::COptionHandlerBase*CommandLine::GetOptionHandler(const std::string &name) const
{
// Return excact matches only.
for (size_t i = 0; i < optionHandlers.size(); ++i)
{
if (optionHandlers[i]->getName() == name) {
return (optionHandlers[i]);
}
}
return NULL;
}
void CommandLine::ProcessCommandLine(const std::vector<std::string>& cmdline)
{
for (size_t i = 1; i < cmdline.size(); ++i)
{
if (cmdline[i].length() != 0 && cmdline[i][0] == L'/' || (cmdline[i][0] == '-')) {
std::string arg = cmdline[i].substr(1);
const COptionHandlerBase *pHandler = GetOptionHandler(arg);
if (pHandler == NULL) {
throw CommandLineException(std::string("Unknown option: ") + arg);
}
if (pHandler->HasArgument())
{
std::string strArg;
if (i+1 < cmdline.size()) {
++i;
strArg = cmdline[i];
}
pHandler->Process(strArg.c_str());
} else {
pHandler->Process(NULL);
}
} else {
args.push_back(cmdline[i]);
}
}
}
CommandLine::~CommandLine(void)
{
for (size_t i = 0; i < optionHandlers.size(); ++i)
{
delete optionHandlers[i];
}
optionHandlers.resize(0);
}

+ 186
- 0
tests/Windows/rtaudiotest/StdOpt.h View File

@@ -0,0 +1,186 @@
/************************************************************************/
/*! \class CommandLine
\brief Command-line opition parser.
Copyright (c) 2005 Robin Davies.
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.
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.
*/
/************************************************************************/
#ifndef STDOPT_H
#define STDOPT_H
#include <vector>
#include <string>
#include <sstream>
#include <exception>
namespace stdopt
{
class CommandLineException: public std::exception {
public:
CommandLineException(const std::string &error)
{
s = error;
}
const char*what() { return s.c_str(); }
private:
std::string s;
};
class CommandLine
{
public:
CommandLine();
virtual ~CommandLine();
void ProcessCommandLine(int argc, char**argv);
void ProcessCommandLine(const std::vector<std::string>& cmdline);
template <class TVAL> void AddOption(const char*name,TVAL*pResult, TVAL defaultValue)
{
this->optionHandlers.push_back(new COptionHandler<TVAL>(name,pResult));
*pResult = defaultValue;
}
template <class TVAL> void AddOption(const char*name,TVAL*pResult)
{
this->optionHandlers.push_back(new COptionHandler<TVAL>(name,pResult));
}
const std::vector<std::string> &GetArguments() { return args; }
template <class T> void GetArgument(size_t arg, T*pVal)
{
if (arg >= args.size()) {
std::stringstream os;
os << "Argument " << (arg+1) << " not provided.";
throw CommandLineException(os.str());
}
std::stringstream is(args[arg]);
T value;
is >> value;
if (!is.fail() && is.eof())
{
*pVal = value;
} else {
std::stringstream os;
os << "Argument " << (arg+1) << " was not in the correct format.";
throw CommandLineException(os.str());
}
}
void GetArgument(size_t arg, std::string*pVal)
{
if (arg >= args.size()) {
std::stringstream os;
os << "Argument " << (arg+1) << " not provided.";
throw CommandLineException(os.str());
}
*pVal = args[arg];
}
private:
class COptionHandlerBase {
public:
COptionHandlerBase(const std::string & name) { this->name = name;}
virtual ~COptionHandlerBase() { };
const std::string &getName() const { return name; }
virtual bool HasArgument()const = 0;
virtual void Process(const char* value) const = 0;
private:
std::string name;
};
template <class T> class COptionHandler: public COptionHandlerBase {
public:
COptionHandler(const std::string &name,T *result, T defaultValue = T())
: COptionHandlerBase(name)
{
_pResult = result;
*_pResult = defaultValue;
}
virtual bool HasArgument() const;
virtual void Process(const char *strValue) const {
std::stringstream is(strValue);
T value;
is >> value;
if (!is.fail() && is.eof())
{
*_pResult = value;
} else {
std::stringstream os;
os << "Invalid value provided for option '" << getName() << "'.";
throw CommandLineException(os.str().c_str());
}
}
private:
std::string strName;
T*_pResult;
};
const CommandLine::COptionHandlerBase*GetOptionHandler(const std::string &name) const;
std::vector<std::string > args;
std::vector<COptionHandlerBase*> optionHandlers;
};
// Argument specializations for bool.
template <class T> bool CommandLine::COptionHandler<T>::HasArgument()const {
return true;
};
inline bool CommandLine::COptionHandler<bool>::HasArgument() const {
return false;
}
inline void CommandLine::COptionHandler<bool>::Process(const char*strValue) const {
if (strValue == NULL)
{
*_pResult = true;
return;
}
switch (*strValue)
{
case '\0':
case '+':
*_pResult = true;
break;
case '-':
*_pResult = false;
break;
default:
throw CommandLineException("Please specify '+' or '-' for boolean options.");
}
}
// specializations for std::string.
inline void CommandLine::COptionHandler<std::string >::Process(const char*strValue)const {
*_pResult = strValue;
}
// specializations for std::vector<std::string>
inline void CommandLine::COptionHandler<std::vector<std::string> >::Process(const char*strValue)const {
_pResult->push_back(strValue);
}
};
#endif

+ 8
- 0
tests/Windows/rtaudiotest/readme.txt View File

@@ -0,0 +1,8 @@
rtaudiotest - Test rtaudio devices.
rtaudiotest is a small tool that allows easy testing of rtaudio devices
and configurations.
Run rtaudiotest.exe for a description of how to run it.
rtaudiotest is currently only supported for the Windows platform.

+ 386
- 0
tests/Windows/rtaudiotest/rtaudiotest.cpp View File

@@ -0,0 +1,386 @@
/************************************************************************/
/*! \brief Interactively Test RtAudio parameters.
RtAudio is a command-line utility that allows users to enumerate
installed devices, and to test input, output and duplex operation
of RtAudio devices with various buffer and buffer-size
configurations.
Copyright (c) 2005 Robin Davies.
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.
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.
*/
/************************************************************************/
#include "RtAudio.h"
#include "FileWvOut.h"
#include <cmath>
#include <iostream>
#include <stdopt.h>
using namespace std;
using namespace stdopt;
#ifdef _WIN32
// Correct windows.h standards violation.
#undef min
#undef max
#endif
#define DSOUND 1
RtAudio::RtAudioApi rtApi = RtAudio::WINDOWS_DS;
void DisplayHelp(std::ostream &os)
{
os
<< "rtaudiotest - Test rtaudio devices." << endl
<< endl
<< "Syntax:" << endl
<< " rtaudiotest [options]* enum" << endl
<< " - Display installed devices." << endl
<< " rtaudiotest [options]* inputtest <devicenum> [<filename>]" << endl
<< " - Capture audio to a .wav file." << endl
<< " rtaudiotest [options]* outputtest <devicenum>" << endl
<< " - Generate a test signal on the device.." << endl
<< " rtaudiotest [options]* duplextest <inputDevicenum> <outputdevicenum>" << endl
<< " - Echo input to output." << endl
<< "Options:" << endl
<< " -h -? Display this message." << endl
<< " -dsound Use DirectX drivers." << endl
<< " -asio Use ASIO drivers." << endl
<< " -buffers N Use N buffers." << endl
<< " -size N Use buffers of size N." << endl
<< " -srate N Use a sample-rate of N (defaults to 44100)." << endl
<< " -channels N Use N channels (defaults to 2)." << endl
<< " -seconds N Run the test for N seconds (default 5)." << endl
<< "Description: " << endl
<< " RtAudio is a command-line utility that allows users to enumerate " << endl
<< " installed devices, and to test input, output and duplex operation " << endl
<< " of RtAudio devices with various buffer and buffer-size " << endl
<< " configurations." << endl
<< "Examples:" << endl
<< " rtaudio -asio enum" << endl
<< " rtaudio -dsound -buffers 4 -size 128 -seconds 3 inputtest 0 test.wav" << endl
;
}
void EnumerateDevices(RtAudio::RtAudioApi api)
{
RtAudio rt(api);
for (int i = 1; i <= rt.getDeviceCount(); ++i)
{
RtAudioDeviceInfo info = rt.getDeviceInfo(i);
cout << "Device " << i << ": " << info.name << endl;
}
}
struct TestConfiguration
{
long srate;
int channels;
int bufferSize;
int buffers;
int seconds;
};
bool DisplayStats(RtAudio::RtAudioApi api)
{
#ifdef __WINDOWS_DS__
// Display latency results for Windows DSound drivers.
if (api == RtAudio::WINDOWS_DS)
{
RtApiDs::RtDsStatistics s = RtApiDs::getDsStatistics();
cout << " Latency: " << s.latency*1000.0 << "ms" << endl;
if (s.inputFrameSize)
{
cout << " Read overruns: " << s.numberOfReadOverruns << endl;
}
if (s.outputFrameSize)
{
cout << " Write underruns: " << s.numberOfWriteUnderruns << endl;
}
if (s.inputFrameSize)
{
cout << " Read lead time in sample frames (device): " << s.readDeviceSafeLeadBytes/ s.inputFrameSize << endl;
}
if (s.outputFrameSize)
{
cout << " Write lead time in sample frames (device): " << s.writeDeviceSafeLeadBytes / s.outputFrameSize << endl;
cout << " Write lead time in sample frames (buffer): " << s.writeDeviceBufferLeadBytes / s.outputFrameSize << endl;
}
}
#endif
return true;
}
void InputTest( RtAudio::RtAudioApi api,
int inputDevice,
const std::string &fileName,
TestConfiguration &configuration )
{
RtAudio rt(api);
int bufferSize = configuration.bufferSize;
RtAudioDeviceInfo info = rt.getDeviceInfo(inputDevice);
cout << "Reading from device " << inputDevice << " (" << info.name << ")\n";
rt.openStream(0,0,inputDevice,configuration.channels, RTAUDIO_SINT16, configuration.srate,&bufferSize,configuration.buffers);
if (bufferSize != configuration.bufferSize)
{
cout << "The buffer size was changed to " << bufferSize << " by the device." << endl;
configuration.bufferSize = bufferSize;
}
int nTicks = (int)ceil((configuration.srate* configuration.seconds)*1.0/configuration.bufferSize);
if (fileName.length() == 0)
{
// just run the stream.
rt.startStream();
for (int i = 0; i < nTicks; ++i)
{
rt.tickStream();
}
rt.stopStream();
} else
{
if (configuration.seconds > 10) {
throw CommandLineException("Capture of more than 10 seconds of data is not supported.");
}
std::vector<short> data;
// we could be smarter, but the point here is to capture data without interfering with the stream.
// File writes while ticking the stream is not cool.
data.resize(nTicks*configuration.bufferSize*configuration.channels); // potentially very big. That's why we restrict capture to 10 seconds.
short *pData = &data[0];
rt.startStream();
int i;
for (i = 0; i < nTicks; ++i)
{
rt.tickStream();
short *streamBuffer = (short*)rt.getStreamBuffer();
for (int samples = 0; samples < configuration.bufferSize; ++samples)
{
for (int channel = 0; channel < configuration.channels; ++channel)
{
*pData ++ = *streamBuffer++;
}
}
}
rt.stopStream();
remove(fileName.c_str());
FileWvOut wvOut;
wvOut.openFile( fileName.c_str(), configuration.channels, FileWrite::FILE_WAV );
StkFrames frame(1,configuration.channels,false);
pData = &data[0];
for (i = 0; i < nTicks; ++i) {
for (int samples = 0; samples < configuration.bufferSize; ++samples) {
for (int channel = 0; channel < configuration.channels; ++channel) {
frame[channel] = (float)( *pData++*( 1.0 / 32768.0 ) );
}
wvOut.tickFrame(frame);
}
}
wvOut.closeFile();
}
rt.closeStream();
if (DisplayStats(api)) {
cout << "Test succeeded." << endl;
}
}
void OutputTest( RtAudio::RtAudioApi api,
int outputDevice,
TestConfiguration &configuration )
{
RtAudio rt(api);
int bufferSize = configuration.bufferSize;
RtAudioDeviceInfo info = rt.getDeviceInfo(outputDevice);
cout << "Writing to " << info.name << "...\n";
rt.openStream(outputDevice,configuration.channels, 0,0, RTAUDIO_SINT16, configuration.srate,&bufferSize,configuration.buffers);
if (bufferSize != configuration.bufferSize) {
cout << "The buffer size was changed to " << bufferSize << " by the device." << endl;
configuration.bufferSize = bufferSize;
}
rt.startStream();
short *pBuffer = (short*)rt.getStreamBuffer();
int nTicks = (int)ceil((configuration.srate* configuration.seconds)*1.0/configuration.bufferSize);
double phase = 0;
double deltaPhase = 880.0/configuration.srate;
for (int i = 0; i < nTicks; ++i) {
short *p = pBuffer;
for (int samp = 0; samp < configuration.bufferSize; ++samp) {
short val = (short)(sin(phase)*(32768/4)); // sin()*0.25 magnitude. Audible, but not damaging to ears or speakers.
phase += deltaPhase;
for (int chan = 0; chan < configuration.channels; ++chan) {
*p++ = val;
}
}
rt.tickStream();
}
rt.stopStream();
rt.closeStream();
if ( DisplayStats(api) ) {
cout << "Test succeeded." << endl;
}
}
void DuplexTest( RtAudio::RtAudioApi api,
int inputDevice,
int outputDevice,
TestConfiguration &configuration )
{
RtAudio rt(api);
int bufferSize = configuration.bufferSize;
RtAudioDeviceInfo info = rt.getDeviceInfo(inputDevice);
cout << "Reading from " << info.name << ", " << endl;
info = rt.getDeviceInfo(outputDevice);
cout << "Writing to " << info.name << "..." << endl;
rt.openStream(outputDevice,configuration.channels, inputDevice,configuration.channels, RTAUDIO_SINT16, configuration.srate,&bufferSize,configuration.buffers);
if (bufferSize != configuration.bufferSize)
{
cout << "The buffer size was changed to " << bufferSize << " by the device." << endl;
configuration.bufferSize = bufferSize;
}
rt.startStream();
short *pBuffer = (short*)rt.getStreamBuffer();
int nTicks = (int)ceil((configuration.srate* configuration.seconds)*1.0/configuration.bufferSize);
for (int i = 0; i < nTicks; ++i) {
rt.tickStream();
}
rt.stopStream();
rt.closeStream();
if ( DisplayStats(api) ) {
cout << "Test succeeded." << endl;
}
}
int main(int argc, char **argv)
{
try
{
CommandLine commandLine;
TestConfiguration configuration;
bool displayHelp;
bool useDsound;
bool useAsio;
commandLine.AddOption("h",&displayHelp);
commandLine.AddOption("?",&displayHelp);
commandLine.AddOption("dsound",&useDsound);
commandLine.AddOption("asio",&useAsio);
commandLine.AddOption("srate",&configuration.srate,44100L);
commandLine.AddOption("channels",&configuration.channels,2);
commandLine.AddOption("seconds",&configuration.seconds,5);
commandLine.AddOption("buffers",&configuration.buffers,2);
commandLine.AddOption("size",&configuration.bufferSize,128);
commandLine.ProcessCommandLine(argc,argv);
if (displayHelp || commandLine.GetArguments().size() == 0)
{
DisplayHelp(cout);
return 0;
}
if (useDsound)
{
rtApi = RtAudio::WINDOWS_DS;
} else if (useAsio)
{
rtApi = RtAudio::WINDOWS_ASIO;
} else {
throw CommandLineException("Please specify an API to use: '-dsound', or '-asio'");
}
std::string testName;
commandLine.GetArgument(0,&testName);
if (testName == "enum")
{
EnumerateDevices(rtApi);
} else if (testName == "inputtest")
{
int inputDevice;
std::string fileName;
commandLine.GetArgument(1,&inputDevice);
if (commandLine.GetArguments().size() >= 2)
{
commandLine.GetArgument(2,&fileName);
}
InputTest(rtApi,inputDevice,fileName,configuration);
} else if (testName == "outputtest")
{
int inputDevice;
commandLine.GetArgument(1,&inputDevice);
OutputTest(rtApi,inputDevice,configuration);
} else if (testName == "duplextest")
{
int inputDevice;
int outputDevice;
commandLine.GetArgument(1,&inputDevice);
commandLine.GetArgument(2,&outputDevice);
DuplexTest(rtApi,inputDevice,outputDevice,configuration);
} else {
throw CommandLineException("Not a valid test name.");
}
} catch (CommandLineException &e)
{
cerr << e.what() << endl << endl;
cerr << "Run 'rtaudiotest -h' to see the commandline syntax." << endl;
return 3;
} catch (RtError &e)
{
cerr << e.getMessage() << endl;
return 3;
} catch (std::exception &e)
{
cerr << "Error: " << e.what() << endl;
return 3;
}
return 0;
}

+ 146
- 0
tests/Windows/rtaudiotest/rtaudiotest.dsp View File

@@ -0,0 +1,146 @@
# Microsoft Developer Studio Project File - Name="rtaudiotest" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=rtaudiotest - 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 "rtaudiotest.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 "rtaudiotest.mak" CFG="rtaudiotest - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "rtaudiotest - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "rtaudiotest - 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)" == "rtaudiotest - 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 "Release"
# 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 /Zi /O2 /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_DS__" /D "__WINDOWS_ASIO__" /D "__LITTLE_ENDIAN__" /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 winmm.lib /nologo /subsystem:console /debug /machine:I386
!ELSEIF "$(CFG)" == "rtaudiotest - 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 "Debug"
# 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 "..\..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_DS__" /D "__WINDOWS_ASIO__" /D "__LITTLE_ENDIAN__" /FR /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 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 /debug /machine:I386 /pdbtype:sept
!ENDIF
# Begin Target
# Name "rtaudiotest - Win32 Release"
# Name "rtaudiotest - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=..\..\src\asio\asio.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\asio\asiodrivers.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\asio\asiolist.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\RtAudio.cpp
# End Source File
# Begin Source File
SOURCE=.\rtaudiotest.cpp
# End Source File
# Begin Source File
SOURCE=.\StdOpt.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\Stk.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\WvOut.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=..\..\include\RtAudio.h
# End Source File
# Begin Source File
SOURCE=.\StdOpt.h
# End Source File
# Begin Source File
SOURCE=..\..\include\Stk.h
# End Source File
# Begin Source File
SOURCE=..\..\include\WvOut.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

+ 29
- 0
tests/Windows/rtaudiotest/rtaudiotest.dsw View File

@@ -0,0 +1,29 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "rtaudiotest"=".\rtaudiotest.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################

+ 3
- 3
tests/call_inout.cpp View File

@@ -53,7 +53,7 @@ int inout(char *buffer, int buffer_size, void *)
int main(int argc, char *argv[])
{
int chans, fs, device = 0;
RtAudio *audio;
RtAudio *audio = 0;
char input;

// minimal command-line checking
@@ -67,8 +67,8 @@ int main(int argc, char *argv[])
// Open the realtime output device
int buffer_size = 512;
try {
audio = new RtAudio(device, chans, device, chans,
FORMAT, fs, &buffer_size, 8);
audio = new RtAudio( device, chans, device, chans,
FORMAT, fs, &buffer_size, 8 );
}
catch (RtError &error) {
error.printMessage();


+ 2
- 2
tests/call_saw.cpp View File

@@ -76,8 +76,8 @@ int saw(char *buffer, int buffer_size, void *data)
int main(int argc, char *argv[])
{
int buffer_size, fs, device = 0;
RtAudio *audio;
double *data;
RtAudio *audio = 0;
double *data = 0;
char input;

// minimal command-line checking


+ 1
- 1
tests/in_out.cpp View File

@@ -51,7 +51,7 @@ int main(int argc, char *argv[])
int chans, fs, buffer_size, device = 0;
long frames, counter = 0;
MY_TYPE *buffer;
RtAudio *audio;
RtAudio *audio = 0;

// minimal command-line checking
if (argc != 3 && argc != 4 ) usage();


+ 1
- 1
tests/info.cpp View File

@@ -12,7 +12,7 @@

int main(int argc, char *argv[])
{
RtAudio *audio;
RtAudio *audio = 0;
RtAudioDeviceInfo info;
try {
audio = new RtAudio();


+ 1
- 1
tests/play_raw.cpp View File

@@ -60,7 +60,7 @@ int main(int argc, char *argv[])
MY_TYPE *buffer;
char *file;
FILE *fd;
RtAudio *audio;
RtAudio *audio = 0;

// minimal command-line checking
if (argc != 4 && argc != 5 ) usage();


+ 1
- 1
tests/play_saw.cpp View File

@@ -58,7 +58,7 @@ int main(int argc, char *argv[])
int chans, fs, buffer_size, device = 0;
long frames, counter = 0, i, j;
MY_TYPE *buffer;
RtAudio *audio;
RtAudio *audio = 0;
double *data = 0;

// minimal command-line checking


+ 1
- 1
tests/record_raw.cpp View File

@@ -54,7 +54,7 @@ int main(int argc, char *argv[])
long frames, counter = 0;
MY_TYPE *buffer;
FILE *fd;
RtAudio *audio;
RtAudio *audio = 0;

// minimal command-line checking
if (argc != 3 && argc != 4 ) usage();


+ 1
- 1
tests/twostreams.cpp View File

@@ -62,7 +62,7 @@ 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;
RtAudio *stream1 = 0, *stream2 = 0;
FILE *fd;
double *data = 0;



Loading…
Cancel
Save