Read a YARP-format sound block from a device.
More...
#include <yarp/dev/IAudioGrabberSound.h>
Read a YARP-format sound block from a device.
Definition at line 21 of file IAudioGrabberSound.h.
◆ ~IAudioGrabberSound()
yarp::dev::IAudioGrabberSound::~IAudioGrabberSound |
( |
| ) |
|
|
virtualdefault |
◆ getRecordingAudioBufferCurrentSize()
◆ getRecordingAudioBufferMaxSize()
◆ getSound()
virtual bool yarp::dev::IAudioGrabberSound::getSound |
( |
yarp::sig::Sound & |
sound, |
|
|
size_t |
min_number_of_samples, |
|
|
size_t |
max_number_of_samples, |
|
|
double |
max_samples_timeout_s |
|
) |
| |
|
pure virtual |
Get a sound from a device.
Examples: getSound(s, 0, 100, 0.1); returns a sound whose size can vary between 0 and 100, with a maximum blocking time of 0.1 getSound(s, 100, 100, 0.0); returns a sound with exact size of 100. It may block forever (more specifically, until sound size is at least 100). getSound(s, 100, 100000, 0.0); returns a sound with a minimum size of 0, while trying to transfer all the internal buffer. It may block forever (more specifically, until sound size is at least 100).
- Parameters
-
sound | the sound to be filled |
min_number_of_samples. | The function will block until the driver is able to collect at least min_number_of_samples. If set to zero, the function may return empty sounds. |
max_number_of_samples. | The function will block until the driver is either able to collect max_number_of_samples or the timeout expires. |
max_samples_timeout_s. | The timeout (in seconds) to retrieve max_number_of_samples. |
- Returns
- true upon success, false for an invalid set of parameters, such as max_number_of_samples<min_number_of_samples, etc.
Implemented in FfmpegGrabber, AudioRecorder_nwc_yarp, PortAudioDeviceDriver, and yarp::dev::AudioRecorderDeviceBase.
◆ isRecording()
virtual bool yarp::dev::IAudioGrabberSound::isRecording |
( |
bool & |
recording_enabled | ) |
|
|
pure virtual |
◆ resetRecordingAudioBuffer()
virtual bool yarp::dev::IAudioGrabberSound::resetRecordingAudioBuffer |
( |
| ) |
|
|
pure virtual |
◆ setHWGain()
virtual bool yarp::dev::IAudioGrabberSound::setHWGain |
( |
double |
gain | ) |
|
|
pure virtual |
◆ setSWGain()
virtual bool yarp::dev::IAudioGrabberSound::setSWGain |
( |
double |
gain | ) |
|
|
pure virtual |
◆ startRecording()
virtual bool yarp::dev::IAudioGrabberSound::startRecording |
( |
| ) |
|
|
pure virtual |
◆ stopRecording()
virtual bool yarp::dev::IAudioGrabberSound::stopRecording |
( |
| ) |
|
|
pure virtual |
The documentation for this class was generated from the following files: