代码拉取完成,页面将自动刷新
同步操作将从 华清远见西安中心/智能音箱(C语言) 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
// snowboy-detect-c-wrapper.cc
// Copyright 2017 KITT.AI (author: Guoguo Chen)
#include <assert.h>
#include "snowboy-detect-c-wrapper.h"
#include "include/snowboy-detect.h"
extern "C" {
SnowboyDetect* SnowboyDetectConstructor(const char* const resource_filename,
const char* const model_str) {
return reinterpret_cast<SnowboyDetect*>(
new snowboy::SnowboyDetect(resource_filename, model_str));
}
bool SnowboyDetectReset(SnowboyDetect* detector) {
assert(detector != NULL);
return reinterpret_cast<snowboy::SnowboyDetect*>(detector)->Reset();
}
int SnowboyDetectRunDetection(SnowboyDetect* detector,
const int16_t* const data,
const int array_length, bool is_end) {
assert(detector != NULL);
assert(data != NULL);
return reinterpret_cast<snowboy::SnowboyDetect*>(
detector)->RunDetection(data, array_length, is_end);
}
void SnowboyDetectSetSensitivity(SnowboyDetect* detector,
const char* const sensitivity_str) {
assert(detector != NULL);
reinterpret_cast<snowboy::SnowboyDetect*>(
detector)->SetSensitivity(sensitivity_str);
}
void SnowboyDetectSetAudioGain(SnowboyDetect* detector,
const float audio_gain) {
assert(detector != NULL);
reinterpret_cast<snowboy::SnowboyDetect*>(
detector)->SetAudioGain(audio_gain);
}
void SnowboyDetectUpdateModel(SnowboyDetect* detector) {
assert(detector != NULL);
reinterpret_cast<snowboy::SnowboyDetect*>(detector)->UpdateModel();
}
void SnowboyDetectApplyFrontend(SnowboyDetect* detector,
const bool apply_frontend) {
assert(detector != NULL);
reinterpret_cast<snowboy::SnowboyDetect*>(
detector)->ApplyFrontend(apply_frontend);
}
int SnowboyDetectNumHotwords(SnowboyDetect* detector) {
assert(detector != NULL);
return reinterpret_cast<snowboy::SnowboyDetect*>(detector)->NumHotwords();
}
int SnowboyDetectSampleRate(SnowboyDetect* detector) {
assert(detector != NULL);
return reinterpret_cast<snowboy::SnowboyDetect*>(detector)->SampleRate();
}
int SnowboyDetectNumChannels(SnowboyDetect* detector) {
assert(detector != NULL);
return reinterpret_cast<snowboy::SnowboyDetect*>(detector)->NumChannels();
}
int SnowboyDetectBitsPerSample(SnowboyDetect* detector) {
assert(detector != NULL);
return reinterpret_cast<snowboy::SnowboyDetect*>(detector)->BitsPerSample();
}
void SnowboyDetectDestructor(SnowboyDetect* detector) {
assert(detector != NULL);
delete reinterpret_cast<snowboy::SnowboyDetect*>(detector);
detector = NULL;
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。