/**
* class CAudioInfo
*/
-CAudioInfo::CAudioInfo() :
- __mSampleRate(MAX_SYSTEM_SAMPLERATE),
- __mChannel(EChannel::CHANNEL_MONO),
- __mSampleType(ESampleType::SAMPLE_TYPE_U8),
- __mAudioType(EAudioType::AUDIO_IN_TYPE_MEDIA),
- __mAudioIndex(-1),
- __mEffectMethodWithReference((sound_effect_method_with_reference_e)0),
- __mEffectMethodReferenceDeviceId(0),
- __mEffectMethod(0) {
-}
-
CAudioInfo::CAudioInfo(unsigned int sampleRate, EChannel channel, ESampleType sampleType, EAudioType audioType, int audioIndex) :
__mSampleRate(sampleRate),
__mChannel(channel),
__mSampleType(sampleType),
__mAudioType(audioType),
- __mAudioIndex(audioIndex),
- __mEffectMethodWithReference((sound_effect_method_with_reference_e)0),
- __mEffectMethodReferenceDeviceId(0),
- __mEffectMethod(0) {
+ __mAudioIndex(audioIndex) {
// Check to invalid AudioInfo
if (sampleRate < CAudioInfo::MIN_SYSTEM_SAMPLERATE ||
sampleRate > CAudioInfo::MAX_SYSTEM_SAMPLERATE)
"The audioType is invalid [audioType:%u]", to_integral(audioType));
}
-unsigned int CAudioInfo::getSampleRate() noexcept {
+unsigned int CAudioInfo::getSampleRate() const noexcept {
return __mSampleRate;
}
-CAudioInfo::EChannel CAudioInfo::getChannel() noexcept {
+CAudioInfo::EChannel CAudioInfo::getChannel() const noexcept {
return __mChannel;
}
-CAudioInfo::ESampleType CAudioInfo::getSampleType() noexcept {
+CAudioInfo::ESampleType CAudioInfo::getSampleType() const noexcept {
return __mSampleType;
}
-CAudioInfo::EAudioType CAudioInfo::getAudioType() noexcept {
+CAudioInfo::EAudioType CAudioInfo::getAudioType() const noexcept {
return __mAudioType;
}
__mAudioType = convertOutputStreamTypeToAudioType(streamType);
}
-int CAudioInfo::getAudioIndex() noexcept {
+int CAudioInfo::getAudioIndex() const noexcept {
return __mAudioIndex;
}
__mAudioIndex = audioIndex;
}
-int CAudioInfo::getSampleSize() noexcept {
+int CAudioInfo::getSampleSize() const noexcept {
int bytes_in_sample = 0;
switch (__mSampleType) {
__mEffectMethod = method;
}
-std::string CAudioInfo::getEffectMethod() noexcept {
+std::string CAudioInfo::getEffectMethod() const noexcept {
std::string method;
if (__mEffectMethod & SOUND_EFFECT_NOISE_SUPPRESSION_VOIP)
__mEffectMethodReferenceDeviceId = id;
}
-std::pair<std::string, int> CAudioInfo::getEffectMethodWithReference() noexcept {
+std::pair<std::string, int> CAudioInfo::getEffectMethodWithReference() const noexcept {
std::string method;
if (__mEffectMethodWithReference == SOUND_EFFECT_REFERENCE_COPY)
return make_pair(method, __mEffectMethodReferenceDeviceId);
}
-const char* CAudioInfo::getConvertedStreamType() {
+const char* CAudioInfo::getConvertedStreamType() const {
if (__mAudioType < CAudioInfo::EAudioType::AUDIO_IN_TYPE_MEDIA ||
__mAudioType >= CAudioInfo::EAudioType::AUDIO_TYPE_MAX)
THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_NOT_SUPPORTED_TYPE,