| | |
| | | using paraformer::Response; |
| | | using paraformer::ASR; |
| | | |
| | | typedef struct |
| | | { |
| | | std::string msg; |
| | | float snippet_time; |
| | | }RPASR_RECOG_RESULT; |
| | | |
| | | |
| | | class ASRServicer final : public ASR::Service { |
| | | private: |
| | |
| | | std::unordered_map<std::string, std::string> client_transcription; |
| | | |
| | | public: |
| | | ASRServicer(); |
| | | ASRServicer(const char* model_path, int thread_num, bool quantize); |
| | | void clear_states(const std::string& user); |
| | | void clear_buffers(const std::string& user); |
| | | void clear_transcriptions(const std::string& user); |
| | | void disconnect(const std::string& user); |
| | | grpc::Status Recognize(grpc::ServerContext* context, grpc::ServerReaderWriter<Response, Request>* stream); |
| | | int nThreadNum = 4; |
| | | RPASR_HANDLE AsrHanlde=RapidAsrInit("/data/asrmodel/speech_paraformer-large_asr_nat-zh-cn-16k-common-vocab8404-pytorch/", nThreadNum); |
| | | RPASR_HANDLE AsrHanlde; |
| | | |
| | | }; |