YARP
Yet Another Robot Platform
audioFromFileDevice.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2020 Istituto Italiano di Tecnologia (IIT)
3  * All rights reserved.
4  *
5  * This software may be modified and distributed under the terms of the
6  * BSD-3-Clause license. See the accompanying LICENSE file for details.
7  */
8 
10 #include <yarp/os/PeriodicThread.h>
13 #include <yarp/sig/Sound.h>
14 #include <yarp/sig/SoundFile.h>
15 
16 #include <string>
17 #include <mutex>
18 
37 {
38 public:
44  ~audioFromFileDevice() override;
45 
46  // Device Driver interface
47  bool open(yarp::os::Searchable &config) override;
48  bool close() override;
49 
50 private:
51  //thread
52  bool threadInit() override;
53  void run() override;
54 
55 private:
56  yarp::sig::Sound m_audioFile;
57  std::string m_audio_filename = "audio.wav";
58  size_t m_bpnt = 0;
59  size_t m_samples_to_be_copied = 512;
60 };
audioFromFileDevice
audioFromFileDevice : This device driver, wrapped by default by AudioRecorderWrapper,...
Definition: audioFromFileDevice.h:37
yarp::os::Searchable
A base class for nested structures that can be searched.
Definition: Searchable.h:69
audioFromFileDevice::close
bool close() override
Close the DeviceDriver.
Definition: audioFromFileDevice.cpp:98
yarp::dev::DeviceDriver
Interface implemented by all device drivers.
Definition: DeviceDriver.h:38
audioFromFileDevice::~audioFromFileDevice
~audioFromFileDevice() override
Definition: audioFromFileDevice.cpp:39
yarp::dev::AudioRecorderDeviceBase
Definition: AudioRecorderDeviceBase.h:34
audioFromFileDevice::audioFromFileDevice
audioFromFileDevice()
Definition: audioFromFileDevice.cpp:34
audioFromFileDevice::operator=
audioFromFileDevice & operator=(audioFromFileDevice &&)=delete
audioFromFileDevice::open
bool open(yarp::os::Searchable &config) override
Open the DeviceDriver.
Definition: audioFromFileDevice.cpp:44
audioFromFileDevice::audioFromFileDevice
audioFromFileDevice(const audioFromFileDevice &)=delete
audioFromFileDevice::audioFromFileDevice
audioFromFileDevice(audioFromFileDevice &&)=delete
yarp::os::PeriodicThread
An abstraction for a periodic thread.
Definition: PeriodicThread.h:25
PeriodicThread.h
yarp::sig::Sound
Class for storing sounds.
Definition: Sound.h:28
SoundFile.h
IGenericSensor.h
AudioRecorderDeviceBase.h
audioFromFileDevice::operator=
audioFromFileDevice & operator=(const audioFromFileDevice &)=delete
Sound.h
DeviceDriver.h