AudioRecorderWrapper
: A Wrapper which streams audio over the network, after grabbing it from a device
More...
#include <audioRecorderWrapper/AudioRecorderWrapper.h>
Public Member Functions | |
AudioRecorderWrapper () | |
Constructor. More... | |
AudioRecorderWrapper (const AudioRecorderWrapper &)=delete | |
AudioRecorderWrapper (AudioRecorderWrapper &&)=delete | |
AudioRecorderWrapper & | operator= (const AudioRecorderWrapper &)=delete |
AudioRecorderWrapper & | operator= (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 DeviceDriver * | getImplementation () |
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 |
AudioRecorderWrapper
: A Wrapper which streams audio over the network, after grabbing it from a device
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.
AudioRecorderWrapper::AudioRecorderWrapper | ( | ) |
Constructor.
Definition at line 37 of file AudioRecorderWrapper.cpp.
|
delete |
|
delete |
|
override |
Definition at line 52 of file AudioRecorderWrapper.cpp.
void AudioRecorderWrapper::attach | ( | yarp::dev::IAudioGrabberSound * | igrab | ) |
Definition at line 317 of file AudioRecorderWrapper.cpp.
|
overridevirtual |
Attach to a list of objects.
p | the polydriver list that you want to attach to. |
Implements yarp::dev::IMultipleWrapper.
Definition at line 281 of file AudioRecorderWrapper.cpp.
|
overridevirtual |
Close the DeviceDriver.
Reimplemented from yarp::dev::DeviceDriver.
Definition at line 144 of file AudioRecorderWrapper.cpp.
void AudioRecorderWrapper::detach | ( | ) |
Definition at line 322 of file AudioRecorderWrapper.cpp.
|
overridevirtual |
Detach the object (you must have first called attach).
Implements yarp::dev::IMultipleWrapper.
Definition at line 307 of file AudioRecorderWrapper.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 60 of file AudioRecorderWrapper.cpp.
|
delete |
|
delete |
|
overridevirtual |
Read this object from a network connection.
Override this for your particular class.
reader | an interface to the network connection for reading |
Implements yarp::os::PortReader.
Definition at line 237 of file AudioRecorderWrapper.cpp.
|
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.
|
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.
|
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.