offline-stream.h 728 B

123456789101112131415161718192021222324252627282930
  1. #ifndef OFFLINE_STREAM_H
  2. #define OFFLINE_STREAM_H
  3. #include <memory>
  4. #include <string>
  5. #include <map>
  6. #include "model.h"
  7. #include "punc-model.h"
  8. #include "vad-model.h"
  9. namespace funasr {
  10. class OfflineStream {
  11. public:
  12. OfflineStream(std::map<std::string, std::string>& model_path, int thread_num);
  13. ~OfflineStream(){};
  14. std::unique_ptr<VadModel> vad_handle;
  15. std::unique_ptr<Model> asr_handle;
  16. std::unique_ptr<PuncModel> punc_handle;
  17. bool UseVad(){return use_vad;};
  18. bool UsePunc(){return use_punc;};
  19. private:
  20. bool use_vad=false;
  21. bool use_punc=false;
  22. };
  23. OfflineStream *CreateOfflineStream(std::map<std::string, std::string>& model_path, int thread_num=1);
  24. } // namespace funasr
  25. #endif