Home Information Classes Download Usage Mail List Requirements Links Tutorial

# RtWvOut Class Reference

STK realtime audio output class. More...

`#include <RtWvOut.h>`

Inheritance diagram for RtWvOut:

List of all members.

## Public Member Functions

| RtWvOut (unsigned int nChannels=1, MY_FLOAT sampleRate=Stk::sampleRate(), int device=0, int bufferFrames=RT_BUFFER_SIZE, int nBuffers=4)
| Default constructor.
| ~RtWvOut ()
| Class destructor.
void | start (void)
| Start the audio output stream.
void | stop (void)
| Stop the audio output stream.
unsigned long | getFrames (void) const
| Return the number of sample frames output.
MY_FLOAT | getTime (void) const
| Return the number of seconds of data output.
void | tick (const MY_FLOAT sample)
| Output a single sample to all channels in a sample frame.
void | tick (const MY_FLOAT *vector, unsigned int vectorSize)
| Output each sample in vector to all channels in vectorSize sample frames.
void | tickFrame (const MY_FLOAT *frameVector, unsigned int frames=1)
| Output the frameVector of sample frames of the given length.

## Detailed Description

STK realtime audio output class.

This class provides a simplified interface to RtAudio for realtime audio output. It is a protected subclass of WvOut.

RtWvOut supports multi-channel data in interleaved format. It is important to distinguish the tick() methods, which output single samples to all channels in a sample frame, from the tickFrame() method, which takes a pointer to multi-channel sample frame data.

by Perry R. Cook and Gary P. Scavone, 1995 - 2002.

Definition at line 28 of file RtWvOut.h.

## Constructor & Destructor Documentation

RtWvOut::RtWvOut | ( | unsigned int | nChannels = 1,
|  | MY_FLOAT | sampleRate = Stk::sampleRate(),
|  | int | device = 0,
|  | int | bufferFrames = RT_BUFFER_SIZE,
|  | int | nBuffers = 4
| ) |

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.

## Member Function Documentation

void RtWvOut::start | ( | void |  | ) |

| Start the audio output stream. The stream is started automatically, if necessary, when a tick() or tickFrame method is called.

void RtWvOut::stop | ( | void |  | ) |

| Stop the audio output stream. It may be necessary to use this method to avoid undesireable audio buffer cycling if you wish to temporarily stop audio output.

void RtWvOut::tick | ( | const MY_FLOAT | sample | ) | `[virtual]`

| Output a single sample to all channels in a sample frame. An StkError will be thrown if an error occurs during output. Reimplemented from WvOut.

void RtWvOut::tick | ( | const MY_FLOAT * | vector,
|  | unsigned int | vectorSize
| ) | `[virtual]`

| Output each sample in vector to all channels in vectorSize sample frames. An StkError will be thrown if an error occurs during output. Reimplemented from WvOut.

void RtWvOut::tickFrame | ( | const MY_FLOAT * | frameVector,
|  | unsigned int | frames = 1
| ) | `[virtual]`

| Output the frameVector of sample frames of the given length. An StkError will be thrown if an error occurs during output. Reimplemented from WvOut.

The documentation for this class was generated from the following file:

- RtWvOut.h

The Synthesis ToolKit in C++ (STK)
©1995-2004 Perry R. Cook and Gary P. Scavone. All Rights Reserved.