sendCustomAudioFrame method

Future<V2TXLiveCode> sendCustomAudioFrame(
  1. V2TXLiveAudioFrame audioFrame
)

在自定义音频采集模式下,将采集的音频数据发送到SDK

@param audioFrame 向 SDK 发送的 音频帧数据 {@link V2TXLiveDef.V2TXLiveAudioFrame} @return 返回值 {@link V2TXLiveCode}

  • V2TXLIVE_OK: 成功
  • V2TXLIVE_ERROR_REFUSED: 发送失败,您必须先调用 enableCustomAudioCapture 开启自定义音频采集 @brief 在自定义音频采集模式下,将采集的音频数据发送到SDK,SDK不再采集麦克风数据,仅保留编码和发送功能。 @note 需要在 startPush({@link V2TXLivePusher#startPush(String)}) 之前调用 {@link V2TXLivePusher#enableCustomAudioCapture(boolean)} 开启自定义采集。

Implementation

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