20#define SLEEP_TIME 0.005f
23#define PA_SAMPLE_TYPE paFloat32
25#define SAMPLE_SILENCE (0.0f)
27#define PA_SAMPLE_TYPE paInt16
29#define SAMPLE_SILENCE (0)
31#define PA_SAMPLE_TYPE paInt8
33#define SAMPLE_SILENCE (0)
35#define PA_SAMPLE_TYPE paUInt8
36typedef unsigned char SAMPLE;
37#define SAMPLE_SILENCE (128)
38#define SAMPLE_UNSIGNED
45#define DEFAULT_FRAMES_PER_BUFFER (512)
76#ifdef STOP_REC_ON_EMPTY_BUFFER
123 m_system_resource(nullptr)
137 if (!b) {
return false; }
140 if (!b) {
return false; }
152 m_inputParameters.hostApiSpecificStreamInfo =
nullptr;
155 std::string
devname =
"unknown";
158 m_inputParameters.suggestedLatency =
devinfo->defaultLowInputLatency;
203 if (m_stream !=
nullptr)
227 if(m_err < 0 ) {
handleError();
return ReturnValue::return_code::return_value_error_method_failed;}
235 return ReturnValue::return_code::return_value_error_not_implemented_by_device;
242 if(m_err < 0 ) {
handleError();
return ReturnValue::return_code::return_value_error_method_failed;}
static int bufferIOCallback(const void *inputBuffer, void *outputBuffer, unsigned long framesPerBuffer, const PaStreamCallbackTimeInfo *timeInfo, PaStreamCallbackFlags statusFlags, void *userData)
static int bufferIOCallback(const void *inputBuffer, void *outputBuffer, unsigned long framesPerBuffer, const PaStreamCallbackTimeInfo *timeInfo, PaStreamCallbackFlags statusFlags, void *userData)
bool parseParams(const yarp::os::Searchable &config) override
Parse the DeviceDriver parameters.
size_t m_driver_frame_size
yarp::dev::ReturnValue setHWGain(double gain) override
Sets the hardware gain of the grabbing device (if supported by the hardware)
void run() override
Main body of the new thread.
bool threadInit() override
Initialization method.
yarp::dev::ReturnValue stopRecording() override
Stop the recording.
void threadRelease() override
Release method.
bool close() override
Close the DeviceDriver.
yarp::dev::ReturnValue startRecording() override
Start the recording.
~PortAudioRecorderDeviceDriver() override
PortAudioRecorderDeviceDriver()
bool open(yarp::os::Searchable &config) override
Open the DeviceDriver.
yarp::dev::CircularAudioBuffer_16t * m_inputBuffer
virtual yarp::dev::ReturnValue startRecording() override
Start the recording.
virtual yarp::dev::ReturnValue stopRecording() override
Stop the recording.
bool configureRecorderAudioDevice(yarp::os::Searchable &config, std::string device_name)
AudioDeviceDriverSettings m_audiorecorder_cfg
A mini-server for performing network communication in the background.
void write(bool forceStrict=false)
Write the current object being returned by BufferedPort::prepare.
A base class for nested structures that can be searched.
virtual Bottle & findGroup(const std::string &key) const =0
Gets a list corresponding to a given keyword.
bool stop()
Stop the thread.
bool isStopping()
Returns true if the thread is stopping (Thread::stop has been called).
bool start()
Start the new thread running.
#define yCInfo(component,...)
#define yCError(component,...)
#define YARP_LOG_COMPONENT(name,...)
For streams capable of holding different kinds of content, check what they actually have.
void delay(double seconds)
Wait for a certain number of seconds.
An interface to the operating system, including Port based communication.