longRunningRecognize method

ResponseFuture<Operation> longRunningRecognize(
  1. RecognitionConfigBeta config,
  2. String audioGcsUri
)

Sends a LongRunningRecognizeRequest request to the Google Speech Api. Requires a RecognitionConfigBeta and an RecognitionAudio.

To use asynchronous speech recognition to transcribe audio longer than 60 seconds, you must have your data saved in a Google Cloud Storage bucket.

Implementation

ResponseFuture<Operation> longRunningRecognize(
    RecognitionConfigBeta config, String audioGcsUri) {
  final client = SpeechClient(_channel, options: _options);

  // transform audio to RecognitionAudio
  final recognitionAudio = RecognitionAudio()..uri = audioGcsUri;

  // Create the request, which transmits the necessary
  // data to the Google Api.
  final request = (LongRunningRecognizeRequest()
    ..config = config.toConfig()
    ..audio = recognitionAudio);
  return client.longRunningRecognize(request);
}