QNCustomAudioTrack
Hierarchy
Index
Core Methods
Core Methods
GetTrackID
- virtual const std::string& GetTrackID() = 0
-
获取 TrackID
Returns string
GetUserID
- virtual const std::string& GetUserID() = 0
-
获取 UserID
Returns string
GetTag
- virtual const std::string& GetTag() = 0
-
获取 Tag
Returns string
IsAudio
- virtual bool IsAudio() = 0
-
是否为音频 track
Returns bool
IsVideo
- virtual bool IsVideo() = 0
-
是否为视频 track
Returns bool
IsMuted
- virtual bool IsMuted() = 0
-
是否 muted
Returns bool
SetMuted
- virtual void SetMuted(bool muted) = 0
-
设置是否静默该 track,静默后,SDK 将会发送静默帧数据
Parameters-
muted: bool
是否静默
-
SetAudioFrameListener
- virtual void SetAudioFrameListener(QNAudioFrameListener* listener) = 0
-
设置是音频数据监听
Parameters-
listener: QNAudioFrameListener
音频数据监听接口
-
SetVolume
- virtual void SetVolume(double volume) = 0
-
设置采集音频音量(不改变系统设备的音量)
Parameters-
volume: double
音量大小,[1.0-10.0], 默认为 1.0
-
GetVolumeLevel
- virtual float GetVolumeLevel() = 0
-
获取音频采集的音量
Returns float
MixAudioWithSoundCard
- virtual void MixAudioWithSoundCard(bool enable, float volume_scale_ratio = 1.0f) = 0
-
激活监听功能:混合本地麦克风和系统声卡的声音(仅适用于 Windows 和 iOS)
Parameters-
enable: bool
是否开启监听
-
volume_scale_ratio: float
系统声音缩放倍数,以方便控制系统音量大小
-
PushAudioFrame
- virtual int32_t PushAudioFrame(const uint8_t* data,uint32_t data_size,uint32_t bits_per_sample,uint32_t sample_rate,uint32_t channels) = 0
-
推送自定义音频帧
Parameters-
data: uint8_t*
音频数据
-
data_size: uint32_t
数据长度
-
bits_per_sample: uint32_t
位宽,即每个采样点占用位数
-
sample_rate: uint32_t
采样率
-
channels: uint32_t
声道数
-
文档反馈
(如有产品使用问题,请 提交工单)