inferStream method

ValueNotifier<String> inferStream(
  1. String inputPath, {
  2. String? logPath,
  3. int numProcessors = 1,
  4. String language = "auto",
  5. bool translate = false,
  6. String initialPrompt = "",
  7. int startTime = 0,
  8. int endTime = -1,
  9. bool useOriginalTime = true,
  10. int strategy = whisper_sampling_strategy.WHISPER_SAMPLING_GREEDY,
})

Implementation

ValueNotifier<String> inferStream(String inputPath,
    {String? logPath,
    int numProcessors = 1,
    String language = "auto",
    bool translate = false,
    String initialPrompt = "",
    int startTime = 0,
    int endTime = -1,
    bool useOriginalTime = true,
    int strategy = whisper_sampling_strategy.WHISPER_SAMPLING_GREEDY}) {
  if (outputMode == "json") {
    throw Exception("JSON output is not supported for streaming yet");
  }

  inferIsolate(
    inputPath,
    logPath: logPath,
    numProcessors: numProcessors,
    language: language,
    translate: translate,
    initialPrompt: initialPrompt,
    strategy: strategy,
    startTime: startTime,
    endTime: endTime,
    useOriginalTime: useOriginalTime,
    newSegmentCallback: getSegmentCallback,
  );

  return result;
}