| | |
| | | int audio_fs, |
| | | std::string wav_format, |
| | | FUNASR_DEC_HANDLE& decoder_handle) { |
| | | scoped_lock guard(thread_lock); |
| | | try { |
| | | int num_samples = buffer.size(); // the size of the buf |
| | | |
| | |
| | | } catch (std::exception const& e) { |
| | | std::cerr << "Error: " << e.what() << std::endl; |
| | | } |
| | | scoped_lock guard(thread_lock); |
| | | msg["access_num"]=(int)msg["access_num"]-1; |
| | | } |
| | | |
| | |
| | | msg_data->msg["itn"] = jsonresult["itn"]; |
| | | } |
| | | if ((jsonresult["is_speaking"] == false || |
| | | jsonresult["is_finished"] == true) && msg_data->msg["is_eof"] != true) { |
| | | jsonresult["is_finished"] == true) && |
| | | msg_data->msg["is_eof"] != true && |
| | | msg_data->hotwords_embedding != NULL) { |
| | | LOG(INFO) << "client done"; |
| | | // for offline, send all receive data to decoder engine |
| | | std::vector<std::vector<float>> hotwords_embedding_(*(msg_data->hotwords_embedding)); |