stopCapture method

void stopCapture({
  1. SVUIStopListener? listener,
})

停止录音 用于提前停止口语评测和问答的录音(问答和口语评测会在有结果时主动停止录音) @param listener 结果回调(可选参数)

Implementation

void stopCapture({SVUIStopListener? listener}) {
  try {
    Configure.channel.invokeMethod("stopCapture");
    if (null != listener && null != listener.onStopSuccess) {
      listener.onStopSuccess!();
    }
  } on PlatformException catch (e) {
    // result.error("failed", "failed unknow", "i don't know")
    print(e);
    if (null != listener && null != listener.onStopFailed) {
      listener.onStopFailed!(int.parse(e.code), e.message);
    }
  } on MissingPluginException catch (e) {
    //result.notImplemented()
    print(e);
    if (null != listener && null != listener.onStopFailed) {
      listener.onStopFailed!(ErrorCode.NOT_IMPLEMENTED, e.message);
    }
  }
}