pushScreenAudioFrame method

FutureOr<int> pushScreenAudioFrame(
  1. AudioFrame audioFrame
)

@detail api @author liyi.000 @brief Using a custom capture method, when capturing screen audio during screen sharing, push the audio frame to the RTC SDK for encoding and other processing. @param audioFrame Audio data frame. See AudioFrame{@link #AudioFrame} @return Method call result
- 0: Setup succeeded. - < 0: Setup failed. See ReturnStatus{@link #ReturnStatus} for more details. @note - Before calling this API to push custom collected audio data, you must call setScreenAudioSourceType{@link #RTCEngine#setScreenAudioSourceType} to start custom capture of the screen audio. - You should call this method every 10 milliseconds to push a custom captured audio frame. A push audio frame should contain frame.sample _rate/100 audio sample points. For example, if the sampling rate is 48000Hz, 480 sampling points should be pushed each time. - The audio sampling format is S16. The data format in the audio buffer must be PCM data, and its capacity size should be samples × frame.channel × 2. - After calling this interface to push the custom captured audio frame to the RTC SDK, you must call publishScreenAudio to push the captured screen audio to the remote end. Audio frame information pushed to the RTC SDK is lost before calling publishScreenAudio. @order 8

Implementation

FutureOr<int> pushScreenAudioFrame(AudioFrame audioFrame) async {
  return await nativeCall('pushScreenAudioFrame', [audioFrame]);
}