YARP
Yet Another Robot Platform
yarp::dev::IAudioGrabberSound Class Referenceabstract

Read a YARP-format sound block from a device. More...

#include <yarp/dev/IAudioGrabberSound.h>

+ Inheritance diagram for yarp::dev::IAudioGrabberSound:

Public Member Functions

virtual ~IAudioGrabberSound ()
 Destructor. More...
 
virtual bool getSound (yarp::sig::Sound &sound, size_t min_number_of_samples, size_t max_number_of_samples, double max_samples_timeout_s)=0
 Get a sound from a device. More...
 
virtual bool startRecording ()=0
 Start the recording. More...
 
virtual bool stopRecording ()=0
 Stop the recording. More...
 
virtual bool getRecordingAudioBufferMaxSize (yarp::dev::AudioBufferSize &size)=0
 
virtual bool getRecordingAudioBufferCurrentSize (yarp::dev::AudioBufferSize &size)=0
 
virtual bool resetRecordingAudioBuffer ()=0
 

Detailed Description

Read a YARP-format sound block from a device.

Definition at line 25 of file IAudioGrabberSound.h.

Constructor & Destructor Documentation

◆ ~IAudioGrabberSound()

yarp::dev::IAudioGrabberSound::~IAudioGrabberSound ( )
virtualdefault

Destructor.

Member Function Documentation

◆ getRecordingAudioBufferCurrentSize()

virtual bool yarp::dev::IAudioGrabberSound::getRecordingAudioBufferCurrentSize ( yarp::dev::AudioBufferSize size)
pure virtual

◆ getRecordingAudioBufferMaxSize()

virtual bool yarp::dev::IAudioGrabberSound::getRecordingAudioBufferMaxSize ( yarp::dev::AudioBufferSize size)
pure virtual

◆ 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
soundthe 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 yarp::dev::AudioRecorderDeviceBase, PortAudioDeviceDriver, and FfmpegGrabber.

◆ resetRecordingAudioBuffer()

virtual bool yarp::dev::IAudioGrabberSound::resetRecordingAudioBuffer ( )
pure virtual

◆ startRecording()

virtual bool yarp::dev::IAudioGrabberSound::startRecording ( )
pure virtual

Start the recording.

Returns
true/false upon success/failure

Implemented in yarp::dev::AudioRecorderDeviceBase, PortAudioRecorderDeviceDriver, PortAudioDeviceDriver, and FfmpegGrabber.

◆ stopRecording()

virtual bool yarp::dev::IAudioGrabberSound::stopRecording ( )
pure virtual

Stop the recording.

Returns
true/false upon success/failure

Implemented in yarp::dev::AudioRecorderDeviceBase, PortAudioRecorderDeviceDriver, PortAudioDeviceDriver, and FfmpegGrabber.


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