return NULL;
}
-void __stt_file_result_cb(stte_result_event_e event, const char* type, const char** data, int data_count,
+int __stt_file_result_cb(stte_result_event_e event, const char* type, const char** data, int data_count,
const char* msg, void* time_info, void *user_data)
{
/* check handle */
if (NULL == client) {
SLOG(LOG_ERROR, TAG_STTFC, "[ERROR] Fail to notify error : A handle is not valid");
- return;
+ return STT_FILE_ERROR_OPERATION_FAILED;
}
if (NULL != time_info) {
}
}
- return;
+ return STT_FILE_ERROR_NONE;
}
void __stt_file_speech_status_cb(stte_speech_status_e status, void *user_data)
/* Get file name from default engine directory */
DIR *dp = NULL;
int ret = -1;
- struct dirent entry;
struct dirent *dirp = NULL;
dp = opendir(STT_DEFAULT_ENGINE);
if (NULL != dp) {
do {
- ret = readdir_r(dp, &entry, &dirp);
- if (0 != ret) {
- SLOG(LOG_ERROR, TAG_STTFC, "[File ERROR] Fail to read directory");
- break;
- }
+ dirp = readdir(dp);
if (NULL != dirp) {
+ if (!strcmp(".", dirp->d_name) || !strcmp("..", dirp->d_name))
+ continue;
+
sttengine_info_s* info = NULL;
char* filepath;
int filesize;