Bela
Real-time, ultra-low-latency audio and sensor processing system for BeagleBone Black
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
Public Member Functions | List of all members
AudioFileWriter Class Reference
Inheritance diagram for AudioFileWriter:
AudioFile

Public Member Functions

int setup (const std::string &path, size_t bufferSize, size_t channels, unsigned int sampleRate)
 
void setSamples (std::vector< float > &buffer)
 
void setSamples (float const *src, size_t samplesCount)
 
- Public Member Functions inherited from AudioFile
size_t getLength () const
 
size_t getChannels () const
 
int getSampleRate () const
 

Additional Inherited Members

- Protected Types inherited from AudioFile
enum  Mode { kRead, kWrite }
 
enum  { kNumBufs = 2 }
 
- Protected Member Functions inherited from AudioFile
int setup (const std::string &path, size_t bufferSize, Mode mode, size_t channels=0, unsigned int sampleRate=0)
 
void scheduleIo ()
 
std::vector< float > & getRtBuffer ()
 
void threadLoop ()
 
- Protected Attributes inherited from AudioFile
volatile size_t ioBuffer
 
size_t ioBufferOld
 
std::array< std::vector< float >
, kNumBufs > 
internalBuffers
 
std::thread diskIo
 
size_t size
 
volatile bool stop
 
bool ramOnly
 
size_t rtIdx
 
SNDFILE * sndfile = NULL
 
SF_INFO sfinfo = { 0 }
 

Member Function Documentation

int AudioFileWriter::setup ( const std::string &  path,
size_t  bufferSize,
size_t  channels,
unsigned int  sampleRate 
)

Open a file and prepare to write to it.

Parameters
pathPath to the file
bufferSizethe size of the internal buffer.
channelsthe number of channels
void AudioFileWriter::setSamples ( std::vector< float > &  buffer)

Push interleaved samples to the file for writing

Parameters
bufferthe source buffer. Its size() must be a multiple of getChannels().

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