audioRecoder_nwc_yarp
: The client side of any IAudioGrabberSound capable device.
More...
#include <networkWrappers/audioRecorder_nwc_yarp/AudioRecorder_nwc_yarp.h>
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 | |
DeviceDriver & | operator= (const DeviceDriver &other)=delete |
DeviceDriver & | operator= (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 DeviceDriver * | getImplementation () |
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} |
audioRecoder_nwc_yarp
: The client side of any IAudioGrabberSound capable device.
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.
|
overridevirtual |
Close the DeviceDriver.
Reimplemented from yarp::dev::DeviceDriver.
Definition at line 108 of file AudioRecorder_nwc_yarp.cpp.
|
overridevirtual |
Implements yarp::dev::IAudioGrabberSound.
Definition at line 174 of file AudioRecorder_nwc_yarp.cpp.
|
overridevirtual |
Implements yarp::dev::IAudioGrabberSound.
Definition at line 161 of file AudioRecorder_nwc_yarp.cpp.
|
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).
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. |
Implements yarp::dev::IAudioGrabberSound.
Definition at line 187 of file AudioRecorder_nwc_yarp.cpp.
Check if the recording has been enabled (e.g.
via startRecording()/stopRecording())
recording_enabled | the status of the device |
Implements yarp::dev::IAudioGrabberSound.
Definition at line 148 of file AudioRecorder_nwc_yarp.cpp.
|
overridevirtual |
Open the DeviceDriver.
config | is 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). |
Reimplemented from yarp::dev::DeviceDriver.
Definition at line 52 of file AudioRecorder_nwc_yarp.cpp.
|
overridevirtual |
Implements yarp::dev::IAudioGrabberSound.
Definition at line 142 of file AudioRecorder_nwc_yarp.cpp.
Sets the hardware gain of the grabbing device (if supported by the hardware)
gain | the audio gain (1.0 is the default value) |
Implements yarp::dev::IAudioGrabberSound.
Definition at line 124 of file AudioRecorder_nwc_yarp.cpp.
Sets a software gain for the grabbed audio.
gain | the audio gain (1.0 is the default value) |
Implements yarp::dev::IAudioGrabberSound.
Definition at line 118 of file AudioRecorder_nwc_yarp.cpp.
|
overridevirtual |
Start the recording.
Implements yarp::dev::IAudioGrabberSound.
Definition at line 130 of file AudioRecorder_nwc_yarp.cpp.
|
overridevirtual |
Stop the recording.
Implements yarp::dev::IAudioGrabberSound.
Definition at line 136 of file AudioRecorder_nwc_yarp.cpp.
|
protected |
Definition at line 56 of file AudioRecorder_nwc_yarp.h.
|
protected |
Definition at line 54 of file AudioRecorder_nwc_yarp.h.
|
protected |
Definition at line 57 of file AudioRecorder_nwc_yarp.h.
|
protected |
Definition at line 55 of file AudioRecorder_nwc_yarp.h.