startScreenAudioCapture method

FutureOr<int> startScreenAudioCapture(
  1. NSString deviceId
)

@hidden(iOS) @detail api @author yezijian.me @brief 在屏幕共享时,开始使用 RTC SDK 内部采集方式,采集屏幕音频 @param deviceId 虚拟设备 ID @return - 0: 调用成功。 - < 0 : 调用失败。查看 ByteRTCReturnStatus{@link #ByteRTCReturnStatus} 获得更多错误说明 @note - 本接口仅对内部采集生效,RTC SDK 默认使用内部采集模块采集屏幕音频。若已调用 setScreenAudioSourceType:{@link #ByteRTCEngine#setScreenAudioSourceType} 将音频输入源设置为 ByteRTCAudioSourceTypeExternal 自定义采集,需先切换为 ByteRTCAudioSourceTypeInternal 内部采集,否则该接口调用无效,并将触发 rtcEngine:onAudioDeviceWarning:deviceType:deviceWarning:{@link #ByteRTCEngineDelegate#rtcEngine:onAudioDeviceWarning:deviceType:deviceWarning} 回调。 - 采集后,你还需要调用 publishScreenAudio: 将采集到的屏幕音频推送到远端。 - 要关闭屏幕音频内部采集,调用 stopScreenAudioCapture{@link #ByteRTCEngine#stopScreenAudioCapture}。

Implementation

FutureOr<int> startScreenAudioCapture(NSString deviceId) async {
  return await nativeCall('startScreenAudioCapture:', [deviceId]);
}