[DEV] Update new audio::Time
This commit is contained in:
parent
666fa1375f
commit
6f0c0f2088
@ -12,7 +12,7 @@ find_package(catkin REQUIRED COMPONENTS
|
||||
std_msgs
|
||||
audio_msg
|
||||
message_generation
|
||||
river
|
||||
audio_river
|
||||
)
|
||||
|
||||
################################################
|
||||
|
@ -23,10 +23,10 @@
|
||||
<build_depend>rospy</build_depend>
|
||||
<build_depend>std_msgs</build_depend>
|
||||
<build_depend>audio_msg</build_depend>
|
||||
<build_depend>river</build_depend>
|
||||
<build_depend>audio_river</build_depend>
|
||||
<run_depend>roscpp</run_depend>
|
||||
<run_depend>rospy</run_depend>
|
||||
<run_depend>std_msgs</run_depend>
|
||||
<run_depend>audio_msg</run_depend>
|
||||
<run_depend>river</run_depend>
|
||||
<run_depend>audio_river</run_depend>
|
||||
</package>
|
@ -12,7 +12,7 @@
|
||||
#include <audio_msg/AudioBuffer.h>
|
||||
#include <boost/thread.hpp>
|
||||
|
||||
appl::InterfaceInput::InterfaceInput(std11::shared_ptr<river::Manager> _manager,
|
||||
appl::InterfaceInput::InterfaceInput(std11::shared_ptr<audio::river::Manager> _manager,
|
||||
const std::string& _input,
|
||||
const std::string& _publisher,
|
||||
bool _feedback) :
|
||||
@ -67,7 +67,7 @@ void appl::InterfaceInput::onDisConnect(const ros::SingleSubscriberPublisher& _p
|
||||
APPL_ERROR("on dis-connect ... " << _pub.getSubscriberName());
|
||||
}
|
||||
void appl::InterfaceInput::onDataReceived(const void* _data,
|
||||
const std11::chrono::system_clock::time_point& _time,
|
||||
const audio::Time& _time,
|
||||
size_t _nbChunk,
|
||||
enum audio::format _format,
|
||||
uint32_t _frequency,
|
||||
|
@ -9,17 +9,17 @@
|
||||
#ifndef __AUDIO_CORE_INTERFACE_INPUT_H__
|
||||
#define __AUDIO_CORE_INTERFACE_INPUT_H__
|
||||
|
||||
#include <river/Manager.h>
|
||||
#include <audio/river/Manager.h>
|
||||
|
||||
namespace appl {
|
||||
class InterfaceInput {
|
||||
public:
|
||||
std11::shared_ptr<river::Manager> m_manager;
|
||||
std11::shared_ptr<river::Interface> m_interface;
|
||||
std11::shared_ptr<audio::river::Manager> m_manager;
|
||||
std11::shared_ptr<audio::river::Interface> m_interface;
|
||||
ros::Publisher m_stream;
|
||||
std11::mutex mutex;
|
||||
public:
|
||||
InterfaceInput(std11::shared_ptr<river::Manager> _manager,
|
||||
InterfaceInput(std11::shared_ptr<audio::river::Manager> _manager,
|
||||
const std::string& _input="microphone",
|
||||
const std::string& _publisher="microphone",
|
||||
bool _feedback=false);
|
||||
@ -28,7 +28,7 @@ namespace appl {
|
||||
void onConnect(const ros::SingleSubscriberPublisher& _pub);
|
||||
void onDisConnect(const ros::SingleSubscriberPublisher& _pub);
|
||||
void onDataReceived(const void* _data,
|
||||
const std11::chrono::system_clock::time_point& _time,
|
||||
const audio::Time& _time,
|
||||
size_t _nbChunk,
|
||||
enum audio::format _format,
|
||||
uint32_t _frequency,
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include "debug.h"
|
||||
#include "InterfaceOutputElement.h"
|
||||
|
||||
appl::InterfaceOutputElement::InterfaceOutputElement(const std11::shared_ptr<river::Manager>& _manager, int32_t _id) :
|
||||
appl::InterfaceOutputElement::InterfaceOutputElement(const std11::shared_ptr<audio::river::Manager>& _manager, int32_t _id) :
|
||||
m_id(_id),
|
||||
m_nbConsecutiveUnderflow(0),
|
||||
m_manager(_manager) {
|
||||
|
@ -9,8 +9,8 @@
|
||||
#ifndef __AUDIO_CORE_INTERFACE_OUTPUT_ELEMENT_H__
|
||||
#define __AUDIO_CORE_INTERFACE_OUTPUT_ELEMENT_H__
|
||||
|
||||
#include <river/Manager.h>
|
||||
#include <river/Interface.h>
|
||||
#include <audio/river/Manager.h>
|
||||
#include <audio/river/Interface.h>
|
||||
#include <ros/ros.h>
|
||||
#include <audio_msg/AudioBuffer.h>
|
||||
|
||||
@ -29,11 +29,11 @@ namespace appl {
|
||||
return m_nbConsecutiveUnderflow;
|
||||
}
|
||||
private:
|
||||
std11::shared_ptr<river::Manager> m_manager;
|
||||
std11::shared_ptr<river::Interface> m_interface;
|
||||
std11::shared_ptr<audio::river::Manager> m_manager;
|
||||
std11::shared_ptr<audio::river::Interface> m_interface;
|
||||
std11::mutex m_mutex;
|
||||
public:
|
||||
InterfaceOutputElement(const std11::shared_ptr<river::Manager>& _manager, int32_t _id);
|
||||
InterfaceOutputElement(const std11::shared_ptr<audio::river::Manager>& _manager, int32_t _id);
|
||||
~InterfaceOutputElement();
|
||||
void onTopicMessage(const std::string& _streamName, const audio_msg::AudioBuffer::ConstPtr& _msg);
|
||||
void onStatus(const std::string& _origin, const std::string& _status, int32_t _iii);
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
appl::InterfaceOutputManager::InterfaceOutputManager(const std::string& _name) :
|
||||
m_name(_name) {
|
||||
m_manager = river::Manager::create(m_name);
|
||||
m_manager = audio::river::Manager::create(m_name);
|
||||
APPL_INFO("Create Manager : " << m_name);
|
||||
}
|
||||
|
||||
|
@ -22,7 +22,7 @@ namespace appl {
|
||||
return m_name;
|
||||
}
|
||||
private:
|
||||
std11::shared_ptr<river::Manager> m_manager;
|
||||
std11::shared_ptr<audio::river::Manager> m_manager;
|
||||
std::vector<std11::shared_ptr<appl::InterfaceOutputElement> > m_elementList;
|
||||
std11::mutex m_mutex;
|
||||
public:
|
||||
|
@ -5,9 +5,9 @@
|
||||
#include "audio_core/create.h"
|
||||
#include "audio_core/remove.h"
|
||||
#include "audio_core/getBufferTime.h"
|
||||
#include <river/river.h>
|
||||
#include <river/Interface.h>
|
||||
#include <river/Manager.h>
|
||||
#include <audio/river/river.h>
|
||||
#include <audio/river/Interface.h>
|
||||
#include <audio/river/Manager.h>
|
||||
#include <boost/thread.hpp>
|
||||
#include <sstream>
|
||||
#include "debug.h"
|
||||
@ -21,7 +21,7 @@ static std11::mutex mutex;
|
||||
#include "InterfaceOutput.h"
|
||||
|
||||
|
||||
std11::shared_ptr<river::Manager> g_manager;
|
||||
std11::shared_ptr<audio::river::Manager> g_manager;
|
||||
|
||||
bool f_create(audio_core::create::Request& _req,
|
||||
audio_core::create::Response& _res) {
|
||||
@ -155,7 +155,7 @@ int main(int _argc, char **_argv) {
|
||||
APPL_INFO("Find hardware configuration ... : '" << hardwareInterface << "'");
|
||||
}
|
||||
}
|
||||
river::init(hardwareInterface);
|
||||
audio::river::init(hardwareInterface);
|
||||
|
||||
ros::NodeHandle n;
|
||||
|
||||
@ -163,7 +163,7 @@ int main(int _argc, char **_argv) {
|
||||
ros::ServiceServer serviceRemove = n.advertiseService("remove", f_remove);
|
||||
ros::ServiceServer serviceGetBufferTime = n.advertiseService("getBufferTime", f_getBufferTime);
|
||||
|
||||
g_manager = river::Manager::create(n.getNamespace());
|
||||
g_manager = audio::river::Manager::create(n.getNamespace());
|
||||
// start publishing of Microphone
|
||||
std11::shared_ptr<appl::InterfaceInput> m_input = std11::make_shared<appl::InterfaceInput>(g_manager, "microphone", "microphone", false);
|
||||
// start publishing of Speaker feedback
|
||||
@ -179,7 +179,7 @@ int main(int _argc, char **_argv) {
|
||||
m_input.reset();
|
||||
m_feedback.reset();
|
||||
g_manager.reset();
|
||||
river::unInit();
|
||||
audio::river::unInit();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -22,11 +22,12 @@ uint8 FORMAT_INT8_ON_INT16=2
|
||||
uint8 FORMAT_INT16=3
|
||||
uint8 FORMAT_INT16_ON_INT32=4
|
||||
uint8 FORMAT_INT24=5
|
||||
uint8 FORMAT_INT32=6
|
||||
uint8 FORMAT_INT32_ON_INT64=7
|
||||
uint8 FORMAT_INT64=8
|
||||
uint8 FORMAT_FLOAT=9
|
||||
uint8 FORMAT_DOUBLE=10
|
||||
uint8 FORMAT_INT24_ON_INT32=6
|
||||
uint8 FORMAT_INT32=7
|
||||
uint8 FORMAT_INT32_ON_INT64=8
|
||||
uint8 FORMAT_INT64=9
|
||||
uint8 FORMAT_FLOAT=10
|
||||
uint8 FORMAT_DOUBLE=11
|
||||
|
||||
##########
|
||||
# Message:
|
||||
|
Loading…
Reference in New Issue
Block a user