pollingLongRunningRecognize method
Future<LongRunningRequestResult>
pollingLongRunningRecognize(
- RecognitionConfigBeta config,
- String audioGcsUri, {
- Duration pollInterval = const Duration(seconds: 1),
Implementation
Future<LongRunningRequestResult> pollingLongRunningRecognize(
RecognitionConfigBeta config, String audioGcsUri,
{Duration pollInterval = const Duration(seconds: 1)}) async {
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);
final operation = await client.longRunningRecognize(request);
return _pollOperation(operation, pollInterval);
}