The Synthesis ToolKit in C++ (STK)

Home Information Classes Download Usage Mail List Requirements Links FAQ Tutorial

# stk::RtWvOut Class Reference

STK realtime audio (blocking) output class. More...

`#include <RtWvOut.h>`

Inheritance diagram for stk::RtWvOut:

List of all members.

## Public Member Functions
| RtWvOut (unsigned int nChannels=1, StkFloat sampleRate=Stk::sampleRate(), int device=0, int bufferFrames=RT_BUFFER_SIZE, int nBuffers=20)
| Default constructor.
| ~RtWvOut ()
| Class destructor.
void | start (void)
| Start the audio output stream.
void | stop (void)
| Stop the audio output stream.
void | tick (const StkFloat sample)
| Output a single sample to all channels in a sample frame.
void | tick (const StkFrames &frames)
| Output the StkFrames data.

## Detailed Description

STK realtime audio (blocking) output class.

This class provides a simplified interface to RtAudio for realtime audio output. It is a subclass of WvOut. This class makes use of RtAudio's callback functionality by creating a large ring-buffer into which data is written. This class should not be used when low-latency is desired.

RtWvOut supports multi-channel data in interleaved format. It is important to distinguish the tick() method that outputs a single sample to all channels in a sample frame from the overloaded one that takes a reference to an StkFrames object for multi-channel and/or multi-frame data.

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

## Constructor & Destructor Documentation

stk::RtWvOut::RtWvOut | ( | unsigned int | nChannels = `1`,
|  | StkFloat | sampleRate = `Stk::sampleRate()`,
|  | int | device = `0`,
|  | int | bufferFrames = `RT_BUFFER_SIZE`,
|  | int | nBuffers = `20` |
| ) |  |  |

Default constructor.

The default device argument value (zero) will select the default output device on your system. The first device enumerated by the underlying audio API is specified with a value of one. 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 stk::RtWvOut::start | ( | void |  | ) |

Start the audio output stream.

The stream is started automatically, if necessary, when a tick() method is called.

void stk::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 stk::RtWvOut::tick | ( | const StkFloat | sample | ) | `[virtual]`

Output a single sample to all channels in a sample frame.

If the device is "stopped", it is "started".

Implements stk::WvOut.

void stk::RtWvOut::tick | ( | const StkFrames & | frames | ) | `[virtual]`

Output the StkFrames data.

If the device is "stopped", it is "started". The number of channels in the StkFrames argument must equal the number of channels specified during instantiation. However, this is only checked if _STK_DEBUG_ is defined during compilation, in which case an incompatibility will trigger an StkError exception.

Implements stk::WvOut.

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

- RtWvOut.h

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