};
/* Constants Definition */
- static constexpr unsigned int MSG_LENGTH = 512;
+ static constexpr auto MSG_LENGTH = 512;
/* Constructor & Destructor */
CAudioError(EError err, const char* msg, const char* file, const char* func, int line);
AUDIO_DIRECTION_MAX
};
- static constexpr unsigned int MIN_SYSTEM_SAMPLERATE = 8000;
- static constexpr unsigned int MAX_SYSTEM_SAMPLERATE = 192000;
+ static constexpr auto MIN_SYSTEM_SAMPLERATE = 8000;
+ static constexpr auto MAX_SYSTEM_SAMPLERATE = 192000;
- static constexpr double MIN_RECORD_VOLUME = 0.0;
- static constexpr double MAX_RECORD_VOLUME = 2.0;
+ static constexpr auto MIN_RECORD_VOLUME = 0.0;
+ static constexpr auto MAX_RECORD_VOLUME = 2.0;
+ static constexpr auto DEFAULT_RECORD_VOLUME = 1.0;
/* Constructors */
CAudioInfo();
CAudioIO(info),
__mIsUsedSyncRead(true),
__mIsInit(false),
- __mVolume(1.0) {
+ __mVolume(CAudioInfo::DEFAULT_RECORD_VOLUME) {
mDirection = CAudioInfo::EAudioDirection::AUDIO_DIRECTION_IN;
}
CAudioIO::finalize();
__setInit(false);
- __mVolume = 1.0;
+ __mVolume = CAudioInfo::DEFAULT_RECORD_VOLUME;
}
void CAudioInput::prepare() {
* class CPulseAudioClient
*/
const char* CPulseAudioClient::CLIENT_NAME = "AUDIO_IO_PA_CLIENT";
-static constexpr unsigned int drain_wait_interval = 10000;
-static constexpr unsigned int drain_wait_max_count = 30;
+static constexpr auto drain_wait_interval = 10000;
+static constexpr auto drain_wait_max_count = 30;
CPulseAudioClient::CPulseAudioClient(
EStreamDirection direction,
}
static void __check_audio_param(int sample_rate, audio_channel_e channel, audio_sample_type_e type, bool is_output) {
- if (sample_rate < static_cast<int>(CAudioInfo::MIN_SYSTEM_SAMPLERATE) ||
- sample_rate > static_cast<int>(CAudioInfo::MAX_SYSTEM_SAMPLERATE))
+ if (sample_rate < CAudioInfo::MIN_SYSTEM_SAMPLERATE ||
+ sample_rate > CAudioInfo::MAX_SYSTEM_SAMPLERATE)
THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_INVALID_ARGUMENT, "Invalid sample rate :%d", sample_rate);
if (channel < AUDIO_CHANNEL_MONO ||