6 #ifndef PortAudioDeviceDriverh
7 #define PortAudioDeviceDriverh
14 #include <portaudio.h>
17 #define DEFAULT_SAMPLE_RATE (44100)
18 #define DEFAULT_NUM_CHANNELS (2)
19 #define DEFAULT_DITHER_FLAG (0)
20 #define DEFAULT_FRAMES_PER_BUFFER (512)
66 PaStreamParameters inputParameters;
67 PaStreamParameters outputParameters;
103 bool close()
override;
104 bool getSound(
yarp::sig::Sound& sound,
size_t min_number_of_samples,
size_t max_number_of_samples,
double max_samples_timeout_s)
override;
110 bool isPlaying(
bool& playback_enabled)
override;
111 bool isRecording(
bool& recording_enabled)
override;
portaudio deprecated: This device driver has been deprecated! Please use PortAudioPlayerDeviceDriver ...
bool getSound(yarp::sig::Sound &sound, size_t min_number_of_samples, size_t max_number_of_samples, double max_samples_timeout_s) override
Get a sound from a device.
bool startPlayback() override
Start the playback.
size_t m_numPlaybackChannels
bool setSWGain(double gain) override
Sets a software gain for the grabbed audio.
bool open(yarp::os::Searchable &config) override
Open the DeviceDriver.
bool m_getSoundIsNotBlocking
bool stopRecording() override
Stop the recording.
virtual ~PortAudioDeviceDriver()
bool isPlaying(bool &playback_enabled) override
Check if the playback has been enabled (e.g.
bool getPlaybackAudioBufferCurrentSize(yarp::dev::AudioBufferSize &size) override
PortAudioDeviceDriverSettings m_driverConfig
bool resetRecordingAudioBuffer() override
bool getPlaybackAudioBufferMaxSize(yarp::dev::AudioBufferSize &size) override
bool setHWGain(double gain) override
Sets the hardware gain of the grabbing device (if supported by the hardware)
bool startRecording() override
Start the recording.
bool getRecordingAudioBufferCurrentSize(yarp::dev::AudioBufferSize &size) override
bool resetPlaybackAudioBuffer() override
bool renderSound(const yarp::sig::Sound &sound) override
Render a sound using a device (i.e.
bool isRecording(bool &recording_enabled) override
Check if the recording has been enabled (e.g.
bool appendSound(const yarp::sig::Sound &sound)
enum PortAudioDeviceDriver::@90 renderMode
bool close() override
Close the DeviceDriver.
bool stopPlayback() override
Stop the playback.
bool immediateSound(const yarp::sig::Sound &sound)
bool getRecordingAudioBufferMaxSize(yarp::dev::AudioBufferSize &size) override
size_t m_numRecordChannels
void run() override
Main body of the new thread.
bool threadInit() override
Initialization method.
void threadRelease() override
Release method.
Interface implemented by deprecated device drivers.
Read a YARP-format sound block from a device.
A base class for nested structures that can be searched.
An abstraction for a thread of execution.
Class for storing sounds See Audio in YARP for additional documentation on YARP audio.