Browse Source

update wakeup_processer

master
zhaohe 2 years ago
parent
commit
f132c38e6a
  1. 4
      sh/packet.sh
  2. 6
      src/service/voiceprocess/wakeup_processer.cpp
  3. 2
      src/service/voiceprocess/wakeup_processer.hpp

4
sh/packet.sh

@ -56,6 +56,7 @@ cd $PROJECT_PATH/env/ && cp --path -rf ./* $PACKET_DIR/
####################################################################
# 下载唤醒词模型
wget_and_unzip xiaomaoxiaomao ftp://zftpuser:zftpzwsd@192.168.1.2/zwsd/manufacturer_mycroft/hotworld/xiaomaoxiaomao/xiaomaoxiaomao_module_20220519.tar.gz
mv $PACKET_DIR/xiaomaoxiaomao $PACKET_DIR/wakeupmodule
# 下载唤醒词引擎
if [ "$BUILDFOR" == "rk3328" ]; then
wget_and_unzip precise 192.168.1.2:8021/manufacturer_mycroft/mycroft-precise-release/precise-all_0.3.0_aarch64.tar.gz
@ -63,9 +64,6 @@ fi
# 下载唤醒词语音
wget_and_cpy 192.168.1.2:8021/manufacturer_mycroft/hotworld/xiaomaoxiaomao/test_xiaomaoxiaomao.wav
####################################################################
####################################################################

6
src/service/voiceprocess/wakeup_processer.cpp

@ -4,12 +4,12 @@ using namespace iflytop;
using namespace core;
#define ORDER_PATH "precise-engine/precise-engine"
#define WAKEUP_MODULE_PATH "module/wakeup.pb"
// #define WAKEUP_MODULE_PATH "module/wakeup.pb"
#define CHUNK_SIZE "2048"
void WakeupProcesser::initialize() {
void WakeupProcesser::initialize(string wakeupmodule) {
wakeupProcesser.reset(new MycroftPreciseWapper());
wakeupProcesser->initialize(ORDER_PATH, WAKEUP_MODULE_PATH, CHUNK_SIZE);
wakeupProcesser->initialize(ORDER_PATH, wakeupmodule.c_str(), CHUNK_SIZE);
}
void WakeupProcesser::dumpwakeup_info(float source) {
if (source > 0.9) {

2
src/service/voiceprocess/wakeup_processer.hpp

@ -47,7 +47,7 @@ class WakeupProcesser : public enable_shared_from_this<WakeupProcesser> {
public:
WakeupProcesser(){};
void initialize();
void initialize(string wakeupmodule);
void processVoice(uint8_t* voice, size_t voiceLen);

Loading…
Cancel
Save