|
@@ -8,6 +8,9 @@
|
|
|
|
|
|
namespace snowboy_wakeup
|
|
|
{
|
|
|
+ std::string beep_filename;
|
|
|
+ std::string pre_param = "play -q --multi-threaded ";
|
|
|
+ std::string all_param;
|
|
|
//!
|
|
|
//! \brief The HotwordDetectorNode class Wraps the C++ 11 Snowboy detector in a ROS node
|
|
|
//!
|
|
@@ -32,12 +35,12 @@ namespace snowboy_wakeup
|
|
|
ROS_ERROR("Mandatory parameter 'model_filename' not present on the parameter server");
|
|
|
return false;
|
|
|
}
|
|
|
-
|
|
|
- std::string beep_filename;
|
|
|
+
|
|
|
if (!nh_p_.getParam("beep_filename", beep_filename))
|
|
|
{
|
|
|
ROS_WARN("Mandatory parameter 'beep_filename' not present on the parameter server");
|
|
|
}
|
|
|
+ all_param = pre_param + beep_filename;
|
|
|
|
|
|
std::string asr_topic;
|
|
|
if (!nh_p_.getParam("asr_topic", asr_topic))
|
|
@@ -113,13 +116,13 @@ namespace snowboy_wakeup
|
|
|
}
|
|
|
|
|
|
std_msgs::Int32 hotword_msg;
|
|
|
- int result = detector_.runDetection( &sample_array[0], msg->data.size()/2);
|
|
|
+ int result = detector_.runDetection( &sample_array[0], msg->data.size()/2);
|
|
|
if (result == 1)
|
|
|
{
|
|
|
ROS_DEBUG("wakeUp detected!");
|
|
|
hotword_msg.data = result;
|
|
|
hotword_pub_.publish(hotword_msg);
|
|
|
- system("play -q --multi-threaded " + beep_filename);
|
|
|
+ system(all_param.data());
|
|
|
}
|
|
|
else if (result == -3)
|
|
|
{
|