10 #include <curl/curl.h> 48 void setAsrParams(
const std::string
base_path,
const std::string pcm_file,
const int channel);
54 void initAndConfigAsr();
60 void speechGetToken();
66 void getPcmFileData();
73 char* runAsrAndRecog();
80 std::string resultFromJson();
89 struct DataBuff recordThroughMIC(const float record_time, bool enable_audio_save);
96 void getPCMData(
struct DataBuff pcm_buff);
102 void stopRecordThroughMIC();
116 struct DataBuff getOneChannelData();
122 void saveRecordDataToFile();
134 static size_t writefunc(
void* ptr,
size_t size,
size_t nmemb,
char** result);
137 char* rec_result_ = NULL;
142 int record_loops_ = 0;
144 char* url_response_ = NULL;
145 const std::string API_TOKEN_URL =
"http://openapi.baidu.com/oauth/2.0/token";
FileOperation pcm_file_operation
const std::string base_path
std::string online_final_result
RecordAlsaAPI record_alsa