游雁
2023-10-19 b9bcf1f093c3053fdc4e2cf4a1d38e27bbf429fb
funasr/runtime/onnxruntime/src/commonfunc.h
@@ -1,11 +1,16 @@
#pragma once 
#include <algorithm>
#ifdef _WIN32
#include <codecvt>
#endif
namespace funasr {
typedef struct
{
    std::string msg;
    float  snippet_time;
    std::string stamp;
    std::string tpass_msg;
    float snippet_time;
}FUNASR_RECOG_RESULT;
typedef struct
@@ -14,9 +19,16 @@
    float  snippet_time;
}FUNASR_VAD_RESULT;
typedef struct
{
    string msg;
    vector<string> arr_cache;
}FUNASR_PUNC_RESULT;
#ifdef _WIN32
#include <codecvt>
#define ORTSTRING(str) StrToWstr(str)
#define ORTCHAR(str) StrToWstr(str).c_str()
inline std::wstring String2wstring(const std::string& str, const std::string& locale)
{
@@ -32,8 +44,15 @@
}
#else
#define ORTSTRING(str) str
#define ORTCHAR(str) str
#endif
inline void GetInputName(Ort::Session* session, string& inputName,int nIndex=0) {
    size_t numInputNodes = session->GetInputCount();
    if (numInputNodes > 0) {