android_enableAudioReceive method

Future<int?> android_enableAudioReceive(
  1. string userId,
  2. bool enable
)

@platform android @detail api @author luomingkang @brief 是否接收某个特定用户的音频流。关闭声音接收不会影响扬声器或其他音频输出设备的状态。 @param userId 用户 ID,最大长度为128字节的非空字符串。支持的字符集范围为:
1. 26个大写字母 A ~ Z
2. 26个小写字母 a ~ z
3. 10个数字 0 ~ 9
4. 下划线"_", at符"@", 减号"-" @param enable 是否接收指定用户的音频流:
- true:接收该用户的音频流。即允许该用户的音频数据被传递到本地设备并播放。 - false:默认设置,不接收该用户的音频流,即不播放该用户的声音。但不会关闭扬声器,扬声器仍可用于其他音频输出。 @return - 0:接口调用成功 - -2:传入的用户 ID 为空字符串。

Implementation

Future<int?> android_enableAudioReceive(string userId, bool enable) async {
  $() => ($instance as $p_a.RTCRoom).enableAudioReceive(userId, enable);

  if (Platform.isAndroid) {
    return $();
  } else {
    throw UnsupportedError(
        'Not Support Platform ${Platform.operatingSystem}');
  }
}