ZegoSoundLevel Class Reference
Inherits from | NSObject |
---|---|
Declared in | zego-api-sound-level-oc.h |
+ sharedInstance
获取 ZegoSoundLevel 的单例对象
+ (instancetype)sharedInstance
Return Value
ZegoSoundLevel 的单例对象
Declared In
zego-api-sound-level-oc.h
– setSoundLevelDelegate:
设置代理对象
- (void)setSoundLevelDelegate:(id<ZegoSoundLevelDelegate>)delegate
Parameters
delegate |
实现 ZegoSoundLevelDelegate 的代理对象 |
---|
Discussion
未设置代理,或者设置代理失败,会造成无法正常回调音浪信息
Declared In
zego-api-sound-level-oc.h
– setSoundLevelMonitorCycle:
设置音浪回调的监控周期
- (bool)setSoundLevelMonitorCycle:(unsigned int)timeInMS
Parameters
timeInMS |
时间周期,单位为毫秒,取值范围 [100, 3000]。默认 200 ms。 |
---|
Return Value
true 成功;false 失败
Discussion
该设置会影响 [ZegoSoundLevelDelegate -onSoundLevelUpdate:] [ZegoSoundLevelDelegate -onCaptureSoundLevelUpdate:] 的回调频率
Declared In
zego-api-sound-level-oc.h
– startSoundLevelMonitor
启动音浪监听
- (bool)startSoundLevelMonitor
Return Value
true 成功,等待回调;false 失败
Discussion
startSoundLevelMonitor 后一定要 stopSoundLevelMonitor
StartSoundLevelMonitor 后,即使未启动本地音频采集,[ZegoSoundLevelDelegate -onCaptureSoundLevelUpdate:] 也会有回调,且音浪值为0
Declared In
zego-api-sound-level-oc.h
– stopSoundLevelMonitor
停止音浪监听
- (bool)stopSoundLevelMonitor
Return Value
true 成功;false 失败
Declared In
zego-api-sound-level-oc.h
– enableVADMonitor:
设置音浪回调是否检测VAD,VAD算法有性能开销,建议按需设置
- (bool)enableVADMonitor:(bool)enable
Parameters
enable |
true 开启;false 关闭。默认 关闭。 |
---|
Return Value
true 成功;false 失败
Declared In
zego-api-sound-level-oc.h