diff --git a/common/src/daudio_util.cpp b/common/src/daudio_util.cpp index 5ea63198dd5369295961eb3c677824a258230f90..2ea362b2cca21a10a5e4c905aea77d8f68a6bee3 100644 --- a/common/src/daudio_util.cpp +++ b/common/src/daudio_util.cpp @@ -263,7 +263,7 @@ int32_t GetAudioParamInt(const std::string ¶ms, const std::string &key, int3 DHLOGE("String is not number. str:%{public}s.", val.c_str()); return ERR_DH_AUDIO_NOT_SUPPORT; } - value = std::stoi(val); + value = std::atoi(val.c_str()); return DH_SUCCESS; } diff --git a/services/audiomanager/managersink/src/daudio_sink_dev.cpp b/services/audiomanager/managersink/src/daudio_sink_dev.cpp index 1ce46fd91368a37a737b5972fac0cfd55dd6e193..b87c8e44ccd16f1db136f2e1a356039b02da1913 100644 --- a/services/audiomanager/managersink/src/daudio_sink_dev.cpp +++ b/services/audiomanager/managersink/src/daudio_sink_dev.cpp @@ -472,7 +472,7 @@ int32_t DAudioSinkDev::ConvertString2Int(std::string val) DHLOGE("String is not number. str:%{public}s.", val.c_str()); return -1; } - return std::stoi(val); + return std::atoi(val.c_str()); } void DAudioSinkDev::PullUpPage() diff --git a/services/audiomanager/managersource/src/daudio_source_dev.cpp b/services/audiomanager/managersource/src/daudio_source_dev.cpp index dff98d344bb4e3883472f7dbfb2ee87a4c76a974..c906571acb800354021834af6fc04069d014ad70 100644 --- a/services/audiomanager/managersource/src/daudio_source_dev.cpp +++ b/services/audiomanager/managersource/src/daudio_source_dev.cpp @@ -904,7 +904,7 @@ int32_t DAudioSourceDev::ConvertString2Int(std::string val) DHLOGE("String is not number. str:%{public}s.", val.c_str()); return ERR_DH_AUDIO_FAILED; } - return std::stoi(val); + return std::atoi(val.c_str()); } int32_t DAudioSourceDev::OpenDSpeakerInner(std::shared_ptr &speaker, const int32_t dhId)