vad-model.h 616 B

123456789101112131415161718192021
  1. #ifndef VAD_MODEL_H
  2. #define VAD_MODEL_H
  3. #include <string>
  4. #include <map>
  5. #include <vector>
  6. namespace funasr {
  7. class VadModel {
  8. public:
  9. virtual ~VadModel(){};
  10. virtual void InitVad(const std::string &vad_model, const std::string &vad_cmvn, const std::string &vad_config, int thread_num)=0;
  11. virtual std::vector<std::vector<int>> Infer(std::vector<float> &waves, bool input_finished=true)=0;
  12. virtual int GetVadSampleRate() = 0;
  13. };
  14. VadModel *CreateVadModel(std::map<std::string, std::string>& model_path, int thread_num);
  15. VadModel *CreateVadModel(void* fsmnvad_handle);
  16. } // namespace funasr
  17. #endif