portaudio
deprecated: This device driver has been deprecated! Please use PortAudioPlayerDeviceDriver
or PortAudioRecorderDeviceDriver
More...
#include <portaudio/PortAudioDeviceDriver.h>
Public Member Functions | |
PortAudioDeviceDriver () | |
virtual | ~PortAudioDeviceDriver () |
bool | open (yarp::os::Searchable &config) override |
Open the DeviceDriver. | |
bool | open (PortAudioDeviceDriverSettings &config) |
Configures the device. | |
bool | close () override |
Close the DeviceDriver. | |
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 | renderSound (const yarp::sig::Sound &sound) override |
Render a sound using a device (i.e. | |
bool | startRecording () override |
Start the recording. | |
bool | stopRecording () override |
Stop the recording. | |
bool | startPlayback () override |
Start the playback. | |
bool | stopPlayback () override |
Stop the playback. | |
bool | isPlaying (bool &playback_enabled) override |
Check if the playback has been enabled (e.g. | |
bool | isRecording (bool &recording_enabled) override |
Check if the recording has been enabled (e.g. | |
bool | abortSound () |
bool | immediateSound (const yarp::sig::Sound &sound) |
bool | appendSound (const yarp::sig::Sound &sound) |
bool | getPlaybackAudioBufferMaxSize (yarp::sig::AudioBufferSize &size) override |
bool | getPlaybackAudioBufferCurrentSize (yarp::sig::AudioBufferSize &size) override |
bool | resetPlaybackAudioBuffer () override |
bool | getRecordingAudioBufferMaxSize (yarp::sig::AudioBufferSize &size) override |
bool | getRecordingAudioBufferCurrentSize (yarp::sig::AudioBufferSize &size) override |
bool | resetRecordingAudioBuffer () override |
bool | setHWGain (double gain) override |
Sets the hardware gain of the grabbing device (if supported by the hardware) | |
bool | setSWGain (double gain) override |
Sets a software gain for the grabbed audio. | |
Public Member Functions inherited from yarp::dev::IAudioGrabberSound | |
virtual | ~IAudioGrabberSound () |
Destructor. | |
Public Member Functions inherited from yarp::dev::IAudioRender | |
virtual | ~IAudioRender () |
Destructor. | |
Public Member Functions inherited from yarp::dev::DeviceDriver | |
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. | |
Protected Types | |
enum | { RENDER_APPEND =0 , RENDER_IMMEDIATE =1 } |
Protected Member Functions | |
void | handleError () |
Protected Attributes | |
void * | m_system_resource |
size_t | m_numPlaybackChannels |
size_t | m_numRecordChannels |
int | m_frequency |
bool | m_loopBack |
bool | m_getSoundIsNotBlocking |
PortAudioDeviceDriverSettings | m_driverConfig |
enum PortAudioDeviceDriver:: { ... } | renderMode |
portaudio
deprecated: This device driver has been deprecated! Please use PortAudioPlayerDeviceDriver
or PortAudioRecorderDeviceDriver
Requires the PortAudio library (http://www.portaudio.com), at least v19.
Definition at line 60 of file PortAudioDeviceDriver.h.
|
protected |
Enumerator | |
---|---|
RENDER_APPEND | |
RENDER_IMMEDIATE |
Definition at line 137 of file PortAudioDeviceDriver.h.
PortAudioDeviceDriver::PortAudioDeviceDriver | ( | ) |
Definition at line 191 of file PortAudioDeviceDriver.cpp.
|
virtual |
Definition at line 209 of file PortAudioDeviceDriver.cpp.
bool PortAudioDeviceDriver::abortSound | ( | ) |
Definition at line 465 of file PortAudioDeviceDriver.cpp.
bool PortAudioDeviceDriver::appendSound | ( | const yarp::sig::Sound & | sound | ) |
Definition at line 606 of file PortAudioDeviceDriver.cpp.
|
overridevirtual |
Close the DeviceDriver.
Reimplemented from yarp::dev::DeviceDriver.
Definition at line 368 of file PortAudioDeviceDriver.cpp.
|
overridevirtual |
Implements yarp::dev::IAudioRender.
Definition at line 622 of file PortAudioDeviceDriver.cpp.
|
overridevirtual |
Implements yarp::dev::IAudioRender.
Definition at line 628 of file PortAudioDeviceDriver.cpp.
|
overridevirtual |
Implements yarp::dev::IAudioGrabberSound.
Definition at line 640 of file PortAudioDeviceDriver.cpp.
|
overridevirtual |
Implements yarp::dev::IAudioGrabberSound.
Definition at line 646 of file PortAudioDeviceDriver.cpp.
|
overridevirtual |
Get a sound from a device.
Examples: getSound(s, 0, 100, 0.1); returns a sound whose size can vary between 0 and 100, with a maximum blocking time of 0.1 getSound(s, 100, 100, 0.0); returns a sound with exact size of 100. It may block forever (more specifically, until sound size is at least 100). getSound(s, 100, 100000, 0.0); returns a sound with a minimum size of 0, while trying to transfer all the internal buffer. It may block forever (more specifically, until sound size is at least 100).
sound | the sound to be filled |
min_number_of_samples. | The function will block until the driver is able to collect at least min_number_of_samples. If set to zero, the function may return empty sounds. |
max_number_of_samples. | The function will block until the driver is either able to collect max_number_of_samples or the timeout expires. |
max_samples_timeout_s. | The timeout (in seconds) to retrieve max_number_of_samples. |
Implements yarp::dev::IAudioGrabberSound.
Definition at line 412 of file PortAudioDeviceDriver.cpp.
|
protected |
Definition at line 355 of file PortAudioDeviceDriver.cpp.
bool PortAudioDeviceDriver::immediateSound | ( | const yarp::sig::Sound & | sound | ) |
Definition at line 551 of file PortAudioDeviceDriver.cpp.
Check if the playback has been enabled (e.g.
via startPlayback()/stopPlayback())
playback_enabled | the status of the device |
Implements yarp::dev::IAudioRender.
Definition at line 682 of file PortAudioDeviceDriver.cpp.
Check if the recording has been enabled (e.g.
via startRecording()/stopRecording())
recording_enabled | the status of the device |
Implements yarp::dev::IAudioGrabberSound.
Definition at line 688 of file PortAudioDeviceDriver.cpp.
bool PortAudioDeviceDriver::open | ( | PortAudioDeviceDriverSettings & | config | ) |
Configures the device.
rate: Sample rate to use, in Hertz. Specify 0 to use a default.
samples: Number of samples per call to getSound. Specify 0 to use a default.
channels: Number of channels of input. Specify 0 to use a default.
read: Should allow reading
write: Should allow writing
Definition at line 248 of file PortAudioDeviceDriver.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 215 of file PortAudioDeviceDriver.cpp.
|
overridevirtual |
Render a sound using a device (i.e.
send it to the speakers).
sound | the sound to be rendered |
Implements yarp::dev::IAudioRender.
Definition at line 569 of file PortAudioDeviceDriver.cpp.
|
overridevirtual |
Implements yarp::dev::IAudioRender.
Definition at line 634 of file PortAudioDeviceDriver.cpp.
|
overridevirtual |
Implements yarp::dev::IAudioGrabberSound.
Definition at line 652 of file PortAudioDeviceDriver.cpp.
Sets the hardware gain of the grabbing device (if supported by the hardware)
gain | the audio gain (1.0 is the default value) |
Implements yarp::dev::IAudioGrabberSound.
Definition at line 676 of file PortAudioDeviceDriver.cpp.
Sets a software gain for the grabbed audio.
gain | the audio gain (1.0 is the default value) |
Implements yarp::dev::IAudioGrabberSound.
Definition at line 670 of file PortAudioDeviceDriver.cpp.
|
overridevirtual |
Start the playback.
Implements yarp::dev::IAudioRender.
Definition at line 658 of file PortAudioDeviceDriver.cpp.
|
overridevirtual |
Start the recording.
Implements yarp::dev::IAudioGrabberSound.
Definition at line 396 of file PortAudioDeviceDriver.cpp.
|
overridevirtual |
Stop the playback.
Implements yarp::dev::IAudioRender.
Definition at line 664 of file PortAudioDeviceDriver.cpp.
|
overridevirtual |
Stop the recording.
Implements yarp::dev::IAudioGrabberSound.
Definition at line 404 of file PortAudioDeviceDriver.cpp.
|
protected |
Definition at line 136 of file PortAudioDeviceDriver.h.
|
protected |
Definition at line 132 of file PortAudioDeviceDriver.h.
|
protected |
Definition at line 134 of file PortAudioDeviceDriver.h.
|
protected |
Definition at line 133 of file PortAudioDeviceDriver.h.
|
protected |
Definition at line 130 of file PortAudioDeviceDriver.h.
|
protected |
Definition at line 131 of file PortAudioDeviceDriver.h.
|
protected |
Definition at line 129 of file PortAudioDeviceDriver.h.
enum { ... } PortAudioDeviceDriver::renderMode |