YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
AudioRecorder_nwc_yarp Class Reference

audioRecoder_nwc_yarp: The client side of any IAudioGrabberSound capable device. More...

#include <networkWrappers/audioRecorder_nwc_yarp/AudioRecorder_nwc_yarp.h>

+ Inheritance diagram for AudioRecorder_nwc_yarp:

Public Member Functions

bool open (yarp::os::Searchable &config) override
 Open the DeviceDriver.
 
bool close () override
 Close the DeviceDriver.
 
virtual bool getSound (yarp::sig::Sound &sound, size_t min_number_of_samples, size_t max_number_of_samples, double max_samples_timeout_s) override
 Get a sound from a device.
 
virtual bool startRecording () override
 Start the recording.
 
virtual bool stopRecording () override
 Stop the recording.
 
virtual bool isRecording (bool &recording_enabled) override
 Check if the recording has been enabled (e.g.
 
virtual bool getRecordingAudioBufferMaxSize (yarp::sig::AudioBufferSize &size) override
 
virtual bool getRecordingAudioBufferCurrentSize (yarp::sig::AudioBufferSize &size) override
 
virtual bool resetRecordingAudioBuffer () override
 
virtual bool setSWGain (double gain) override
 Sets a software gain for the grabbed audio.
 
virtual bool setHWGain (double gain) override
 Sets the hardware gain of the grabbing device (if supported by the hardware)
 
- Public Member Functions inherited from yarp::dev::DeviceDriver
 DeviceDriver ()
 
 DeviceDriver (const DeviceDriver &other)=delete
 
 DeviceDriver (DeviceDriver &&other) noexcept=delete
 
DeviceDriveroperator= (const DeviceDriver &other)=delete
 
DeviceDriveroperator= (DeviceDriver &&other) noexcept=delete
 
virtual ~DeviceDriver ()
 
virtual std::string id () const
 Return the id assigned to the PolyDriver.
 
virtual void setId (const std::string &id)
 Set the id for this device.
 
template<class T >
bool view (T *&x)
 Get an interface to the device driver.
 
virtual DeviceDrivergetImplementation ()
 Some drivers are bureaucrats, pointing at others.
 
- Public Member Functions inherited from yarp::dev::IAudioGrabberSound
virtual ~IAudioGrabberSound ()
 Destructor.
 
- Public Member Functions inherited from AudioRecorder_nwc_yarp_ParamsParser
 AudioRecorder_nwc_yarp_ParamsParser ()
 
 ~AudioRecorder_nwc_yarp_ParamsParser () override=default
 
bool parseParams (const yarp::os::Searchable &config) override
 Parse the DeviceDriver parameters.
 
std::string getDeviceClassName () const override
 Get the name of the DeviceDriver class.
 
std::string getDeviceName () const override
 Get the name of the device (i.e.
 
std::string getDocumentationOfDeviceParams () const override
 Get the documentation of the DeviceDriver's parameters.
 
std::vector< std::string > getListOfParams () const override
 Return a list of all params used by the device.
 
- Public Member Functions inherited from yarp::dev::IDeviceDriverParams
virtual ~IDeviceDriverParams ()
 

Protected Attributes

InputPortProcessor m_inputPort
 
yarp::os::Port m_rpcPort
 
IAudioGrabberMsgs m_audiograb_RPC
 
std::mutex m_mutex
 

Additional Inherited Members

- Public Attributes inherited from AudioRecorder_nwc_yarp_ParamsParser
const std::string m_device_classname = {"AudioRecorder_nwc_yarp"}
 
const std::string m_device_name = {"audioRecorder_nwc_yarp"}
 
bool m_parser_is_strict = false
 
const parser_version_type m_parser_version = {}
 
const std::string m_local_defaultValue = {""}
 
const std::string m_remote_defaultValue = {""}
 
const std::string m_carrier_defaultValue = {"fast_tcp"}
 
const std::string m_useStream_defaultValue = {"false"}
 
std::string m_local = {}
 
std::string m_remote = {}
 
std::string m_carrier = {"fast_tcp"}
 
bool m_useStream = {false}
 

Detailed Description

audioRecoder_nwc_yarp: The client side of any IAudioGrabberSound capable device.

Description of input parameters

Please note that the getSound() method is currently implemented as a RPC call and streaming functions are not yet implemented.

Parameters required by this device are shown in class: AudioRecorder_nwc_yarp_ParamsParser

See Audio in YARP for additional documentation on YARP audio.

Definition at line 48 of file AudioRecorder_nwc_yarp.h.

Member Function Documentation

◆ close()

bool AudioRecorder_nwc_yarp::close ( )
overridevirtual

Close the DeviceDriver.

Returns
true/false on success/failure.

Reimplemented from yarp::dev::DeviceDriver.

Definition at line 108 of file AudioRecorder_nwc_yarp.cpp.

◆ getRecordingAudioBufferCurrentSize()

bool AudioRecorder_nwc_yarp::getRecordingAudioBufferCurrentSize ( yarp::sig::AudioBufferSize size)
overridevirtual

Implements yarp::dev::IAudioGrabberSound.

Definition at line 174 of file AudioRecorder_nwc_yarp.cpp.

◆ getRecordingAudioBufferMaxSize()

bool AudioRecorder_nwc_yarp::getRecordingAudioBufferMaxSize ( yarp::sig::AudioBufferSize size)
overridevirtual

Implements yarp::dev::IAudioGrabberSound.

Definition at line 161 of file AudioRecorder_nwc_yarp.cpp.

◆ getSound()

bool AudioRecorder_nwc_yarp::getSound ( yarp::sig::Sound sound,
size_t  min_number_of_samples,
size_t  max_number_of_samples,
double  max_samples_timeout_s 
)
overridevirtual

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.

Implements yarp::dev::IAudioGrabberSound.

Definition at line 187 of file AudioRecorder_nwc_yarp.cpp.

◆ isRecording()

bool AudioRecorder_nwc_yarp::isRecording ( bool recording_enabled)
overridevirtual

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

Implements yarp::dev::IAudioGrabberSound.

Definition at line 148 of file AudioRecorder_nwc_yarp.cpp.

◆ open()

bool AudioRecorder_nwc_yarp::open ( yarp::os::Searchable config)
overridevirtual

Open the DeviceDriver.

Parameters
configis a list of parameters for the device. Which parameters are effective for your device can vary. See device invocation examples. If there is no example for your device, you can run the "yarpdev" program with the verbose flag set to probe what parameters the device is checking. If that fails too, you'll need to read the source code (please nag one of the yarp developers to add documentation for your device).
Returns
true/false upon success/failure

Reimplemented from yarp::dev::DeviceDriver.

Definition at line 52 of file AudioRecorder_nwc_yarp.cpp.

◆ resetRecordingAudioBuffer()

bool AudioRecorder_nwc_yarp::resetRecordingAudioBuffer ( )
overridevirtual

Implements yarp::dev::IAudioGrabberSound.

Definition at line 142 of file AudioRecorder_nwc_yarp.cpp.

◆ setHWGain()

bool AudioRecorder_nwc_yarp::setHWGain ( double  gain)
overridevirtual

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

Implements yarp::dev::IAudioGrabberSound.

Definition at line 124 of file AudioRecorder_nwc_yarp.cpp.

◆ setSWGain()

bool AudioRecorder_nwc_yarp::setSWGain ( double  gain)
overridevirtual

Sets a software gain for the grabbed audio.

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

Implements yarp::dev::IAudioGrabberSound.

Definition at line 118 of file AudioRecorder_nwc_yarp.cpp.

◆ startRecording()

bool AudioRecorder_nwc_yarp::startRecording ( )
overridevirtual

Start the recording.

Returns
true/false upon success/failure

Implements yarp::dev::IAudioGrabberSound.

Definition at line 130 of file AudioRecorder_nwc_yarp.cpp.

◆ stopRecording()

bool AudioRecorder_nwc_yarp::stopRecording ( )
overridevirtual

Stop the recording.

Returns
true/false upon success/failure

Implements yarp::dev::IAudioGrabberSound.

Definition at line 136 of file AudioRecorder_nwc_yarp.cpp.

Member Data Documentation

◆ m_audiograb_RPC

IAudioGrabberMsgs AudioRecorder_nwc_yarp::m_audiograb_RPC
protected

Definition at line 56 of file AudioRecorder_nwc_yarp.h.

◆ m_inputPort

InputPortProcessor AudioRecorder_nwc_yarp::m_inputPort
protected

Definition at line 54 of file AudioRecorder_nwc_yarp.h.

◆ m_mutex

std::mutex AudioRecorder_nwc_yarp::m_mutex
protected

Definition at line 57 of file AudioRecorder_nwc_yarp.h.

◆ m_rpcPort

yarp::os::Port AudioRecorder_nwc_yarp::m_rpcPort
protected

Definition at line 55 of file AudioRecorder_nwc_yarp.h.


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