YARP
Yet Another Robot Platform
ServerSoundGrabber.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2020 Istituto Italiano di Tecnologia (IIT)
3  * Copyright (C) 2006 Julio Gomes
4  * All rights reserved.
5  *
6  * This software may be modified and distributed under the terms of the
7  * BSD-3-Clause license. See the accompanying LICENSE file for details.
8  */
9 
10 #ifndef YARP_DEV_SERVERSOUNDGRABBER_H
11 #define YARP_DEV_SERVERSOUNDGRABBER_H
12 
13 #include <yarp/os/Port.h>
14 #include <yarp/os/Stamp.h>
15 #include <yarp/os/Thread.h>
16 
18 #include <yarp/dev/PolyDriver.h>
19 
20 
29  private yarp::os::Thread,
31 {
32 private:
33  yarp::os::Stamp stamp;
35  yarp::dev::IAudioGrabberSound* mic{nullptr}; //The microphone device
36  yarp::os::Port rpcPort;
37  yarp::os::Port streamingPort;
38 #ifdef DEBUG_TIME_SPENT
39  double last_time;
40 #endif
41 public:
47 
48  ~ServerSoundGrabber() override;
49 
50 
61  bool open(yarp::os::Searchable& config) override;
62  bool close() override;
63 
64  void run() override;
65 
66  bool read(yarp::os::ConnectionReader& connection) override;
67 };
68 
69 #endif // YARP_DEV_SERVERSOUNDGRABBER_H
ServerSoundGrabber
ServerSoundGrabber: Export a microphone device streaming sound samples
Definition: ServerSoundGrabber.h:31
yarp::os::Searchable
A base class for nested structures that can be searched.
Definition: Searchable.h:69
ServerSoundGrabber::close
bool close() override
Close the DeviceDriver.
Definition: ServerSoundGrabber.cpp:106
Port.h
AudioGrabberInterfaces.h
yarp::os::Thread
An abstraction for a thread of execution.
Definition: Thread.h:25
ServerSoundGrabber::operator=
ServerSoundGrabber & operator=(const ServerSoundGrabber &)=delete
ServerSoundGrabber::open
bool open(yarp::os::Searchable &config) override
Configure with a set of options.
Definition: ServerSoundGrabber.cpp:49
ServerSoundGrabber::ServerSoundGrabber
ServerSoundGrabber(ServerSoundGrabber &&)=delete
yarp::os::Port
A mini-server for network communication.
Definition: Port.h:50
yarp::dev::IAudioGrabberSound
Read a YARP-format sound block from a device.
Definition: IAudioGrabberSound.h:26
yarp::os::PortReader
Interface implemented by all objects that can read themselves from the network, such as Bottle object...
Definition: PortReader.h:28
PolyDriver.h
Stamp.h
yarp::dev::PolyDriver
A container for a device driver.
Definition: PolyDriver.h:27
ServerSoundGrabber::ServerSoundGrabber
ServerSoundGrabber(const ServerSoundGrabber &)=delete
Thread.h
ServerSoundGrabber::read
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
Definition: ServerSoundGrabber.cpp:164
ServerSoundGrabber::operator=
ServerSoundGrabber & operator=(ServerSoundGrabber &&)=delete
yarp::os::ConnectionReader
An interface for reading from a network connection.
Definition: ConnectionReader.h:40
yarp::os::Stamp
An abstraction for a time stamp and/or sequence number.
Definition: Stamp.h:25
ServerSoundGrabber::~ServerSoundGrabber
~ServerSoundGrabber() override
Definition: ServerSoundGrabber.cpp:32
yarp::dev::DeprecatedDeviceDriver
Interface implemented by deprecated device drivers.
Definition: DeviceDriver.h:119
ServerSoundGrabber::run
void run() override
Main body of the new thread.
Definition: ServerSoundGrabber.cpp:122
ServerSoundGrabber::ServerSoundGrabber
ServerSoundGrabber()
Definition: ServerSoundGrabber.cpp:25