音视频通讯SDK API参考手册  Windows 1.6.0
av_audio_ctrl.h
1 #ifndef AV_AUDIO_CTRL_H_
2 #define AV_AUDIO_CTRL_H_
3 
4 #include "av_common.h"
5 
6 namespace tencent {
7 namespace av {
8 
16 };
17 
25 class AV_EXPORT AVAudioCtrl {
26  public:
30  virtual ~AVAudioCtrl() {}
31 
32 #ifdef WIN32
33 
45  virtual bool EnableBoost(bool is_enable) = 0;
46 
52  virtual bool IsBoostEnable() = 0;
53 
63  virtual bool EnableNS(bool is_enable) = 0;
64 
70  virtual bool IsNSEnable() = 0;
71 
81  virtual bool EnableAEC(bool is_enable) = 0;
82 
88  virtual bool IsAECEnable() = 0;
89 #endif
90 
95  virtual std::string GetQualityTips() = 0;
96 
97 #if defined(ANDROID) || defined(TARGET_OS_IPHONE)
98 
106  virtual uint32 GetVolume() = 0;
107 
116  virtual void SetVolume(uint32 value) = 0;
117 
126  virtual uint32 GetDynamicVolume() = 0;
127 
138  virtual bool EnableMic(bool is_enable) = 0;
139 
150  virtual bool EnableSpeaker(bool is_enable) = 0;
151 
162  virtual bool SetAudioOutputMode(int output_mode) = 0;
163 
164 #endif
165 
166 #if defined(TARGET_OS_IPHONE)
167 
177  virtual bool EnableLoopback(bool is_enable) = 0;
178 #endif
179 
184  AUDIO_DATA_SOURCE_MIC = 0,
185  AUDIO_DATA_SOURCE_MIXTOSEND = 1,
186  AUDIO_DATA_SOURCE_SEND = 2,
187  AUDIO_DATA_SOURCE_MIXTOPLAY = 3,
188  AUDIO_DATA_SOURCE_PLAY = 4,
189  AUDIO_DATA_SOURCE_NETSTREM = 5,
190  AUDIO_DATA_SOURCE_END = 6,
191  };
192 
206  typedef int(*AudioDataCallback)(AudioFrame* audio_frame, AudioDataSourceType src_type, void* custom_data);
207 
216  virtual int RegistAudioDataCallback(AudioDataSourceType src_type, AudioDataCallback callback, void* custom_data) = 0;
217 
224  virtual int UnregistAudioDataCallback(AudioDataSourceType src_type) = 0;
225 
231  virtual int UnregistAudioDataCallbackAll() = 0;
232 
240  virtual int SetAudioDataFormat(AudioDataSourceType src_type, AudioFrameDesc audio_desc) = 0;
241 
249  virtual int GetAudioDataFormat(AudioDataSourceType src_type, AudioFrameDesc& audio_desc) = 0;
250 
258  virtual int SetAudioDataVolume(AudioDataSourceType src_type, float volume) = 0;
259 
267  virtual int GetAudioDataVolume(AudioDataSourceType src_type, float* volume) = 0;
268 
269 };
270 
271 } // namespace av
272 } // namespace tencent
273 
274 #endif // #define AV_AUDIO_CTRL_H_
Definition: av_audio_ctrl.h:6
音频数据帧格式。
Definition: av_common.h:81
AudioCodecType
音频编解码类型。
Definition: av_audio_ctrl.h:13
AudioDataSourceType
音频数据输入和输出类型。
Definition: av_audio_ctrl.h:183
SILK。
Definition: av_audio_ctrl.h:14
virtual ~AVAudioCtrl()
析构函数。
Definition: av_audio_ctrl.h:30
音频数据帧。
Definition: av_common.h:98
CELT。
Definition: av_audio_ctrl.h:15
音频控制器的封装类。
Definition: av_audio_ctrl.h:25