Essentia  2.1-beta5-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 AVAudioResampleContext * _convertCtxAv
 

Detailed Description

This is just a nice object-oriented wrapper around FFMPEG

Constructor & Destructor Documentation

◆ AudioContext()

◆ ~AudioContext()

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

Referenced by AudioContext::isOpen().

◆ isOpen()

◆ open()

void open ( )

◆ scale()

int16_t scale ( Real  value)
protected

Referenced by AudioContext::isOpen().

◆ write() [1/2]

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

Referenced by AudioContext::isOpen().

◆ write() [2/2]

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

◆ writeEOF()

void writeEOF ( )
protected

Referenced by AudioContext::isOpen().

Member Data Documentation

◆ _avStream

AVStream* _avStream
protected

◆ _buffer

float* _buffer
protected

◆ _buffer_test

uint8_t* _buffer_test
protected

◆ _codecCtx

AVCodecContext* _codecCtx
protected

◆ _convertCtxAv

struct AVAudioResampleContext* _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: