
Class to grab audio samples from an audio device. More...
#include <Devices/AudioGrabber.H>


Public Member Functions | |
| AudioGrabber (OptionManager &mgr, const std::string &descrName="Audio Grabber Driver", const std::string &tagName="AudioGrabber") | |
| Constructor. | |
| ~AudioGrabber () | |
| Destructor. | |
| template<class T > | |
| void | grab (AudioBuffer< T > &buf) const |
| Grab a buffer. | |
Protected Member Functions | |
| void | start2 () |
| get started (see ModelComponent.H) | |
| void | stop1 () |
| get stopped (see ModelComponent.H) | |
Protected Attributes | |
| OModelParam< std::string > | itsDevName |
| audio device name | |
| OModelParam< uint > | itsBits |
| bits per sample (8 or 16) | |
| OModelParam< uint > | itsFreq |
| sampling frequency (Hz) | |
| OModelParam< uint > | itsBufsamples |
| samples per buffer | |
| OModelParam< uint > | itsChans |
| number of channels | |
| OModelParam< bool > | itsInterleaved |
| channel data interleaved? | |
Class to grab audio samples from an audio device.
For now, grabbing is done using a blocking read() onto the DSP device.
Definition at line 49 of file AudioGrabber.H.
| AudioGrabber::AudioGrabber | ( | OptionManager & | mgr, | |
| const std::string & | descrName = "Audio Grabber Driver", |
|||
| const std::string & | tagName = "AudioGrabber" | |||
| ) |
Constructor.
Definition at line 58 of file AudioGrabber.C.
| AudioGrabber::~AudioGrabber | ( | ) |
Destructor.
Definition at line 144 of file AudioGrabber.C.
| void AudioGrabber::grab | ( | AudioBuffer< T > & | buf | ) | const [inline] |
Grab a buffer.
Definition at line 149 of file AudioGrabber.C.
References ASSERT, Image< T >::attach(), Image< T >::detach(), Image< T >::getArrayPtr(), AudioBuffer< T >::getDataPtr(), OModelParam< T >::getVal(), itsBits, itsBufsamples, itsChans, itsFreq, itsInterleaved, NO_INIT, AudioBuffer< T >::sizeBytes(), and transpose().
| void AudioGrabber::start2 | ( | ) | [protected, virtual] |
get started (see ModelComponent.H)
Reimplemented from ModelComponent.
Definition at line 71 of file AudioGrabber.C.
References OModelParam< T >::getVal(), itsBits, itsBufsamples, itsChans, itsDevName, and itsFreq.
| void AudioGrabber::stop1 | ( | ) | [protected, virtual] |
get stopped (see ModelComponent.H)
Reimplemented from ModelComponent.
Definition at line 131 of file AudioGrabber.C.
OModelParam<uint> AudioGrabber::itsBits [protected] |
bits per sample (8 or 16)
Definition at line 69 of file AudioGrabber.H.
OModelParam<uint> AudioGrabber::itsBufsamples [protected] |
samples per buffer
Definition at line 71 of file AudioGrabber.H.
OModelParam<uint> AudioGrabber::itsChans [protected] |
number of channels
Definition at line 72 of file AudioGrabber.H.
OModelParam<std::string> AudioGrabber::itsDevName [protected] |
OModelParam<uint> AudioGrabber::itsFreq [protected] |
sampling frequency (Hz)
Definition at line 70 of file AudioGrabber.H.
OModelParam<bool> AudioGrabber::itsInterleaved [protected] |
1.6.3