![]() |
The Open Master Hearing Aid (openMHA)
openMHA
Open community platform for hearing aid algorithm research
|
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_t * | ntoh (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_t * | s_in |
| Storage for input signal. More... | |
| std::string | output_data |
| Serialized data for network trnasfer. More... | |
Sound data handling of io tcp library.
| io_asterisk_sound_t::io_asterisk_sound_t | ( | int | fragsize, |
| float | samplerate | ||
| ) |
Initialize sound data handling.
| fragsize | Number of sound samples in each channel expected and returned from processing callback. |
| samplerate | Number of samples per second in each channel. |
|
inlinevirtual |
Do-nothing destructor.
|
virtual |
Called during prepare, sets number of audio channels and allocates sound data storage.
| num_inchannels | Number of input audio channels. |
| num_outchannels | Number of output audio channels. |
|
virtual |
Called during release.
Deletes sound data storage.
|
virtual |
Number of bytes that constitute one input sound chunk.
|
virtual |
Create the tcp sound header lines.
| std::string & io_asterisk_sound_t::hton | ( | const mha_wave_t * | s_out | ) |
Serialize data for network transfer.
| mha_wave_t * io_asterisk_sound_t::ntoh | ( | const std::string & | data | ) |
Deserialize data from network.
|
private |
Number of sound samples in each channel expected and returned from processing callback.
|
private |
Sampling rate.
Number of samples per second in each channel.
|
private |
Number of input channels.
Number of channels expected from and returned by signal processing callback.
|
private |
|
private |
Storage for input signal.
|
private |
Serialized data for network trnasfer.