int ttsd_config_update_personal_voice(const char* language, const char* unique_id, const char* display_name, const char* device_name, void* user_data)
{
char current_engine[1024] = {'\0', };
- if (0 != aul_app_get_appid_bypid(getpid(), current_engine, sizeof(current_engine) - 1)) {
- SLOG(LOG_ERROR, tts_tag(), "[Server ERROR] Fail to get callee appid by pid");
+ if (user_data) {
+ strncpy(current_engine, (char*)user_data, sizeof(current_engine) - 1);
+ } else {
+ if (0 != aul_app_get_appid_bypid(getpid(), current_engine, sizeof(current_engine) - 1)) {
+ SLOG(LOG_ERROR, tts_tag(), "[Server ERROR] Fail to get callee appid by pid");
+ }
}
SLOG(LOG_DEBUG, tts_tag(), "[Server] TTS Current Engine(%s)", current_engine);
{
SLOG(LOG_DEBUG, tts_tag(), "[Server] Set private data requested cb");
- int ret = ttsd_config_update_personal_voice(language, unique_id, display_name, device_name, NULL);
+ int ret = ttsd_config_update_personal_voice(language, unique_id, display_name, device_name, user_data);
if (0 != ret) {
SLOG(LOG_ERROR, tts_tag(), "[Server ERROR] Fail to update personal voice");
}
{
SLOG(LOG_INFO, tts_tag(), "[INFO] TTS Engine send personal voices list : language(%s), unique_id(%s), display_name(%s), device_name(%s)", language, unique_id, display_name, device_name);
- int ret = ttsd_send_personal_voice(language, unique_id, display_name, device_name, NULL);
+ int ret = ttsd_send_personal_voice(language, unique_id, display_name, device_name, user_data);
if (0 != ret) {
SLOG(LOG_ERROR, tts_tag(), "[ERROR] Fail to send personal voice");
}