40 if (config.
check(
"help"))
42 yCInfo(FAKESPEAKER,
"Some examples:");
43 yCInfo(FAKESPEAKER,
"yarpdev --device fakeSpeaker --help");
44 yCInfo(FAKESPEAKER,
"yarpdev --device AudioPlayerWrapper --subdevice fakeSpeaker --start");
49 if (!b) {
return false; }
52 if( config.
check(
"period"))
56 yCInfo(FAKESPEAKER) <<
"Using chosen period of " << period <<
" s";
78 bool fakeSpeaker::threadInit()
83 void fakeSpeaker::run()
100 size_t buffer_size = siz_sam * siz_chn;
101 for (
size_t i = 0; i<buffer_size; i++)
112 yCDebug(FAKESPEAKER) <<
"Sound Playback complete";
113 yCDebug(FAKESPEAKER) <<
"Played " << siz_sam <<
" samples, " << siz_chn <<
" channels, " << siz_byt <<
" bytes";
119 std::lock_guard<std::recursive_mutex> lock(
m_mutex);
130 yCError(FAKESPEAKER,
"configureDeviceAndStart() Not yet implemented");
136 yCError(FAKESPEAKER,
"interruptDeviceAndClose() Not yet implemented");
unsigned short int audio_sample_16t
virtual bool configureDeviceAndStart() override
bool close() override
Close the DeviceDriver.
virtual bool interruptDeviceAndClose() override
bool open(yarp::os::Searchable &config) override
Open the DeviceDriver.
virtual bool setHWGain(double gain) override
Sets the hardware gain of the playback device (if supported by the hardware)
std::recursive_mutex m_mutex
yarp::dev::CircularAudioBuffer_16t * m_outputBuffer
bool configurePlayerAudioDevice(yarp::os::Searchable &config, std::string device_name)
An abstraction for a periodic thread.
bool setPeriod(double period)
Set the (new) period of the thread.
bool start()
Call this to start the thread.
void stop()
Call this to stop the thread, this call blocks until the thread is terminated (and releaseThread() ca...
A base class for nested structures that can be searched.
virtual Value & find(const std::string &key) const =0
Gets a value corresponding to a given keyword.
virtual bool check(const std::string &key) const =0
Check if there exists a property of the given name.
virtual Bottle & findGroup(const std::string &key) const =0
Gets a list corresponding to a given keyword.
virtual yarp::conf::float64_t asFloat64() const
Get 64-bit floating point value.
constexpr double c_DEFAULT_PERIOD
unsigned short int audio_sample_16t
#define yCInfo(component,...)
#define yCError(component,...)
#define yCDebug(component,...)
#define YARP_LOG_COMPONENT(name,...)
An interface for the device drivers.
An interface to the operating system, including Port based communication.