sendCustomAudioFrame method

Future<V2TXLiveCode> sendCustomAudioFrame(
  1. V2TXLiveAudioFrame audioFrame
)

In the custom audio collection mode, the collected audio data is sent to the SDK

Note:

  • In this mode, the SDK no longer collects microphone data, and only retains the encoding and sending functions.
  • You need to call enableCustomAudioCapture before startPush to enable custom capture.

Parameter:

audioFrame Audio frame data sent to the SDK V2TXLiveAudioFrame

Return:

  • V2TXLIVE_OK: Succeed
  • V2TXLIVE_ERROR_REFUSED: If the sending fails, you must first call enableCustomAudioCapture to enable custom audio capture

Implementation

Future<V2TXLiveCode> sendCustomAudioFrame(V2TXLiveAudioFrame audioFrame) async {
  var result = await _channel.invokeMethod("V2TXLiveAudioFrame", audioFrame.toJson());
  return _liveCodeWithResult(result);
}