audioToFileDevice
: This device driver, wrapped by default by AudioPlayerWrapper, is used to save to an audio stream to a file on disk.
More...
#include <audioToFileDevice/AudioToFileDevice.h>
Additional Inherited Members | |
![]() | |
const std::string | m_device_classname = {"AudioToFileDevice"} |
const std::string | m_device_name = {"audioToFileDevice"} |
bool | m_parser_is_strict = false |
const parser_version_type | m_parser_version = {} |
const std::string | m_file_name_defaultValue = {"audio_out.wav"} |
const std::string | m_save_mode_defaultValue = {"overwrite_file"} |
const std::string | m_add_marker_defaultValue = {"false"} |
std::string | m_file_name = {"audio_out.wav"} |
std::string | m_save_mode = {"overwrite_file"} |
bool | m_add_marker = {false} |
![]() | |
enum | { RENDER_APPEND = 0 , RENDER_IMMEDIATE = 1 } |
![]() | |
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) |
![]() | |
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 |
audioToFileDevice
: This device driver, wrapped by default by AudioPlayerWrapper, is used to save to an audio stream to a file on disk.
This device driver derives from yarp::dev::AudioPlayerDeviceBase base class. Please check its documentation for additional configuration parameters.
Parameters required by this device are shown in class: AudioToFileDevice_ParamsParser and AudioRecorderDeviceBase
Three different operating modes are available, defined by the optional string parameter save_mode
: if save_mode == "append_data", the file is written only when the module terminates. Every start/stop operation just pauses the module. On resume, the new data is concatenated at the end of the file.
if save_mode == "overwrite_file", the output file is written every time the stop() method is called or when the module terminates. If the file already exists, it will be overwritten with the new data.
if save_mode = "rename_file", the output file is written to a NEW file every time the stop() method is called or when the module terminates. The file name is modified, using an incremental counter appended at the end of the file name.
if save_mode = "break_file", the output file is written to a NEW file every time a yarp::sig::sound is received or when the module terminates. The file name is modified, using an incremental counter appended at the end of the file name.
See Audio in YARP for additional documentation on YARP audio.
Definition at line 45 of file AudioToFileDevice.h.
AudioToFileDevice::AudioToFileDevice | ( | ) |
Definition at line 26 of file AudioToFileDevice.cpp.
|
delete |
|
delete |
|
override |
Definition at line 30 of file AudioToFileDevice.cpp.
|
overridevirtual |
Close the DeviceDriver.
Reimplemented from yarp::dev::DeviceDriver.
Definition at line 124 of file AudioToFileDevice.cpp.
|
overridevirtual |
Implements yarp::dev::AudioPlayerDeviceBase.
Definition at line 181 of file AudioToFileDevice.cpp.
|
overridevirtual |
Implements yarp::dev::AudioPlayerDeviceBase.
Definition at line 187 of file AudioToFileDevice.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 35 of file AudioToFileDevice.cpp.
|
delete |
|
delete |
|
overridevirtual |
Render a sound using a device (i.e.
send it to the speakers).
sound | the sound to be rendered |
Reimplemented from yarp::dev::AudioPlayerDeviceBase.
Definition at line 154 of file AudioToFileDevice.cpp.
|
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 170 of file AudioToFileDevice.cpp.
|
overridevirtual |
Start the playback.
Reimplemented from yarp::dev::AudioPlayerDeviceBase.
Definition at line 130 of file AudioToFileDevice.cpp.
|
overridevirtual |
Stop the playback.
Reimplemented from yarp::dev::AudioPlayerDeviceBase.
Definition at line 142 of file AudioToFileDevice.cpp.
|
overridevirtual |
Reimplemented from yarp::dev::AudioPlayerDeviceBase.
Definition at line 193 of file AudioToFileDevice.cpp.