offline-stream.h 952 B

1234567891011121314151617181920212223242526272829303132333435363738
  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. #if !defined(__APPLE__)
  10. #include "itn-model.h"
  11. #endif
  12. namespace funasr {
  13. class OfflineStream {
  14. public:
  15. OfflineStream(std::map<std::string, std::string>& model_path, int thread_num);
  16. ~OfflineStream(){};
  17. std::unique_ptr<VadModel> vad_handle= nullptr;
  18. std::unique_ptr<Model> asr_handle= nullptr;
  19. std::unique_ptr<PuncModel> punc_handle= nullptr;
  20. #if !defined(__APPLE__)
  21. std::unique_ptr<ITNModel> itn_handle = nullptr;
  22. #endif
  23. bool UseVad(){return use_vad;};
  24. bool UsePunc(){return use_punc;};
  25. bool UseITN(){return use_itn;};
  26. private:
  27. bool use_vad=false;
  28. bool use_punc=false;
  29. bool use_itn=false;
  30. };
  31. OfflineStream *CreateOfflineStream(std::map<std::string, std::string>& model_path, int thread_num=1);
  32. } // namespace funasr
  33. #endif