YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
AudioRecorder_nwc_yarp.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2023-2023 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5
6#ifndef YARP_DEV_AUDIORECORDER_NWC_YARP_H
7#define YARP_DEV_AUDIORECORDER_NWC_YARP_H
8
9
10#include <yarp/os/Network.h>
13#include <yarp/sig/Vector.h>
14#include <yarp/os/Time.h>
15#include <yarp/os/Stamp.h>
16#include <yarp/dev/PolyDriver.h>
17
18#include "IAudioGrabberMsgs.h"
19#include <mutex>
21
23{
24 yarp::sig::Sound lastSound;
25 yarp::os::Stamp lastStamp;
26 std::mutex mutex;
27
28public:
30
32 void onRead(yarp::sig::Sound& v) override;
33
34 inline bool getLast(yarp::sig::Sound& data, yarp::os::Stamp& stmp);
35};
36
52{
53protected:
57 std::mutex m_mutex;
58
59public:
60
61 /* DeviceDriver methods */
62 bool open(yarp::os::Searchable& config) override;
63 bool close() override;
64
65 /* IAudioGrabberSound */
66 virtual yarp::dev::ReturnValue getSound(yarp::sig::Sound& sound, size_t min_number_of_samples, size_t max_number_of_samples, double max_samples_timeout_s) override;
67 virtual yarp::dev::ReturnValue startRecording() override;
68 virtual yarp::dev::ReturnValue stopRecording() override;
69 virtual yarp::dev::ReturnValue isRecording(bool& recording_enabled) override;
73 virtual yarp::dev::ReturnValue setSWGain(double gain) override;
74 virtual yarp::dev::ReturnValue setHWGain(double gain) override;
75
76};
77
78#endif // YARP_DEV_AUDIORECORDER_NWC_YARP_H
contains the definition of a Vector type
bool getLast(yarp::sig::Sound &data, yarp::os::Stamp &stmp)
void onRead(yarp::sig::Sound &v) override
This class is the parameters parser for class AudioRecorder_nwc_yarp.
audioRecoder_nwc_yarp: The client side of any IAudioGrabberSound capable device.
IAudioGrabberMsgs m_audiograb_RPC
bool close() override
Close the DeviceDriver.
virtual yarp::dev::ReturnValue startRecording() override
Start the recording.
virtual yarp::dev::ReturnValue getRecordingAudioBufferMaxSize(yarp::sig::AudioBufferSize &size) override
virtual yarp::dev::ReturnValue resetRecordingAudioBuffer() override
virtual yarp::dev::ReturnValue isRecording(bool &recording_enabled) override
Check if the recording has been enabled (e.g.
bool open(yarp::os::Searchable &config) override
Open the DeviceDriver.
virtual yarp::dev::ReturnValue getSound(yarp::sig::Sound &sound, size_t min_number_of_samples, size_t max_number_of_samples, double max_samples_timeout_s) override
Get a sound from a device.
virtual yarp::dev::ReturnValue setHWGain(double gain) override
Sets the hardware gain of the grabbing device (if supported by the hardware)
AudioRecorder_InputPortProcessor m_inputPort
virtual yarp::dev::ReturnValue stopRecording() override
Stop the recording.
virtual yarp::dev::ReturnValue setSWGain(double gain) override
Sets a software gain for the grabbed audio.
virtual yarp::dev::ReturnValue getRecordingAudioBufferCurrentSize(yarp::sig::AudioBufferSize &size) override
Interface implemented by all device drivers.
Read a YARP-format sound block from a device.
A mini-server for performing network communication in the background.
A mini-server for network communication.
Definition Port.h:46
A base class for nested structures that can be searched.
Definition Searchable.h:31
An abstraction for a time stamp and/or sequence number.
Definition Stamp.h:21
Class for storing sounds See Audio in YARP for additional documentation on YARP audio.
Definition Sound.h:25