Home Information Classes Download Usage Mail List Requirements Tutorial
#include <RtWvIn.h>
Inheritance diagram for RtWvIn::
Public Methods | |
RtWvIn (int nChannels=1, MY_FLOAT sampleRate=Stk::sampleRate(), int device=0, int bufferFrames=RT_BUFFER_SIZE, int nBuffers=2) | |
Default constructor. More... | |
~RtWvIn () | |
Class destructor. | |
void | start (void) |
Start the audio input stream. More... | |
void | stop (void) |
Stop the audio input stream. More... | |
MY_FLOAT | lastOut (void) const |
Return the average across the last output sample frame. | |
MY_FLOAT | tick (void) |
Read out the average across one sample frame of data. More... | |
MY_FLOAT* | tick (MY_FLOAT *vector, unsigned int vectorSize) |
Read out vectorSize averaged sample frames of data in vector. More... | |
const MY_FLOAT* | lastFrame (void) const |
Return a pointer to the last output sample frame. | |
const MY_FLOAT* | tickFrame (void) |
Return a pointer to the next sample frame of data. More... | |
MY_FLOAT* | tickFrame (MY_FLOAT *frameVector, unsigned int frames) |
Read out sample frames of data to frameVector. More... |
This class provides a simplified interface to RtAudio for realtime audio input. It is a protected subclass of WvIn.
RtWvIn supports multi-channel data in interleaved format. It is important to distinguish the tick() methods, which return samples produced by averaging across sample frames, from the tickFrame() methods, which return pointers to multi-channel sample frames. For single-channel data, these methods return equivalent values.
by Perry R. Cook and Gary P. Scavone, 1995 - 2002.
|
Default constructor. The device argument is passed to RtAudio during instantiation. The default value (zero) will select the default device on your system or the first device found meeting the specified parameters. On systems with multiple soundcards/devices, values greater than zero can be specified in accordance with the order that the devices are enumerated by the underlying audio API. The default buffer size of RT_BUFFER_SIZE is defined in Stk.h. An StkError will be thrown if an error occurs duing instantiation. |
|
Start the audio input stream. The stream is started automatically, if necessary, when a tick() or tickFrame method is called. |
|
Stop the audio input stream. It may be necessary to use this method to avoid audio underflow problems if you wish to temporarily stop audio input. |
|
Read out the average across one sample frame of data. An StkError will be thrown if an error occurs during input. Reimplemented from WvIn. |
|
Read out vectorSize averaged sample frames of data in vector. An StkError will be thrown if an error occurs during input. Reimplemented from WvIn. |
|
Return a pointer to the next sample frame of data. An StkError will be thrown if an error occurs during input. Reimplemented from WvIn. |
|
Read out sample frames of data to frameVector. An StkError will be thrown if an error occurs during input. Reimplemented from WvIn. |
The Synthesis ToolKit in C++ (STK) |
©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |