Arduino STK  4.6.2
FileWvOut.h
1 #ifndef STK_FILEWVOUT_H
2 #define STK_FILEWVOUT_H
3 
4 #include "WvOut.h"
5 #include "FileWrite.h"
6 
7 namespace stk {
8 
9 /***************************************************/
30 /***************************************************/
31 
32 class FileWvOut : public WvOut
33 {
34  public:
35 
37 
41  FileWvOut( unsigned int bufferFrames = 1024 );
42 
44 
47  FileWvOut( std::string fileName,
48  unsigned int nChannels = 1,
49  FileWrite::FILE_TYPE type = FileWrite::FILE_WAV,
50  Stk::StkFormat format = STK_SINT16,
51  unsigned int bufferFrames = 1024 );
52 
54  virtual ~FileWvOut();
55 
57 
62  void openFile( std::string fileName,
63  unsigned int nChannels,
64  FileWrite::FILE_TYPE type,
65  Stk::StkFormat format );
66 
68 
72  void closeFile( void );
73 
75 
78  void tick( const StkFloat sample );
79 
81 
87  void tick( const StkFrames& frames );
88 
89  protected:
90 
91  void incrementFrame( void );
92 
93  FileWrite file_;
94  unsigned int bufferFrames_;
95  unsigned int bufferIndex_;
96  unsigned int iData_;
97 
98 };
99 
100 } // stk namespace
101 
102 #endif
STK audio file output class.
Definition: FileWrite.h:32
static const FILE_TYPE FILE_WAV
Definition: FileWrite.h:38
STK audio file output class.
Definition: FileWvOut.h:33
FileWvOut(std::string fileName, unsigned int nChannels=1, FileWrite::FILE_TYPE type=FileWrite::FILE_WAV, Stk::StkFormat format=STK_SINT16, unsigned int bufferFrames=1024)
Overloaded constructor used to specify a file name, type, and data format with this object.
void openFile(std::string fileName, unsigned int nChannels, FileWrite::FILE_TYPE type, Stk::StkFormat format)
Open a new file with the specified parameters.
void tick(const StkFrames &frames)
Output the StkFrames data.
void closeFile(void)
Close a file if one is open.
FileWvOut(unsigned int bufferFrames=1024)
Default constructor with optional output buffer size argument.
void tick(const StkFloat sample)
Output a single sample to all channels in a sample frame.
virtual ~FileWvOut()
Class destructor.
An STK class to handle vectorized audio data.
Definition: Stk.h:287
static const StkFormat STK_SINT16
Definition: Stk.h:149
STK audio output abstract base class.
Definition: WvOut.h:23
The STK namespace.
Definition: ADSR.h:8