audioToFileDevice
: This device driver, wrapped by default by AudioPlayerWrapper, is used to save to a file an audio stream.
More...
#include <audioToFileDevice/audioToFileDevice.h>
Public Member Functions | |
audioToFileDevice () | |
audioToFileDevice (const audioToFileDevice &)=delete | |
audioToFileDevice (audioToFileDevice &&)=delete | |
audioToFileDevice & | operator= (const audioToFileDevice &)=delete |
audioToFileDevice & | operator= (audioToFileDevice &&)=delete |
~audioToFileDevice () override | |
bool | open (yarp::os::Searchable &config) override |
Open the DeviceDriver. More... | |
bool | close () override |
Close the DeviceDriver. More... | |
virtual bool | renderSound (const yarp::sig::Sound &sound) override |
Render a sound using a device (i.e. More... | |
virtual bool | startPlayback () override |
Start the playback. More... | |
virtual bool | stopPlayback () override |
Stop the playback. More... | |
virtual bool | getPlaybackAudioBufferMaxSize (yarp::dev::AudioBufferSize &size) override |
virtual bool | getPlaybackAudioBufferCurrentSize (yarp::dev::AudioBufferSize &size) override |
virtual bool | resetPlaybackAudioBuffer () override |
Public Member Functions inherited from yarp::dev::DeviceDriver | |
~DeviceDriver () override=default | |
Destructor. More... | |
template<class T > | |
bool | view (T *&x) |
Get an interface to the device driver. More... | |
virtual DeviceDriver * | getImplementation () |
Some drivers are bureaucrats, pointing at others. More... | |
Public Member Functions inherited from yarp::os::IConfig | |
virtual | ~IConfig () |
Destructor. More... | |
virtual bool | configure (Searchable &config) |
Change online parameters. More... | |
Public Member Functions inherited from yarp::dev::IAudioRender | |
virtual | ~IAudioRender () |
Destructor. More... | |
audioToFileDevice
: This device driver, wrapped by default by AudioPlayerWrapper, is used to save to a file an audio stream.
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 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.
Parameters required by this device are:
Parameter name | SubParameter | Type | Units | Default Value | Required | Description | Notes |
---|---|---|---|---|---|---|---|
file_name | - | string | - | audio_out.wav | No | The name of the file written by the module | Only .wav files supported |
save_mode | - | string | - | overwrite_file | No | Affects the behavior of the module and defines the save mode, as described in the documentation. |
Definition at line 41 of file audioToFileDevice.h.
audioToFileDevice::audioToFileDevice | ( | ) |
Definition at line 31 of file audioToFileDevice.cpp.
|
delete |
|
delete |
|
override |
Definition at line 36 of file audioToFileDevice.cpp.
|
overridevirtual |
Close the DeviceDriver.
Reimplemented from yarp::dev::DeviceDriver.
Definition at line 97 of file audioToFileDevice.cpp.
|
overridevirtual |
Implements yarp::dev::IAudioRender.
Definition at line 103 of file audioToFileDevice.cpp.
|
overridevirtual |
Implements yarp::dev::IAudioRender.
Definition at line 110 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 41 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 |
Implements yarp::dev::IAudioRender.
Definition at line 148 of file audioToFileDevice.cpp.
|
overridevirtual |
Implements yarp::dev::IAudioRender.
Definition at line 117 of file audioToFileDevice.cpp.
|
overridevirtual |
Start the playback.
Implements yarp::dev::IAudioRender.
Definition at line 124 of file audioToFileDevice.cpp.
|
overridevirtual |
Stop the playback.
Implements yarp::dev::IAudioRender.
Definition at line 136 of file audioToFileDevice.cpp.