revise CAudioInfo conversion
[platform/core/api/audio-io.git] / src / cpp / CAudioIO.cpp
index 55d4d87..fbeaf82 100644 (file)
@@ -340,7 +340,6 @@ void CAudioIO::setStreamInfo(sound_stream_info_h stream_info) {
         THROW_ERROR_MSG(CAudioError::EError::ERROR_INVALID_STATE, "it is not permitted while started");
 
     int errorCode = SOUND_MANAGER_ERROR_NONE;
-    CAudioInfo::EAudioType audioType = CAudioInfo::EAudioType::AUDIO_IN_TYPE_MEDIA;
     char *type = nullptr;
     int index = -1;
     bool avail = false;
@@ -353,10 +352,9 @@ void CAudioIO::setStreamInfo(sound_stream_info_h stream_info) {
     if ((errorCode = sound_manager_get_type_from_stream_information(stream_info, &type)) != SOUND_MANAGER_ERROR_NONE)
         THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_INVALID_ARGUMENT, "Parameter stream_info->stream_type is invalid [ret:%d]", errorCode);
     if (mDirection == CAudioInfo::EAudioDirection::AUDIO_DIRECTION_IN)
-        getAudioInfo().convertInputStreamType2AudioType(type, &audioType);
+        getAudioInfo().setAudioTypeByInputStreamType(type);
     else
-        getAudioInfo().convertOutputStreamType2AudioType(type, &audioType);
-    getAudioInfo().setAudioType(audioType);
+        getAudioInfo().setAudioTypeByOutputStreamType(type);
 
     if ((errorCode = sound_manager_get_index_from_stream_information(stream_info, &index)) != SOUND_MANAGER_ERROR_NONE)
         THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_INVALID_ARGUMENT, "Parameter stream_info->index is invalid [ret:%d]", errorCode);