- if (sampleRate < CAudioInfo::MIN_SYSTEM_SAMPLERATE || sampleRate > CAudioInfo::MAX_SYSTEM_SAMPLERATE) {
- THROW_ERROR_MSG_FORMAT(CAudioError::ERROR_INVALID_ARGUMENT, "The sampleRate is invalid [sampleRate:%d]", sampleRate);
- }
-
- if (channel < CAudioInfo::CHANNEL_MONO || channel >= CAudioInfo::CHANNEL_MAX) {
- THROW_ERROR_MSG_FORMAT(CAudioError::ERROR_INVALID_ARGUMENT, "The channel is invalid [channel:%d]", channel);
- }
-
- if (sampleType < CAudioInfo::SAMPLE_TYPE_U8 || sampleType >= CAudioInfo::SAMPLE_TYPE_MAX) {
- THROW_ERROR_MSG_FORMAT(CAudioError::ERROR_INVALID_ARGUMENT, "The sampleType is invalid [sampleType:%d]", sampleType);
- }
-
- if (audioType < CAudioInfo::AUDIO_IN_TYPE_MEDIA || audioType >= CAudioInfo::AUDIO_TYPE_MAX) {
- THROW_ERROR_MSG_FORMAT(CAudioError::ERROR_INVALID_ARGUMENT, "The audioType is invalid [audioType:%d]", audioType);
- }
+ if (sampleRate < CAudioInfo::MIN_SYSTEM_SAMPLERATE ||
+ sampleRate > CAudioInfo::MAX_SYSTEM_SAMPLERATE)
+ THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_INVALID_ARGUMENT,
+ "The sampleRate is invalid [sampleRate:%u]", sampleRate);
+
+ if (channel < CAudioInfo::EChannel::CHANNEL_MONO ||
+ channel >= CAudioInfo::EChannel::CHANNEL_MAX)
+ THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_INVALID_ARGUMENT,
+ "The channel is invalid [channel:%u]", to_integral(channel));
+
+ if (sampleType < CAudioInfo::ESampleType::SAMPLE_TYPE_U8 ||
+ sampleType >= CAudioInfo::ESampleType::SAMPLE_TYPE_MAX)
+ THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_INVALID_ARGUMENT,
+ "The sampleType is invalid [sampleType:%u]", to_integral(sampleType));
+
+ if (audioType < CAudioInfo::EAudioType::AUDIO_IN_TYPE_MEDIA ||
+ audioType >= CAudioInfo::EAudioType::AUDIO_TYPE_MAX)
+ THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_INVALID_ARGUMENT,
+ "The audioType is invalid [audioType:%u]", to_integral(audioType));