YARP
Yet Another Robot Platform
audioToFileDevice Class Reference

audioToFileDevice : This device driver, wrapped by default by AudioPlayerWrapper, is used to save to a file an audio stream. More...

#include <audioToFileDevice/audioToFileDevice.h>

+ Inheritance diagram for audioToFileDevice:

Public Member Functions

 audioToFileDevice ()
 
 audioToFileDevice (const audioToFileDevice &)=delete
 
 audioToFileDevice (audioToFileDevice &&)=delete
 
audioToFileDeviceoperator= (const audioToFileDevice &)=delete
 
audioToFileDeviceoperator= (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 DeviceDrivergetImplementation ()
 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...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ audioToFileDevice() [1/3]

audioToFileDevice::audioToFileDevice ( )

Definition at line 31 of file audioToFileDevice.cpp.

◆ audioToFileDevice() [2/3]

audioToFileDevice::audioToFileDevice ( const audioToFileDevice )
delete

◆ audioToFileDevice() [3/3]

audioToFileDevice::audioToFileDevice ( audioToFileDevice &&  )
delete

◆ ~audioToFileDevice()

audioToFileDevice::~audioToFileDevice ( )
override

Definition at line 36 of file audioToFileDevice.cpp.

Member Function Documentation

◆ close()

bool audioToFileDevice::close ( )
overridevirtual

Close the DeviceDriver.

Returns
true/false on success/failure.

Reimplemented from yarp::dev::DeviceDriver.

Definition at line 97 of file audioToFileDevice.cpp.

◆ getPlaybackAudioBufferCurrentSize()

bool audioToFileDevice::getPlaybackAudioBufferCurrentSize ( yarp::dev::AudioBufferSize size)
overridevirtual

Implements yarp::dev::IAudioRender.

Definition at line 103 of file audioToFileDevice.cpp.

◆ getPlaybackAudioBufferMaxSize()

bool audioToFileDevice::getPlaybackAudioBufferMaxSize ( yarp::dev::AudioBufferSize size)
overridevirtual

Implements yarp::dev::IAudioRender.

Definition at line 110 of file audioToFileDevice.cpp.

◆ open()

bool audioToFileDevice::open ( yarp::os::Searchable config)
overridevirtual

Open the DeviceDriver.

Parameters
configis 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).
Returns
true/false upon success/failure

Reimplemented from yarp::dev::DeviceDriver.

Definition at line 41 of file audioToFileDevice.cpp.

◆ operator=() [1/2]

audioToFileDevice& audioToFileDevice::operator= ( audioToFileDevice &&  )
delete

◆ operator=() [2/2]

audioToFileDevice& audioToFileDevice::operator= ( const audioToFileDevice )
delete

◆ renderSound()

bool audioToFileDevice::renderSound ( const yarp::sig::Sound sound)
overridevirtual

Render a sound using a device (i.e.

send it to the speakers).

Parameters
soundthe sound to be rendered
Returns
true/false upon success/failure

Implements yarp::dev::IAudioRender.

Definition at line 148 of file audioToFileDevice.cpp.

◆ resetPlaybackAudioBuffer()

bool audioToFileDevice::resetPlaybackAudioBuffer ( )
overridevirtual

Implements yarp::dev::IAudioRender.

Definition at line 117 of file audioToFileDevice.cpp.

◆ startPlayback()

bool audioToFileDevice::startPlayback ( )
overridevirtual

Start the playback.

Returns
true/false upon success/failure

Implements yarp::dev::IAudioRender.

Definition at line 124 of file audioToFileDevice.cpp.

◆ stopPlayback()

bool audioToFileDevice::stopPlayback ( )
overridevirtual

Stop the playback.

Returns
true/false upon success/failure

Implements yarp::dev::IAudioRender.

Definition at line 136 of file audioToFileDevice.cpp.


The documentation for this class was generated from the following files: