Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Audio volume #2433

Merged
merged 23 commits into from
Apr 7, 2021
Merged

Audio volume #2433

merged 23 commits into from
Apr 7, 2021

Conversation

randaz81
Copy link
Member

@randaz81 randaz81 commented Dec 12, 2020

yarp::sig

  • yarp::sig::sound added the following methods: amplifyChannel(), amplify(), findPeakInChannel(), findPeak(), normalizeChannel(), normalize()
  • harness_sig: added tests to check the new methods

yarp::dev

  • Added the new datatypes yarp::dev::audioRecorderStatus and yarp::dev::audioPlaybackStatus generated by thrift.
  • Added the new class AudioPlayerDeviceBase, all playback device drivers now derive from this class.
  • Added the new class AudioRecorerDeviceBase, all recording device drivers now derive from this class.
  • Added the new methods to setHWGain(), setSWGain() to IAudioRender interface.
  • Added the new methods to setHWGain(), setSWGain() to IAudioGrabberSound interface.

Devices

  • Added RPC commands to AudioPlayerWrapper and AudioRecorderWrapper, to control the volume via setHWGain(), setSWGain()`
  • AudioPlayerWrapper and AudioRecorderWrapper now broadcast their internal status on a xxx/status:o port
  • All playback device drivers, i.e. audioToFileDevice, fakeSpeaker, portaudioPlayer ,now derive from AudioPlayerDeviceBase.
  • All recording device drivers, i.e. audioFromFileDevice,fakeMicrophone,portaadioRecorder, now derive from AudioRecorderDeviceBase.

@randaz81

This comment has been minimized.

@randaz81 randaz81 changed the title Audio volume [WIP} Audio volume Jan 15, 2021
@randaz81 randaz81 changed the title [WIP} Audio volume [WIP] Audio volume Jan 15, 2021
@randaz81
Copy link
Member Author

randaz81 commented Jan 15, 2021

  • This PR needs a major revision.
  • The volume management logic will be moved from the wrapper to... elsewhere.

@drdanz drdanz marked this pull request as draft January 28, 2021 11:44
@randaz81 randaz81 force-pushed the audio_volume branch 3 times, most recently from 4263065 to 5f1f6f7 Compare February 9, 2021 13:55
@randaz81 randaz81 changed the title [WIP] Audio volume Audio volume Feb 9, 2021
@randaz81 randaz81 marked this pull request as ready for review February 9, 2021 14:04
@randaz81
Copy link
Member Author

randaz81 commented Feb 9, 2021

The following devices have been tested:

  • audioFromFile
  • audioToFile
  • fakeMicrophone
  • fakeSpeaker
  • portAudioPlayer
  • portAudioRecorder

The PR could be merged only after all of these devices have been tested

@randaz81

This comment has been minimized.

@randaz81

This comment has been minimized.

@randaz81 randaz81 temporarily deployed to code-analysis March 9, 2021 14:26 Inactive
randaz81 and others added 22 commits April 7, 2021 17:32
…: amplifyChannel(), amplify(), findPeakInChannel(), findPeak(), normalizeChannel(), normalize()

* Added SoundTest to harness_sig
* Added the new class `AudioPlayerDeviceBase`, all playback device drivers now derive from this class.
* Added the new methods to `setHWGain()`, `setHWGain()` to `IAudioRender` interface.
* Added the new methods to `setHWGain()`, `setHWGain()` to `IAudioGrabberSound` interface.
Improved `AudioPlayerDeviceBase` and `AudioRecorderDeviceBase` classes to remove duplicated code (e.g. parameters parsing and render modes)
Untested.
…arser of the base parameters in the base class
… parsed by AudioPlayerDeviceBase, AudioRecorderDeviceBase classes
…derStatus.h

some logic related to playback autostart has been completely removed
PortAudioPlayerDeviceDriver has been successfully test
virtual bool IAudioRender::isPlaying(bool& playback_enabled) = 0;
virtual bool IAudioGrabberSound::isRecording(bool& recording_enabled) = 0;
they have been implemented in AudioPlayerDeviceBase and AudioRecorderDeviceBase
AudioPlayerWrapper and AudioRecorderWrapper now asks the status to the device
…iceBase: it waits in a loop until the buffer size is zero (all the audio samples have been consumed)

fakeSpeaker logic of buffere management improved
fakeSpeaker successfully tested
…to prevent access to not yet allocated audio buffer

* audioToFileDevice cleanup + added support to write .mp3 files
* audioToFileDevice successfully tested
…of the device and to get the audio data from the device
…re the two recording channels.

PortAudioRecorderDeviceDriver successfully tested.
Audio from PortAudioRecorderDeviceDriver successfully played onto PortAudioPlayerDeviceDriver
…m_irender==nullptr if the device was not successfully initialized
…ult: false) and `audioRecorderDeviceBase` (default: true)
…O_BASE::debug for all audio devices

*General cleanup
*Fixed number of channels for audioFromFileDevice
*AudioFromFileDevice successfully test
@drdanz drdanz merged commit ae04829 into robotology:master Apr 7, 2021
@drdanz
Copy link
Member

drdanz commented Apr 7, 2021

Merged, thanks.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Component: Devices Component: Library - YARP_sig PR Status: Continuous Integration - OK Continuous Integration for this PR passed (invalid if commits were added or modified after this) PR Type: Feat/Enh This PR adds some new feature or enhances some part of YARP Target: YARP v3.5.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants