The Open Master Hearing Aid (openMHA)  openMHA
Open community platform for hearing aid algorithm research
io_asterisk_sound_t Class Reference

Sound data handling of io tcp library. More...

Public Member Functions

 io_asterisk_sound_t (int fragsize, float samplerate)
 Initialize sound data handling. More...
 
virtual ~io_asterisk_sound_t ()
 Do-nothing destructor. More...
 
virtual void prepare (int num_inchannels, int num_outchannels)
 Called during prepare, sets number of audio channels and allocates sound data storage. More...
 
virtual void release ()
 Called during release. More...
 
virtual int chunkbytes_in () const
 Number of bytes that constitute one input sound chunk. More...
 
virtual std::string header () const
 Create the tcp sound header lines. More...
 
std::string & hton (const mha_wave_t *s_out)
 Serialize data for network transfer. More...
 
mha_wave_tntoh (const std::string &data)
 Deserialize data from network. More...
 

Private Attributes

int fragsize
 Number of sound samples in each channel expected and returned from processing callback. More...
 
float samplerate
 Sampling rate. More...
 
int num_inchannels
 Number of input channels. More...
 
int num_outchannels
 
MHASignal::waveform_ts_in
 Storage for input signal. More...
 
std::string output_data
 Serialized data for network trnasfer. More...
 

Detailed Description

Sound data handling of io tcp library.

Constructor & Destructor Documentation

◆ io_asterisk_sound_t()

io_asterisk_sound_t::io_asterisk_sound_t ( int  fragsize,
float  samplerate 
)

Initialize sound data handling.

Parameters
fragsizeNumber of sound samples in each channel expected and returned from processing callback.
samplerateNumber of samples per second in each channel.

◆ ~io_asterisk_sound_t()

virtual io_asterisk_sound_t::~io_asterisk_sound_t ( )
inlinevirtual

Do-nothing destructor.

Member Function Documentation

◆ prepare()

void io_asterisk_sound_t::prepare ( int  num_inchannels,
int  num_outchannels 
)
virtual

Called during prepare, sets number of audio channels and allocates sound data storage.

Parameters
num_inchannelsNumber of input audio channels.
num_outchannelsNumber of output audio channels.

◆ release()

void io_asterisk_sound_t::release ( void  )
virtual

Called during release.

Deletes sound data storage.

◆ chunkbytes_in()

int io_asterisk_sound_t::chunkbytes_in ( ) const
virtual

Number of bytes that constitute one input sound chunk.

Returns
Number of bytes to read from TCP connection before invoking signal processing.

◆ header()

std::string io_asterisk_sound_t::header ( ) const
virtual

Create the tcp sound header lines.

◆ hton()

std::string & io_asterisk_sound_t::hton ( const mha_wave_t s_out)

Serialize data for network transfer.

◆ ntoh()

mha_wave_t * io_asterisk_sound_t::ntoh ( const std::string &  data)

Deserialize data from network.

Member Data Documentation

◆ fragsize

int io_asterisk_sound_t::fragsize
private

Number of sound samples in each channel expected and returned from processing callback.

◆ samplerate

float io_asterisk_sound_t::samplerate
private

Sampling rate.

Number of samples per second in each channel.

◆ num_inchannels

int io_asterisk_sound_t::num_inchannels
private

Number of input channels.

Number of channels expected from and returned by signal processing callback.

◆ num_outchannels

int io_asterisk_sound_t::num_outchannels
private

◆ s_in

MHASignal::waveform_t* io_asterisk_sound_t::s_in
private

Storage for input signal.

◆ output_data

std::string io_asterisk_sound_t::output_data
private

Serialized data for network trnasfer.


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