YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
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.
 
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.
 
virtual bool startRecording ()=0
 Start the recording.
 
virtual bool stopRecording ()=0
 Stop the recording.
 
virtual bool isRecording (bool &recording_enabled)=0
 Check if the recording has been enabled (e.g.
 
virtual bool getRecordingAudioBufferMaxSize (yarp::sig::AudioBufferSize &size)=0
 
virtual bool getRecordingAudioBufferCurrentSize (yarp::sig::AudioBufferSize &size)=0
 
virtual bool resetRecordingAudioBuffer ()=0
 
virtual bool setSWGain (double gain)=0
 Sets a software gain for the grabbed audio.
 
virtual bool setHWGain (double gain)=0
 Sets the hardware gain of the grabbing device (if supported by the hardware)
 

Detailed Description

Read a YARP-format sound block from a device.

Definition at line 21 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::sig::AudioBufferSize size)
pure virtual

◆ getRecordingAudioBufferMaxSize()

virtual bool yarp::dev::IAudioGrabberSound::getRecordingAudioBufferMaxSize ( yarp::sig::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 FfmpegGrabber, AudioRecorder_nwc_yarp, PortAudioDeviceDriver, and yarp::dev::AudioRecorderDeviceBase.

◆ isRecording()

virtual bool yarp::dev::IAudioGrabberSound::isRecording ( bool &  recording_enabled)
pure virtual

Check if the recording has been enabled (e.g.

via startRecording()/stopRecording())

Parameters
recording_enabledthe status of the device
Returns
true/false upon success/failure

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

◆ resetRecordingAudioBuffer()

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

◆ setHWGain()

virtual bool yarp::dev::IAudioGrabberSound::setHWGain ( double  gain)
pure virtual

Sets the hardware gain of the grabbing device (if supported by the hardware)

Parameters
gainthe audio gain (1.0 is the default value)
Returns
true/false upon success/failure

Implemented in AudioFromFileDevice, FakeMicrophone, FfmpegGrabber, AudioRecorder_nwc_yarp, PortAudioDeviceDriver, and PortAudioRecorderDeviceDriver.

◆ setSWGain()

virtual bool yarp::dev::IAudioGrabberSound::setSWGain ( double  gain)
pure virtual

Sets a software gain for the grabbed audio.

Parameters
gainthe audio gain (1.0 is the default value)
Returns
true/false upon success/failure

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

◆ startRecording()

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

Start the recording.

Returns
true/false upon success/failure

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

◆ stopRecording()

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

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