Skip to content

Commit

Permalink
Merge pull request robotology#2672 from randaz81/doc_audio_fix
Browse files Browse the repository at this point in the history
Doc audio fix
  • Loading branch information
drdanz authored Aug 2, 2021
2 parents c56cbc9 + 3c323e8 commit fb23c99
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions doc/audio_doc.dox
Original file line number Diff line number Diff line change
Expand Up @@ -105,19 +105,19 @@ yarp connect /audioRecorderWrapper/audio:o /audioPlayerWrapper/audio:i
The following example grabs data from a microphone, sends data through the network, and saves it to a file.
The chosen configuration forces the recorderWrapper to send data packets composed by 3200 samples, corresponding to 0.2s.
\code
yarpdev --device audioRecorderWrapper --subdevice portaudioRecorder --start --min_samples_over_network 3200 --max_samples_over_network 3200 --AUDIO_BASE::rate 16000 --AUDIO_BASE::samples 3200 --AUDIO_BASE::channels 1
yarpdev --device audioRecorderWrapper --subdevice portaudioRecorder --start --min_samples_over_network 3200 --max_samples_over_network 3200 --AUDIO_BASE::rate 16000 --AUDIO_BASE::samples 6400 --AUDIO_BASE::channels 1
yarpdev --device audioPlayerWrapper --subdevice audioToFileDevice --start --file_name audio_out.wav --save_mode overwrite_file
yarp connect /audioPlayerWrapper/audio:o /audioPlayerWrapper/audio:i
yarp connect /audioRecorderWrapper/audio:o /audioPlayerWrapper/audio:i
\endcode


\section AudioLimitations Limitations
The audio system currently do not support real-time audio transmission for audio conference purposes. Of course the systems allows to do it, as shown in
following example:
\code
yarpdev --device audioRecorderWrapper --subdevice portaudioRecorder --start --min_samples_over_network 3200 --max_samples_over_network 3200 --AUDIO_BASE::rate 16000 --AUDIO_BASE::samples 3200 --AUDIO_BASE::channels 1
yarpdev --device audioRecorderWrapper --subdevice portaudioRecorder --start --min_samples_over_network 3200 --max_samples_over_network 3200 --AUDIO_BASE::rate 16000 --AUDIO_BASE::samples 6400 --AUDIO_BASE::channels 1
yarpdev --device audioPlayerWrapper --subdevice portaudioPlayer --start --playback_network_buffer_size 0.1 --AUDIO_BASE::samples 32000
yarp connect /audioPlayerWrapper/audio:o /audioPlayerWrapper/audio:i
yarp connect /audioRecorderWrapper/audio:o /audioPlayerWrapper/audio:i
\endcode
This example has several problems. First of some inevitable pop-clicks distortions will be happens,
due to the fact the finite buffers have finite size. Since the network transmission has physical non-zero latency, the receiver accumulates
Expand Down
2 changes: 1 addition & 1 deletion src/libYARP_dev/src/yarp/dev/AudioRecorderDeviceBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ bool AudioRecorderDeviceBase::getSound(yarp::sig::Sound& sound, size_t min_numbe
}
if (max_number_of_samples > this->m_audiorecorder_cfg.numSamples)
{
yCWarning(AUDIORECORDER_BASE) << "max_number_of_samples bigger than the internal audio buffer! It will be truncated to:" << this->m_audiorecorder_cfg.numSamples;
yCWarning(AUDIORECORDER_BASE) << "max_number_of_samples ("<< max_number_of_samples <<") is bigger than the internal audio buffer! It will be truncated to:" << this->m_audiorecorder_cfg.numSamples;
max_number_of_samples = this->m_audiorecorder_cfg.numSamples;
}

Expand Down

0 comments on commit fb23c99

Please sign in to comment.