# 声网3.4.2与阿里2.1接口对比
# Windows端
阿里的接口总数247
- 声网对齐接口数xxx个:搜"是"剔除说明的文字项188-22 = 166个
- 声网和阿里都有的功能,但是阿里端接口和声网不一样,阿里未对齐接口数:11个
- 声网没有的接口数:57个
接口对齐率为:(247-11)/265 = 95.5%
# 核心方法
# 音频管理
# 视频管理
# 视频前处理及后处理
声网 | 阿里 | 描述 | 对齐 |
---|---|---|---|
setBeautyEffectOptions (opens new window) | SetBeautyEffect (opens new window) | 设置美颜效果选项。 | 是 |
# 多频道管理
声网 | 阿里 | 描述 | 对齐 |
---|---|---|---|
createChannel (opens new window) | CreateChannel (opens new window) | 创建并获取一个 IChannel 对象。通过创建多个对象,用户可以同时加入多个频道。 | 是 |
IChannel (opens new window) | AliEngine | 该类提供在指定频道内实现实时音视频功能的方法。 | 是 |
IChannelEventHandler (opens new window) | AliEngineEventListener | 该类提供监听指定频道事件和数据的回调。 | 是 |
# 屏幕共享
# 音乐文件播放及混音
# 音效文件播放管理
# 人声效果
声网 | 阿里 | 描述 | 对齐 |
---|---|---|---|
setLocalVoicePitch (opens new window) | SetAudioEffectPitchValue (opens new window) | 设置本地语音音调。 | 是 |
setLocalVoiceEqualization (opens new window) | SetAudioEffectReverbParamType (opens new window) | 设置本地语音音效均衡。 | 是 |
setLocalVoiceReverb (opens new window) | SetAudioEffectReverbMode (opens new window) | 设置本地音效混响。 | |
setVoiceBeautifierPreset (opens new window) | 设置 SDK 预设的美声效果。 | 否 | |
setVoiceBeautifierParameters (opens new window) | 设置 SDK 预设美声效果的参数。 | 否 | |
setAudioEffectPreset (opens new window) | SetAudioEffectVoiceChangerMode (opens new window) | 设置 SDK 预设的人声音效。 | 是 |
setAudioEffectParameters (opens new window) | 设置 SDK 预设人声音效的参数。 | 是 | |
setVoiceConversionPreset (opens new window) | 设置 SDK 预设的变声效果。 | 是 |
# 听声辨位
声网 | 阿里 | 描述 | 对齐 |
---|---|---|---|
enableSoundPositionIndication (opens new window) | 开启/关闭远端用户的语音立体声。 | 否 | |
setRemoteVoicePosition (opens new window) | 设置远端用户的语音位置。 | 否 |
# CDN 推流
声网 | 阿里 | 描述 | 对齐 |
---|---|---|---|
setLiveTranscoding (opens new window) | StartLiveStreaming (opens new window) + UpdatePublishLiveStream (opens new window) | 设置直播转码。 | 是 |
addPublishStreamUrl (opens new window) | 增加旁路推流地址。 | 是 | |
removePublishStreamUrl (opens new window) | StopPublishLiveStream (opens new window) | 删除旁路推流地址。 | 是 |
事件 | 描述 | ||
onRtmpStreamingStateChanged (opens new window) | OnPublishLiveStreamStateChanged (opens new window) | RTMP/RTMPS 推流状态发生改变回调。 | 是 |
onRtmpStreamingEvent (opens new window) | OnPublishLiveStreamStateChanged (opens new window) | RTMP/RTMPS 推流事件回调。 | 是 |
onTranscodingUpdated (opens new window) | OnPublishTaskStateChanged (opens new window) | 旁路推流设置已被更新回调。 | 是 |
# 跨频道媒体流转发
声网 | 阿里 | 描述 | 对齐 |
---|---|---|---|
startChannelMediaRelay (opens new window) | StartChannelRelay (opens new window) | 开始跨频道媒体流转发。 | 是 |
updateChannelMediaRelay (opens new window) | UpdateChannelRelay (opens new window) | 更新媒体流转发的频道。 | 是 |
stopChannelMediaRelay (opens new window) | StopChannelRelay (opens new window) | 停止跨频道媒体流转发。 | 是 |
事件 | 描述 | ||
onChannelMediaRelayStateChanged (opens new window) | OnChannelRelayStateChanged (opens new window) | 跨频道媒体流转发状态发生改变回调。 | 是 |
onChannelMediaRelayEvent (opens new window) | OnChannelRelayEvent (opens new window) | 跨频道媒体流转发事件回调。 | 是 |
# 音量提示
声网 | 阿里 | 描述 | 对齐 |
---|---|---|---|
enableAudioVolumeIndication (opens new window) | EnableAudioVolumeIndication (opens new window) | 启用用户音量提示。 | 是 |
事件 | 描述 | ||
onAudioVolumeIndication (opens new window) | OnAudioVolumeCallback (opens new window) | 用户音量提示回调。 | 是 |
onActiveSpeaker (opens new window) | OnActiveSpeaker (opens new window) | 监测到最活跃用户回调。 | 是 |
# 人脸检测
声网 | 阿里 | 描述 | 对齐 |
---|---|---|---|
enableFaceDetection (opens new window) | 开启/关闭本地人脸检测。 | 否 | |
事件 | 描述 | ||
onFacePositionChanged (opens new window) | 报告本地人脸检测结果。 | 否 |
# 音频播放路由
声网 | 阿里 | 描述 | 对齐 |
---|---|---|---|
setDefaultAudioRouteToSpeakerphone (opens new window) | SetDefaultAudioRouteToSpeakerphone (opens new window) | 设置默认的音频播放路由(仅适用于 Android 和 iOS)。 | 是 |
setEnableSpeakerphone (opens new window) | EnableSpeakerphone (opens new window) | 启用/关闭扬声器播放(仅适用于 Android 和 iOS)。 | 是 |
isSpeakerphoneEnabled (opens new window) | IsEnableSpeakerphone (opens new window) | 查询扬声器启用状态(仅适用于 Android 和 iOS)。 | 是 |
事件 | 描述 | ||
onAudioRouteChanged (opens new window) | OnAudioRouteChanged (opens new window) | 音频路由已改变回调。(仅适用于 Android、iOS 和 macOS) | 是 |
# 耳返控制
声网 | 阿里 | 描述 | 对齐 |
---|---|---|---|
enableInEarMonitoring (opens new window) | EnableEarBack (opens new window) | 开启耳返功能(仅适用于 Android 和 iOS)。 | 是 |
setInEarMonitoringVolume (opens new window) | SetEarBackVolume (opens new window) | 设置耳返音量(仅适用于 Android 和 iOS)。 | 是 |
# 视频双流模式
# 视频流回退
声网 | 阿里 | 描述 | 对齐 |
---|---|---|---|
setLocalPublishFallbackOption (opens new window) | 设置弱网条件下发布的音视频流的回退选项。 | 否 | |
setRemoteSubscribeFallbackOption (opens new window) | 设置弱网条件下订阅的音视频流的回退选项。 | 否 | |
setRemoteUserPriority (opens new window) | 设置远端用户流的优先级。 | 否 | |
事件 | 描述 | 否 | |
onLocalPublishFallbackToAudioOnly (opens new window) | 本地发布流已回退为音频流或恢复为音视频流回调。 | 否 | |
onRemoteSubscribeFallbackToAudioOnly (opens new window) | 远端订阅流已回退为音频流或恢复为音视频流回调。 | 否 |
# 通话前网络测试
声网 | 阿里 | 描述 | 对齐 |
---|---|---|---|
startEchoTest (opens new window) | 开始语音通话回路测试。 | 否 | |
stopEchoTest (opens new window) | 停止语音直播回路测试。 | 否 | |
enableLastmileTest (opens new window) | 启用网络测试。 | 否 | |
disableLastmileTest (opens new window) | 关闭网络测试。 | 否 | |
startLastmileProbeTest (opens new window) | StartLastmileDetect (opens new window) | 开始通话前网络质量探测。 | 是 |
stopLastmileProbeTest (opens new window) | StopLastmileDetect (opens new window) | 停止通话前网络质量探测。 | 是 |
事件 | 描述 | ||
onLastmileQuality (opens new window) | 本地网络质量报告回调。 | 否 | |
onLastmileProbeResult (opens new window) | OnLastmileDetectResultWithQuality (opens new window) | 通话前网络质量探测报告回调。 | 是 |
# 自定义视频模块
声网 | 阿里 | 描述 | 对齐 |
---|---|---|---|
setVideoSource (opens new window) | 设置自定义视频源。 | 否 |
# 视频自采集(仅 Push 模式)
声网 | 阿里 | 描述 | 对齐 |
---|---|---|---|
setExternalVideoSource (opens new window) | SetExternalVideoSource (opens new window) | 配置外部视频源。 | 是 |
pushVideoFrame (opens new window) | PushExternalVideoFrame (opens new window) | 推送外部视频帧。 | 是 |
# 音频自采集(仅 Push 模式)
# 音频自渲染(仅 Pull 模式)
# 原始音频数据
# 原始视频数据
# 媒体附属信息
声网 | 阿里 | 描述 | 对齐 |
---|---|---|---|
registerMediaMetadataObserver (opens new window) | SendMediaExtensionMsg (opens new window)(替代实现) | 注册媒体 Metadata 观测器。 | 否 |
事件 | 描述 | 否 | |
getMaxMetadataSize (opens new window) | 请求最大的 Metadata 大小回调。 | 否 | |
onReadyToSendMetadata (opens new window) | 发送端已准备好发送 Metadata 回调。 | 否 | |
onMetadataReceived (opens new window) | 接收端已收到 Metadata 回调。 | 否 |
# 直播水印
声网 | 阿里 | 描述 | 对齐 |
---|---|---|---|
addVideoWatermark (opens new window) | AddVideoWatermark (opens new window) | 添加本地视频水印。 | 是 |
clearVideoWatermarks (opens new window) | ClearVideoWatermark (opens new window) | 删除已添加的视频水印。 | 是 |
# 加密
声网 | 阿里 | 描述 | 对齐 |
---|---|---|---|
enableEncryption | --- | 开启/关闭内置加密。 | 否 |
registerPacketObserver | -- | 注册数据包观测器。 | 否 |
# 音频采集
声网 | 阿里 | 描述 | 对齐 |
---|---|---|---|
startAudioRecording (opens new window) | StartRecord (opens new window) | 开始客户端录音。 | 是 |
stopAudioRecording (opens new window) | StopRecord (opens new window) | 停止客户端录音。 | 是 |
# 摄像头控制
声网 | 阿里 | 描述 | 对齐 |
---|---|---|---|
switchCamera (opens new window) | SwitchCamera (opens new window) | 切换前置/后置摄像头(仅适用于 Android 和 iOS)。 | 是 |
事件 | 描述 | ||
onCameraFocusAreaChanged (opens new window) | -- | 摄像头对焦区域已改变回调。 | 否 |
onCameraExposureAreaChanged (opens new window) | -- | 摄像头曝光区域已改变回调。 | 否 |
# 设备管理
# 流消息
声网 | 阿里 | 描述 | 对齐 |
---|---|---|---|
createDataStream (opens new window) | SendMediaExtensionMsg (opens new window) | 创建数据流。 | |
sendStreamMessage (opens new window) | 发送数据流。 | 是 | |
事件 | 描述 | ||
onStreamMessage (opens new window) | OnMediaExtensionMsgReceived (opens new window) | 接收到对方数据流消息回调。 | 是 |
onStreamMessageError (opens new window) | -- | 接收对方数据流消息发生错误回调。 | 否 |
# 其他音频控制
声网 | 阿里 | 描述 | 对齐 |
---|---|---|---|
enableLoopbackRecording (opens new window) | 开启声卡采集(仅适用于 macOS 和 Windows)。 | 否 | |
setAudioSessionOperationRestriction (opens new window) | SetAudioSessionOperationRestriction (opens new window) | 设置 SDK 对 Audio Session 的控制权限(仅适用于 iOS)。 | 是 |
# 其他视频控制
声网 | 阿里 | 描述 | 对齐 |
---|---|---|---|
setCameraCapturerConfiguration (opens new window) | SetCameraCapturerConfiguration (opens new window) | 设置摄像头采集配置。 | 是 |
# 其他方法
声网 | 阿里 | 描述 | 对齐 |
---|---|---|---|
setCloudProxy (opens new window) | -- | 设置 Agora 云代理服务。 | 否 |
enableDeepLearningDenoise (opens new window) | StartIntelligentDenoise (opens new window) / StopIntelligentDenoise (opens new window) | 开启/关闭 AI 降噪模式。 | 是 |
sendCustomReportMessage (opens new window) | 自定义数据上报。 | 否 | |
getCallId (opens new window) | -- | 获取通话 ID。 | 否 |
rate (opens new window) | -- | 给通话评分。 | 否 |
complain (opens new window) | PostFeedback (opens new window) | 投诉通话质量。 | 是 |
getVersion (opens new window) | GetSDKVersion (opens new window) | 查询 SDK 版本号。 | 是 |
getErrorDescription (opens new window) | GetErrorDescription (opens new window) | 获取警告或错误描述。 | 是 |
queryInterface (opens new window) | QueryInterface (opens new window) | 获取设备管理员对象的指针。 | 是 |
其他事件 | |||
事件 | 描述 | ||
onWarning (opens new window) | OnOccurWarning (opens new window) | 发生警告回调。 | 是 |
onError (opens new window) | OnOccurError (opens new window) | 发生错误回调。 | 是 |
onApiCallExecuted (opens new window) | -- | API 方法已执行回调。 | 否 |
剩余的未在文档中出现的阿里接口与回调单独整理成2个表格,