The Open Master Hearing Aid (openMHA)  openMHA
Open community platform for hearing aid algorithm research
alsa_base_t Class Referenceabstract
Inheritance diagram for alsa_base_t:
Inheritance graph

Public Member Functions

 alsa_base_t ()
 
virtual ~alsa_base_t ()=default
 
virtual void start ()=0
 start puts alsa device in usable state More...
 
virtual void stop ()=0
 stop informs alsa device that we do not need any more samples / will not provide any more samples More...
 
virtual bool read (mha_wave_t **)=0
 read audio samples from the device into an internal mha_wave_t buffer, then update the pointer given as parameter to point to the internal structure. More...
 
virtual bool write (mha_wave_t *)=0
 write audio samples from the given waveform buffer to the sound device. More...
 

Public Attributes

snd_pcm_t * pcm
 The underlying alsa handle to this sound card. More...
 

Constructor & Destructor Documentation

◆ alsa_base_t()

alsa_base_t::alsa_base_t ( )
inline

◆ ~alsa_base_t()

virtual alsa_base_t::~alsa_base_t ( )
virtualdefault

Member Function Documentation

◆ start()

virtual void alsa_base_t::start ( )
pure virtual

start puts alsa device in usable state

Implemented in alsa_t< T >.

◆ stop()

virtual void alsa_base_t::stop ( )
pure virtual

stop informs alsa device that we do not need any more samples / will not provide any more samples

Implemented in alsa_t< T >.

◆ read()

virtual bool alsa_base_t::read ( mha_wave_t **  )
pure virtual

read audio samples from the device into an internal mha_wave_t buffer, then update the pointer given as parameter to point to the internal structure.

Converts sound samples from the integer data type provided by the sound card to floating-point values needed by the MHA in the range [-1.0,1.0]

Implemented in alsa_t< T >.

◆ write()

virtual bool alsa_base_t::write ( mha_wave_t )
pure virtual

write audio samples from the given waveform buffer to the sound device.

converts the floating point values coming from the MHA to the integer samples required by the sound card.

Implemented in alsa_t< T >.

Member Data Documentation

◆ pcm

snd_pcm_t* alsa_base_t::pcm

The underlying alsa handle to this sound card.


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