Essentia  2.1-beta6-dev
AudioContext Class Reference

#include <audiocontext.h>

Public Member Functions

 AudioContext ()
 
 ~AudioContext ()
 
int create (const std::string &filename, const std::string &format, int nChannels, int sampleRate, int bitrate)
 
void open ()
 
bool isOpen () const
 
void write (const std::vector< AudioSample > &monoData)
 
void write (const std::vector< StereoSample > &stereoData)
 
void close ()
 

Protected Member Functions

int16_t scale (Real value)
 
void encodePacket (int size)
 
void writeEOF ()
 

Protected Attributes

bool _isOpen
 
std::string _filename
 
AVStream * _avStream
 
AVFormatContext * _muxCtx
 
AVCodecContext * _codecCtx
 
int _inputBufSize
 
float * _buffer
 
uint8_t * _buffer_test
 
struct SwrContext * _convertCtxAv
 

Detailed Description

This is just a nice object-oriented wrapper around FFMPEG

Constructor & Destructor Documentation

◆ AudioContext()

◆ ~AudioContext()

~AudioContext ( )
inline

References AudioContext::close().

Member Function Documentation

◆ close()

void close ( )

◆ create()

int create ( const std::string &  filename,
const std::string &  format,
int  nChannels,
int  sampleRate,
int  bitrate 
)

◆ encodePacket()

void encodePacket ( int  size)
protected

◆ isOpen()

bool isOpen ( ) const
inline

References AudioContext::_isOpen.

◆ open()

void open ( )

◆ scale()

int16_t scale ( Real  value)
protected

◆ write() [1/2]

void write ( const std::vector< AudioSample > &  monoData)

◆ write() [2/2]

void write ( const std::vector< StereoSample > &  stereoData)

◆ writeEOF()

void writeEOF ( )
protected

Member Data Documentation

◆ _avStream

AVStream* _avStream
protected

◆ _buffer

float* _buffer
protected

◆ _buffer_test

uint8_t* _buffer_test
protected

◆ _codecCtx

AVCodecContext* _codecCtx
protected

◆ _convertCtxAv

struct SwrContext* _convertCtxAv
protected

◆ _filename

std::string _filename
protected

◆ _inputBufSize

int _inputBufSize
protected

◆ _isOpen

bool _isOpen
protected

Referenced by AudioContext::isOpen().

◆ _muxCtx

AVFormatContext* _muxCtx
protected

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