The Synthesis ToolKit in C++ (STK)

Home Information Classes Download Usage Mail List Requirements Links FAQ Tutorial

RtWvOut.h
1#ifndef STK_RTWVOUT_H
2#define STK_RTWVOUT_H
3
4#include "WvOut.h"
5#include "RtAudio.h"
6#include "Mutex.h"
7
8namespace stk {
9
10/***************************************************/
28/***************************************************/
29
30 class RtWvOut : public WvOut
31{
32 public:
33
35
42 RtWvOut( unsigned int nChannels = 1, StkFloat sampleRate = Stk::sampleRate(),
43 int deviceIndex = 0, int bufferFrames = RT_BUFFER_SIZE, int nBuffers = 20 );
44
46 ~RtWvOut();
47
49
53 void start( void );
54
56
60 void stop( void );
61
63
66 void tick( const StkFloat sample );
67
69
76 void tick( const StkFrames& frames );
77
78 // This function is not intended for general use but must be
79 // public for access from the audio callback function.
80 int readBuffer( void *buffer, unsigned int frameCount );
81
82 protected:
83
84 RtAudio dac_;
85 Mutex mutex_;
86 bool stopped_;
87 unsigned int readIndex_;
88 unsigned int writeIndex_;
89 long framesFilled_;
90 unsigned int status_; // running = 0, emptying buffer = 1, finished = 2
91
92};
93
94} // stk namespace
95
96#endif
RtAudio.h
RtAudio
Realtime audio i/o C++ classes.
Definition RtAudio.h:268
stk::Mutex
STK mutex class.
Definition Mutex.h:37
stk::RtWvOut
STK realtime audio (blocking) output class.
Definition RtWvOut.h:31
stk::RtWvOut::tick
void tick(const StkFrames &frames)
Output the StkFrames data.
stk::RtWvOut::tick
void tick(const StkFloat sample)
Output a single sample to all channels in a sample frame.
stk::RtWvOut::start
void start(void)
Start the audio output stream.
stk::RtWvOut::stop
void stop(void)
Stop the audio output stream.
stk::RtWvOut::~RtWvOut
~RtWvOut()
Class destructor.
stk::RtWvOut::RtWvOut
RtWvOut(unsigned int nChannels=1, StkFloat sampleRate=Stk::sampleRate(), int deviceIndex=0, int bufferFrames=RT_BUFFER_SIZE, int nBuffers=20)
Default constructor.
stk::StkFrames
An STK class to handle vectorized audio data.
Definition Stk.h:279
stk::Stk::sampleRate
static StkFloat sampleRate(void)
Static method that returns the current STK sample rate.
Definition Stk.h:148
stk::WvOut
STK audio output abstract base class.
Definition WvOut.h:23
stk
The STK namespace.
Definition ADSR.h:6

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