YARP
Yet Another Robot Platform

AudioRecorderWrapper: A Wrapper which streams audio over the network, after grabbing it from a device More...

#include <audioRecorderWrapper/AudioRecorderWrapper.h>

+ Inheritance diagram for AudioRecorderWrapper:

Public Member Functions

 AudioRecorderWrapper ()
 Constructor. More...
 
 AudioRecorderWrapper (const AudioRecorderWrapper &)=delete
 
 AudioRecorderWrapper (AudioRecorderWrapper &&)=delete
 
AudioRecorderWrapperoperator= (const AudioRecorderWrapper &)=delete
 
AudioRecorderWrapperoperator= (AudioRecorderWrapper &&)=delete
 
 ~AudioRecorderWrapper () override
 
bool open (yarp::os::Searchable &config) override
 Open the DeviceDriver. More...
 
bool close () override
 Close the DeviceDriver. More...
 
bool attachAll (const yarp::dev::PolyDriverList &p) override
 Attach to a list of objects. More...
 
bool detachAll () override
 Detach the object (you must have first called attach). More...
 
void attach (yarp::dev::IAudioGrabberSound *igrab)
 
void detach ()
 
bool threadInit () override
 Initialization method. More...
 
void threadRelease () override
 Release method. More...
 
void run () override
 Loop function. More...
 
bool read (yarp::os::ConnectionReader &connection) override
 Read this object from a network connection. More...
 
- Public Member Functions inherited from yarp::dev::DeviceDriver
 ~DeviceDriver () override=default
 Destructor. More...
 
template<class T >
bool view (T *&x)
 Get an interface to the device driver. More...
 
virtual DeviceDrivergetImplementation ()
 Some drivers are bureaucrats, pointing at others. More...
 
- Public Member Functions inherited from yarp::os::IConfig
virtual ~IConfig ()
 Destructor. More...
 
virtual bool configure (Searchable &config)
 Change online parameters. More...
 
- Public Member Functions inherited from yarp::dev::IMultipleWrapper
virtual ~IMultipleWrapper ()
 Destructor. More...
 
- Public Member Functions inherited from yarp::os::PortReader
virtual ~PortReader ()
 Destructor. More...
 
virtual Type getReadType () const
 

Detailed Description

AudioRecorderWrapper: A Wrapper which streams audio over the network, after grabbing it from a device

Description of input parameters

Parameters required by this device are:

Parameter name SubParameter Type Units Default Value Required Description Notes
name - string - /audioRecorderWrapper No full name of the port opened by the device MUST start with a '/' character, xxx/audio:o and xxx/rpc suffixes are appended
period - int ms 20 No period of the internal thread, in ms default 20ms
debug - bool - - No developers use only
min_samples_over_network - int samples 11250 No sends the network packet ifs n samples are collected AND the timeout is expired the algorithm is implemented in AudioRecorderDeviceBase
max_samples_over_network - int samples 11250 No sends the network packet as soon as n samples have been collected the algorithm is implemented in AudioRecorderDeviceBase
max_samples_timeout - float s 1.0 No timeout for sample collection the algorithm is implemented in AudioRecorderDeviceBase
start - bool - false No automatically activates the recording when the device is started if false, the recording is enabled via rpc port

Definition at line 54 of file AudioRecorderWrapper.h.

Constructor & Destructor Documentation

◆ AudioRecorderWrapper() [1/3]

AudioRecorderWrapper::AudioRecorderWrapper ( )

Constructor.

Definition at line 37 of file AudioRecorderWrapper.cpp.

◆ AudioRecorderWrapper() [2/3]

AudioRecorderWrapper::AudioRecorderWrapper ( const AudioRecorderWrapper )
delete

◆ AudioRecorderWrapper() [3/3]

AudioRecorderWrapper::AudioRecorderWrapper ( AudioRecorderWrapper &&  )
delete

◆ ~AudioRecorderWrapper()

AudioRecorderWrapper::~AudioRecorderWrapper ( )
override

Definition at line 52 of file AudioRecorderWrapper.cpp.

Member Function Documentation

◆ attach()

void AudioRecorderWrapper::attach ( yarp::dev::IAudioGrabberSound igrab)

Definition at line 317 of file AudioRecorderWrapper.cpp.

◆ attachAll()

bool AudioRecorderWrapper::attachAll ( const yarp::dev::PolyDriverList p)
overridevirtual

Attach to a list of objects.

Parameters
pthe polydriver list that you want to attach to.
Returns
true/false on success failure.

Implements yarp::dev::IMultipleWrapper.

Definition at line 281 of file AudioRecorderWrapper.cpp.

◆ close()

bool AudioRecorderWrapper::close ( )
overridevirtual

Close the DeviceDriver.

Returns
true/false on success/failure.

Reimplemented from yarp::dev::DeviceDriver.

Definition at line 144 of file AudioRecorderWrapper.cpp.

◆ detach()

void AudioRecorderWrapper::detach ( )

Definition at line 322 of file AudioRecorderWrapper.cpp.

◆ detachAll()

bool AudioRecorderWrapper::detachAll ( )
overridevirtual

Detach the object (you must have first called attach).

Returns
true/false on success failure.

Implements yarp::dev::IMultipleWrapper.

Definition at line 307 of file AudioRecorderWrapper.cpp.

◆ open()

bool AudioRecorderWrapper::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 60 of file AudioRecorderWrapper.cpp.

◆ operator=() [1/2]

AudioRecorderWrapper& AudioRecorderWrapper::operator= ( AudioRecorderWrapper &&  )
delete

◆ operator=() [2/2]

AudioRecorderWrapper& AudioRecorderWrapper::operator= ( const AudioRecorderWrapper )
delete

◆ read()

bool AudioRecorderWrapper::read ( yarp::os::ConnectionReader reader)
overridevirtual

Read this object from a network connection.

Override this for your particular class.

Parameters
readeran interface to the network connection for reading
Returns
true iff the object is successfully read

Implements yarp::os::PortReader.

Definition at line 237 of file AudioRecorderWrapper.cpp.

◆ run()

void AudioRecorderWrapper::run ( )
overridevirtual

Loop function.

This is the thread itself. The thread calls the run() function every <period> ms. At the end of each run, the thread will sleep the amounth of time required, taking into account the time spent inside the loop function. Example: requested period is 10ms, the run() function take 3ms to be executed, the thread will sleep for 7ms.

Note: after each run is completed, the thread will call a yield() in order to facilitate other threads to run.

Implements yarp::os::PeriodicThread.

Definition at line 162 of file AudioRecorderWrapper.cpp.

◆ threadInit()

bool AudioRecorderWrapper::threadInit ( )
overridevirtual

Initialization method.

The thread executes this function when it starts and before "run". This is a good place to perform initialization tasks that need to be done by the thread itself (device drivers initialization, memory allocation etc). If the function returns false the thread quits and never calls "run". The return value of threadInit() is notified to the class and passed as a parameter to afterStart(). Note that afterStart() is called by the same thread that is executing the "start" method.

Reimplemented from yarp::os::PeriodicThread.

Definition at line 331 of file AudioRecorderWrapper.cpp.

◆ threadRelease()

void AudioRecorderWrapper::threadRelease ( )
overridevirtual

Release method.

The thread executes this function once when it exits, after the last "run". This is a good place to release resources that were initialized in threadInit() (release memory, and device driver resources).

Reimplemented from yarp::os::PeriodicThread.

Definition at line 336 of file AudioRecorderWrapper.cpp.


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