ByteRTCRangeAudio class
- Inheritance
-
- Object
- NativeClass
- ByteRTCRangeAudio
Properties
-
$resource
→ NativeResource
-
no setterinherited
-
hashCode
→ int
-
The hash code for this object.
no setterinherited
-
ready
→ Future<void>
-
Whether the instance is initialized
no setterinherited
-
runtimeType
→ Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
destroy()
→ void
-
inherited
-
enableRangeAudio(BOOL enable)
→ FutureOr<void>
-
@detail api
@author chuzhongtao
@brief 开启/关闭范围语音功能。
范围语音是指,在同一 RTC 房间中设定的音频接收距离范围内,本地用户收听到的远端用户音频音量会随着远端用户的靠近/远离而放大/衰减;若远端用户在房间内的位置超出设定范围,则本地用户无法接收其音频。音频接收范围设置参看 updateReceiveRange:{@link #ByteRTCRangeAudio#updateReceiveRange}。
@param enable 是否开启范围语音功能:
- YES: 开启
- NO: 关闭(默认)
@note 该方法进房前后都可调用,为保证进房后范围语音效果的平滑切换,你需在该方法前先调用 updatePosition:{@link #ByteRTCRangeAudio#updatePosition} 设置自身位置坐标,然后开启该方法收听范围语音效果。
-
nativeCall<T>(String method, [List? args, NativeMethodMeta? meta])
→ Future<T>
-
Call instance method
inherited
-
noSuchMethod(Invocation invocation)
→ dynamic
-
Invoked when a nonexistent method or property is accessed.
inherited
-
sendInstanceGet<T>(String property)
→ Future<T>
-
Get instance property
inherited
-
sendInstancePropertiesGet(dynamic nativeClass)
→ Future<Map<String, dynamic>>
-
Get instance properties
inherited
-
sendInstanceSet(String property, dynamic value)
→ Future<void>
-
Set instance property
inherited
-
setAttenuationModel(ByteRTCAttenuationType type, float coefficient)
→ FutureOr<int>
-
@detail api
@author huangshouqin
@brief 设置范围语音的音量衰减模式。
@param type 音量衰减模式。默认为线性衰减。详见 ByteRTCAttenuationType{@link #ByteRTCAttenuationType}。
@param coefficient 指数衰减模式下的音量衰减系数,默认值为 1。范围
0.1,100,推荐设置为 50。数值越大,音量的衰减速度越快。
@return 调用是否成功
- 0:调用成功
- -1:调用失败。原因为在调用 enableRangeAudio:{@link #ByteRTCRangeAudio#enableRangeAudio} 开启范围语音前或进房前调用本接口
@note 音量衰减范围通过 updateReceiveRange:{@link #ByteRTCRangeAudio#updateReceiveRange} 进行设置。
-
setNoAttenuationFlags(NSArray<NSString> flags)
→ FutureOr<void>
-
@detail api
@author chuzhongtao
@brief 添加标签组,用于标记相互之间通话不衰减的用户组。
在同一个 RTC 房间中,如果多个用户的标签组之间有交集,那么,他们之间互相通话时,通话不衰减。
比如,用户身处多个队伍,队伍成员间通话不衰减。那么,可以为每个队伍绑定专属标签,每个用户的标签组包含用户所属各个队伍的标签。
@param flags 标签组。
-
toString()
→ String
-
A string representation of this object.
inherited
-
updatePosition(ByteRTCPosition pos)
→ FutureOr<int>
-
@detail api
@author chuzhongtao
@brief 更新本地用户在房间内空间直角坐标系中的位置坐标。
@param pos 三维坐标的值,默认为
0, 0, 0,参看 ByteRTCPosition{@link #ByteRTCPosition}.
@return 方法调用结果:
- 0:成功;
- !0:失败。
@note 调用该接口更新坐标后,你需调用 enableRangeAudio:{@link #ByteRTCRangeAudio#enableRangeAudio} 开启范围语音功能以收听范围语音效果。
-
updateReceiveRange(ByteRTCReceiveRange range)
→ FutureOr<int>
-
@detail api
@author chuzhongtao
@brief 更新本地用户的音频收听范围。
@param range 音频收听范围,参看 ByteRTCReceiveRange{@link #ByteRTCReceiveRange}。
@return 方法调用结果:
- 0:成功;
- !0: 失败。
-
updateResource(NativeResource resource)
→ void
-
inherited