- const static unsigned int MIN_SYSTEM_SAMPLERATE = 8000;
- const static unsigned int MAX_SYSTEM_SAMPLERATE = 48000;
-
- /* Constructors */
- CAudioInfo();
- CAudioInfo(unsigned int sampleRate, EChannel channel, ESampleType sampleType, EAudioType audioType, int audioIndex) throw(CAudioError);
-
- /* Setter & Getter */
- unsigned int getSampleRate();
- EChannel getChannel();
- ESampleType getSampleType();
- EAudioType getAudioType();
- void setAudioType(EAudioType audioType);
- int getAudioIndex();
- void setAudioIndex(int audioIndex);
- void convertAudioType2StreamType(CAudioInfo::EAudioType audioType, char **streamType);
- void convertInputStreamType2AudioType(char *streamType, CAudioInfo::EAudioType *audioType);
- void convertOutputStreamType2AudioType(char *streamType, CAudioInfo::EAudioType *audioType);
+ enum class EAudioDirection : unsigned int {
+ AUDIO_DIRECTION_IN, /**< Audio direction input */
+ AUDIO_DIRECTION_OUT, /**< Audio direction output */
+ AUDIO_DIRECTION_MAX
+ };
+
+ static constexpr auto MIN_SYSTEM_SAMPLERATE = 8000;
+ static constexpr auto MAX_SYSTEM_SAMPLERATE = 192000;
+
+ static constexpr auto MIN_RECORD_VOLUME = 0.0;
+ static constexpr auto MAX_RECORD_VOLUME = 2.0;
+ static constexpr auto DEFAULT_RECORD_VOLUME = 1.0;
+
+ /* Constructor & Destructor */
+ CAudioInfo(unsigned int sampleRate, EChannel channel, ESampleType sampleType, EAudioType audioType, int audioIndex);
+ virtual ~CAudioInfo() = default;
+
+ /* Audio Specification */
+ std::tuple<ESampleType, unsigned int, EChannel> getSpec() const noexcept;
+ int getSampleSize() const noexcept;
+
+ /* Stream Properties */
+ void setAudioIndex(int audioIndex) noexcept;
+ void setAudioTypeByInputStreamType(const char* streamType);
+ void setAudioTypeByOutputStreamType(const char* streamType);
+ EAudioType getAudioType() const noexcept;
+ std::pair<const char*, int> getStreamProperties() const;
+
+ /* Effect */
+ void setEffectMethod(int method) noexcept;
+ std::string getEffectNoiseSuppressionMethod() const noexcept;
+ std::string getEffectAutomaticGainControlMethod() const noexcept;
+
+ void setEffectMethodWithReference(sound_effect_method_with_reference_e method, int id) noexcept;
+ std::pair<std::string, int> getEffectMethodWithReference() const noexcept;
+
+ /* Utilities */
+ size_t msToBytes(size_t milliseconds) const noexcept;
+ size_t bytesToMs(size_t bytes) const noexcept;