| OLD | NEW |
| 1 // This is a generated file (see the discoveryapis_generator project). | 1 // This is a generated file (see the discoveryapis_generator project). |
| 2 | 2 |
| 3 library googleapis_beta.speech.v1beta1; | 3 library googleapis_beta.speech.v1beta1; |
| 4 | 4 |
| 5 import 'dart:core' as core; | 5 import 'dart:core' as core; |
| 6 import 'dart:async' as async; | 6 import 'dart:async' as async; |
| 7 import 'dart:convert' as convert; | 7 import 'dart:convert' as convert; |
| 8 | 8 |
| 9 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; | 9 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; |
| 10 import 'package:http/http.dart' as http; | 10 import 'package:http/http.dart' as http; |
| (...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 510 if (response != null) { | 510 if (response != null) { |
| 511 _json["response"] = response; | 511 _json["response"] = response; |
| 512 } | 512 } |
| 513 return _json; | 513 return _json; |
| 514 } | 514 } |
| 515 } | 515 } |
| 516 | 516 |
| 517 /** | 517 /** |
| 518 * Contains audio data in the encoding specified in the `RecognitionConfig`. | 518 * Contains audio data in the encoding specified in the `RecognitionConfig`. |
| 519 * Either `content` or `uri` must be supplied. Supplying both or neither | 519 * Either `content` or `uri` must be supplied. Supplying both or neither |
| 520 * returns google.rpc.Code.INVALID_ARGUMENT. | 520 * returns google.rpc.Code.INVALID_ARGUMENT. See |
| 521 * [audio limits](https://cloud.google.com/speech/limits#content). |
| 521 */ | 522 */ |
| 522 class RecognitionAudio { | 523 class RecognitionAudio { |
| 523 /** | 524 /** |
| 524 * The audio data bytes encoded as specified in | 525 * The audio data bytes encoded as specified in |
| 525 * `RecognitionConfig`. Note: as with all bytes fields, protobuffers use a | 526 * `RecognitionConfig`. Note: as with all bytes fields, protobuffers use a |
| 526 * pure binary representation, whereas JSON representations use base64. | 527 * pure binary representation, whereas JSON representations use base64. |
| 527 */ | 528 */ |
| 528 core.String content; | 529 core.String content; |
| 529 core.List<core.int> get contentAsBytes { | 530 core.List<core.int> get contentAsBytes { |
| 530 return convert.BASE64.decode(content); | 531 return convert.BASE64.decode(content); |
| 531 } | 532 } |
| 532 | 533 |
| 533 void set contentAsBytes(core.List<core.int> _bytes) { | 534 void set contentAsBytes(core.List<core.int> _bytes) { |
| 534 content = convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+",
"-"); | 535 content = convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+",
"-"); |
| 535 } | 536 } |
| 536 /** | 537 /** |
| 537 * URI that points to a file that contains audio data bytes as specified in | 538 * URI that points to a file that contains audio data bytes as specified in |
| 538 * `RecognitionConfig`. Currently, only Google Cloud Storage URIs are | 539 * `RecognitionConfig`. Currently, only Google Cloud Storage URIs are |
| 539 * supported, which must be specified in the following format: | 540 * supported, which must be specified in the following format: |
| 540 * `gs://bucket_name/object_name` (other URI formats return | 541 * `gs://bucket_name/object_name` (other URI formats return |
| 541 * google.rpc.Code.INVALID_ARGUMENT). For more information, see | 542 * google.rpc.Code.INVALID_ARGUMENT). For more information, see |
| 542 * [Request URIs](/storage/docs/reference-uris). | 543 * [Request URIs](https://cloud.google.com/storage/docs/reference-uris). |
| 543 */ | 544 */ |
| 544 core.String uri; | 545 core.String uri; |
| 545 | 546 |
| 546 RecognitionAudio(); | 547 RecognitionAudio(); |
| 547 | 548 |
| 548 RecognitionAudio.fromJson(core.Map _json) { | 549 RecognitionAudio.fromJson(core.Map _json) { |
| 549 if (_json.containsKey("content")) { | 550 if (_json.containsKey("content")) { |
| 550 content = _json["content"]; | 551 content = _json["content"]; |
| 551 } | 552 } |
| 552 if (_json.containsKey("uri")) { | 553 if (_json.containsKey("uri")) { |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 591 * - "AMR" : Adaptive Multi-Rate Narrowband codec. `sample_rate` must be 8000 | 592 * - "AMR" : Adaptive Multi-Rate Narrowband codec. `sample_rate` must be 8000 |
| 592 * Hz. | 593 * Hz. |
| 593 * - "AMR_WB" : Adaptive Multi-Rate Wideband codec. `sample_rate` must be | 594 * - "AMR_WB" : Adaptive Multi-Rate Wideband codec. `sample_rate` must be |
| 594 * 16000 Hz. | 595 * 16000 Hz. |
| 595 */ | 596 */ |
| 596 core.String encoding; | 597 core.String encoding; |
| 597 /** | 598 /** |
| 598 * [Optional] The language of the supplied audio as a BCP-47 language tag. | 599 * [Optional] The language of the supplied audio as a BCP-47 language tag. |
| 599 * Example: "en-GB" https://www.rfc-editor.org/rfc/bcp/bcp47.txt | 600 * Example: "en-GB" https://www.rfc-editor.org/rfc/bcp/bcp47.txt |
| 600 * If omitted, defaults to "en-US". See | 601 * If omitted, defaults to "en-US". See |
| 601 * [Language Support](/speech/docs/best-practices#language_support) for | 602 * [Language |
| 602 * a list of the currently supported language codes. | 603 * Support](https://cloud.google.com/speech/docs/best-practices#language_suppo
rt) |
| 604 * for a list of the currently supported language codes. |
| 603 */ | 605 */ |
| 604 core.String languageCode; | 606 core.String languageCode; |
| 605 /** | 607 /** |
| 606 * [Optional] Maximum number of recognition hypotheses to be returned. | 608 * [Optional] Maximum number of recognition hypotheses to be returned. |
| 607 * Specifically, the maximum number of `SpeechRecognitionAlternative` messages | 609 * Specifically, the maximum number of `SpeechRecognitionAlternative` messages |
| 608 * within each `SpeechRecognitionResult`. | 610 * within each `SpeechRecognitionResult`. |
| 609 * The server may return fewer than `max_alternatives`. | 611 * The server may return fewer than `max_alternatives`. |
| 610 * Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of | 612 * Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of |
| 611 * `1`. If omitted, defaults to `1`. | 613 * `1`. If omitted, defaults to `1`. |
| 612 */ | 614 */ |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 677 return _json; | 679 return _json; |
| 678 } | 680 } |
| 679 } | 681 } |
| 680 | 682 |
| 681 /** | 683 /** |
| 682 * Provides "hints" to the speech recognizer to favor specific words and phrases | 684 * Provides "hints" to the speech recognizer to favor specific words and phrases |
| 683 * in the results. | 685 * in the results. |
| 684 */ | 686 */ |
| 685 class SpeechContext { | 687 class SpeechContext { |
| 686 /** | 688 /** |
| 687 * [Optional] A list of up to 50 phrases of up to 100 characters each to | 689 * [Optional] A list of strings containing words and phrases "hints" so that |
| 688 * provide words and phrases "hints" to the speech recognition so that it is | 690 * the speech recognition is more likely to recognize them. This can be used |
| 689 * more likely to recognize them. | 691 * to improve the accuracy for specific words and phrases, for example, if |
| 692 * specific commands are typically spoken by the user. This can also be used |
| 693 * to add additional words to the vocabulary of the recognizer. See |
| 694 * [usage limits](https://cloud.google.com/speech/limits#content). |
| 690 */ | 695 */ |
| 691 core.List<core.String> phrases; | 696 core.List<core.String> phrases; |
| 692 | 697 |
| 693 SpeechContext(); | 698 SpeechContext(); |
| 694 | 699 |
| 695 SpeechContext.fromJson(core.Map _json) { | 700 SpeechContext.fromJson(core.Map _json) { |
| 696 if (_json.containsKey("phrases")) { | 701 if (_json.containsKey("phrases")) { |
| 697 phrases = _json["phrases"]; | 702 phrases = _json["phrases"]; |
| 698 } | 703 } |
| 699 } | 704 } |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 930 } | 935 } |
| 931 | 936 |
| 932 core.Map toJson() { | 937 core.Map toJson() { |
| 933 var _json = new core.Map(); | 938 var _json = new core.Map(); |
| 934 if (results != null) { | 939 if (results != null) { |
| 935 _json["results"] = results.map((value) => (value).toJson()).toList(); | 940 _json["results"] = results.map((value) => (value).toJson()).toList(); |
| 936 } | 941 } |
| 937 return _json; | 942 return _json; |
| 938 } | 943 } |
| 939 } | 944 } |
| OLD | NEW |