Yabin Li
2023-08-08 b454a1054fadbff0ee963944ff42f66b98317582
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#ifndef TPASS_STREAM_H
#define TPASS_STREAM_H
 
#include <memory>
#include <string>
#include <map>
#include "model.h"
#include "punc-model.h"
#include "vad-model.h"
 
namespace funasr {
class TpassStream {
  public:
    TpassStream(std::map<std::string, std::string>& model_path, int thread_num);
    ~TpassStream(){};
 
    // std::unique_ptr<VadModel> vad_handle = nullptr;
    std::unique_ptr<VadModel> vad_handle = nullptr;
    std::unique_ptr<Model> asr_handle = nullptr;
    std::unique_ptr<PuncModel> punc_online_handle = nullptr;
    bool UseVad(){return use_vad;};
    bool UsePunc(){return use_punc;}; 
    
  private:
    bool use_vad=false;
    bool use_punc=false;
};
 
TpassStream *CreateTpassStream(std::map<std::string, std::string>& model_path, int thread_num=1);
} // namespace funasr
#endif