fakeSpeaker
: fake device implementing the IAudioRender device interface to play sound
More...
#include <fake/fakeSpeaker/FakeSpeaker.h>
Public Member Functions | |
FakeSpeaker () | |
FakeSpeaker (const FakeSpeaker &)=delete | |
FakeSpeaker (FakeSpeaker &&)=delete | |
FakeSpeaker & | operator= (const FakeSpeaker &)=delete |
FakeSpeaker & | operator= (FakeSpeaker &&)=delete |
~FakeSpeaker () override | |
bool | open (yarp::os::Searchable &config) override |
Open the DeviceDriver. | |
bool | close () override |
Close the DeviceDriver. | |
virtual yarp::dev::ReturnValue | setHWGain (double gain) override |
Sets the hardware gain of the playback device (if supported by the hardware) | |
virtual bool | configureDeviceAndStart () override |
virtual bool | interruptDeviceAndClose () override |
![]() | |
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. | |
![]() | |
virtual yarp::dev::ReturnValue | renderSound (const yarp::sig::Sound &sound) override |
Render a sound using a device (i.e. | |
virtual yarp::dev::ReturnValue | startPlayback () override |
Start the playback. | |
virtual yarp::dev::ReturnValue | stopPlayback () override |
Stop the playback. | |
virtual yarp::dev::ReturnValue | isPlaying (bool &playback_enabled) override |
Check if the playback has been enabled (e.g. | |
virtual yarp::dev::ReturnValue | getPlaybackAudioBufferMaxSize (yarp::sig::AudioBufferSize &size) override |
virtual yarp::dev::ReturnValue | getPlaybackAudioBufferCurrentSize (yarp::sig::AudioBufferSize &size) override |
virtual yarp::dev::ReturnValue | resetPlaybackAudioBuffer () override |
virtual yarp::dev::ReturnValue | setSWGain (double gain) override |
Sets a software gain for the played audio. | |
virtual | ~AudioPlayerDeviceBase () |
![]() | |
virtual | ~IAudioRender () |
Destructor. | |
![]() | |
PeriodicThread (double period, ShouldUseSystemClock useSystemClock=ShouldUseSystemClock::No, PeriodicThreadClock clockAccuracy=PeriodicThreadClock::Relative) | |
Constructor. | |
PeriodicThread (double period, PeriodicThreadClock clockAccuracy) | |
Constructor. | |
virtual | ~PeriodicThread () |
bool | start () |
Call this to start the thread. | |
void | step () |
Call this to "step" the thread rather than starting it. | |
void | stop () |
Call this to stop the thread, this call blocks until the thread is terminated (and releaseThread() called). | |
void | askToStop () |
Stop the thread. | |
bool | isRunning () const |
Returns true when the thread is started, false otherwise. | |
bool | isSuspended () const |
Returns true when the thread is suspended, false otherwise. | |
bool | setPeriod (double period) |
Set the (new) period of the thread. | |
double | getPeriod () const |
Return the current period of the thread. | |
void | suspend () |
Suspend the thread, the thread keeps running by doLoop is never executed. | |
void | resume () |
Resume the thread if previously suspended. | |
void | resetStat () |
Reset thread statistics. | |
double | getEstimatedPeriod () const |
Return estimated period since last reset. | |
void | getEstimatedPeriod (double &av, double &std) const |
Return estimated period since last reset. | |
unsigned int | getIterations () const |
Return the number of iterations performed since last reset. | |
double | getEstimatedUsed () const |
Return the estimated duration of the run() function since last reset. | |
void | getEstimatedUsed (double &av, double &std) const |
Return estimated duration of the run() function since last reset. | |
int | setPriority (int priority, int policy=-1) |
Set the priority and scheduling policy of the thread, if the OS supports that. | |
int | getPriority () const |
Query the current priority of the thread, if the OS supports that. | |
int | getPolicy () const |
Query the current scheduling policy of the thread, if the OS supports that. | |
![]() | |
FakeSpeaker_ParamsParser () | |
~FakeSpeaker_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. | |
![]() | |
virtual | ~IDeviceDriverParams () |
Additional Inherited Members | |
![]() | |
const std::string | m_device_classname = {"FakeSpeaker"} |
const std::string | m_device_name = {"fakeSpeaker"} |
bool | m_parser_is_strict = false |
const parser_version_type | m_parser_version = {} |
const std::string | m_period_defaultValue = {"0.010"} |
double | m_period = {0.010} |
![]() | |
enum | { RENDER_APPEND = 0 , RENDER_IMMEDIATE = 1 } |
![]() | |
virtual void | waitUntilPlaybackStreamIsComplete () |
virtual bool | immediateSound (const yarp::sig::Sound &sound) |
virtual bool | appendSound (const yarp::sig::Sound &sound) |
bool | configurePlayerAudioDevice (yarp::os::Searchable &config, std::string device_name) |
![]() | |
virtual void | threadRelease () |
Release method. | |
virtual void | beforeStart () |
Called just before a new thread starts. | |
virtual void | afterStart (bool success) |
Called just after a new thread starts (or fails to start), this is executed by the same thread that calls start(). | |
![]() | |
bool | m_enable_buffer_autoclear = false |
bool | m_playback_enabled = false |
std::recursive_mutex | m_mutex |
yarp::dev::CircularAudioBuffer_16t * | m_outputBuffer = nullptr |
AudioDeviceDriverSettings | m_audioplayer_cfg |
double | m_sw_gain = 1.0 |
double | m_hw_gain = 1.0 |
bool | m_audiobase_debug = false |
enum yarp::dev::AudioPlayerDeviceBase:: { ... } | m_renderMode = RENDER_APPEND |
fakeSpeaker
: fake device implementing the IAudioRender device interface to play sound
This device driver derives from AudioPlayerDeviceBase base class. Please check its documentation for additional details.
Parameters required by this device are shown in class: FakeMicrophone_ParamsParser This device also inherits some parameters from AudioPlayerDeviceBase
See Audio in YARP for additional documentation on YARP audio.
Definition at line 30 of file FakeSpeaker.h.
FakeSpeaker::FakeSpeaker | ( | ) |
Definition at line 28 of file FakeSpeaker.cpp.
|
delete |
|
delete |
|
override |
Definition at line 33 of file FakeSpeaker.cpp.
|
overridevirtual |
Close the DeviceDriver.
Reimplemented from yarp::dev::DeviceDriver.
Definition at line 53 of file FakeSpeaker.cpp.
|
overridevirtual |
Implements yarp::dev::AudioPlayerDeviceBase.
Definition at line 113 of file FakeSpeaker.cpp.
|
overridevirtual |
Implements yarp::dev::AudioPlayerDeviceBase.
Definition at line 119 of file FakeSpeaker.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 38 of file FakeSpeaker.cpp.
|
delete |
|
delete |
|
overridevirtual |
Sets the hardware gain of the playback device (if supported by the hardware)
gain | the audio gain (1.0 is the default value) |
Implements yarp::dev::IAudioRender.
Definition at line 102 of file FakeSpeaker.cpp.