YARP
Yet Another Robot Platform
ServerSoundGrabber.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3  * SPDX-FileCopyrightText: 2006 Julio Gomes
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #ifndef YARP_DEV_SERVERSOUNDGRABBER_H
8 #define YARP_DEV_SERVERSOUNDGRABBER_H
9 
10 #include <yarp/os/Port.h>
11 #include <yarp/os/Stamp.h>
12 #include <yarp/os/Thread.h>
13 
15 #include <yarp/dev/PolyDriver.h>
16 
17 
26  private yarp::os::Thread,
28 {
29 private:
30  yarp::os::Stamp stamp;
32  yarp::dev::IAudioGrabberSound* mic{nullptr}; //The microphone device
33  yarp::os::Port rpcPort;
34  yarp::os::Port streamingPort;
35 #ifdef DEBUG_TIME_SPENT
36  double last_time;
37 #endif
38 public:
44 
45  ~ServerSoundGrabber() override;
46 
47 
58  bool open(yarp::os::Searchable& config) override;
59  bool close() override;
60 
61  void run() override;
62 
63  bool read(yarp::os::ConnectionReader& connection) override;
64 };
65 
66 #endif // YARP_DEV_SERVERSOUNDGRABBER_H
ServerSoundGrabber: Export a microphone device streaming sound samples
bool close() override
Close the DeviceDriver.
bool open(yarp::os::Searchable &config) override
Configure with a set of options.
ServerSoundGrabber(const ServerSoundGrabber &)=delete
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
ServerSoundGrabber(ServerSoundGrabber &&)=delete
ServerSoundGrabber & operator=(const ServerSoundGrabber &)=delete
void run() override
Main body of the new thread.
ServerSoundGrabber & operator=(ServerSoundGrabber &&)=delete
Interface implemented by deprecated device drivers.
Definition: DeviceDriver.h:116
Read a YARP-format sound block from a device.
A container for a device driver.
Definition: PolyDriver.h:24
An interface for reading from a network connection.
Interface implemented by all objects that can read themselves from the network, such as Bottle object...
Definition: PortReader.h:25
A mini-server for network communication.
Definition: Port.h:47
A base class for nested structures that can be searched.
Definition: Searchable.h:66
An abstraction for a time stamp and/or sequence number.
Definition: Stamp.h:22
An abstraction for a thread of execution.
Definition: Thread.h:22