@googleapis/texttospeech 3.0.1 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/v1beta1.ts CHANGED
@@ -468,6 +468,10 @@ export namespace texttospeech_v1beta1 {
468
468
  * Required. The language (and potentially also the region) of the voice expressed as a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag, e.g. "en-US". This should not include a script tag (e.g. use "cmn-cn" rather than "cmn-Hant-cn"), because the script will be inferred from the input provided in the SynthesisInput. The TTS service will use this parameter to help choose an appropriate voice. Note that the TTS service may choose a voice with a slightly different language code than the one selected; it may substitute a different region (e.g. using en-US rather than en-CA if there isn't a Canadian voice available), or even a different language, e.g. using "nb" (Norwegian Bokmal) instead of "no" (Norwegian)".
469
469
  */
470
470
  languageCode?: string | null;
471
+ /**
472
+ * Optional. The name of the model. If set, the service will choose the model matching the specified configuration.
473
+ */
474
+ modelName?: string | null;
471
475
  /**
472
476
  * The name of the voice. If both the name and the gender are not set, the service will choose a voice based on the other parameters such as language_code.
473
477
  */
@@ -503,6 +507,67 @@ export namespace texttospeech_v1beta1 {
503
507
 
504
508
  /**
505
509
  * Synthesizes long form text asynchronously.
510
+ * @example
511
+ * ```js
512
+ * // Before running the sample:
513
+ * // - Enable the API at:
514
+ * // https://console.developers.google.com/apis/api/texttospeech.googleapis.com
515
+ * // - Login into gcloud by running:
516
+ * // ```sh
517
+ * // $ gcloud auth application-default login
518
+ * // ```
519
+ * // - Install the npm module by running:
520
+ * // ```sh
521
+ * // $ npm install googleapis
522
+ * // ```
523
+ *
524
+ * const {google} = require('googleapis');
525
+ * const texttospeech = google.texttospeech('v1beta1');
526
+ *
527
+ * async function main() {
528
+ * const auth = new google.auth.GoogleAuth({
529
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
530
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
531
+ * });
532
+ *
533
+ * // Acquire an auth client, and bind it to all future calls
534
+ * const authClient = await auth.getClient();
535
+ * google.options({auth: authClient});
536
+ *
537
+ * // Do the magic
538
+ * const res = await texttospeech.projects.locations.synthesizeLongAudio({
539
+ * // The resource states of the request in the form of `projects/x/locations/x`.
540
+ * parent: 'projects/my-project/locations/my-location',
541
+ *
542
+ * // Request body metadata
543
+ * requestBody: {
544
+ * // request body parameters
545
+ * // {
546
+ * // "audioConfig": {},
547
+ * // "input": {},
548
+ * // "outputGcsUri": "my_outputGcsUri",
549
+ * // "voice": {}
550
+ * // }
551
+ * },
552
+ * });
553
+ * console.log(res.data);
554
+ *
555
+ * // Example response
556
+ * // {
557
+ * // "done": false,
558
+ * // "error": {},
559
+ * // "metadata": {},
560
+ * // "name": "my_name",
561
+ * // "response": {}
562
+ * // }
563
+ * }
564
+ *
565
+ * main().catch(e => {
566
+ * console.error(e);
567
+ * throw e;
568
+ * });
569
+ *
570
+ * ```
506
571
  *
507
572
  * @param params - Parameters for request
508
573
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -614,6 +679,56 @@ export namespace texttospeech_v1beta1 {
614
679
 
615
680
  /**
616
681
  * Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.
682
+ * @example
683
+ * ```js
684
+ * // Before running the sample:
685
+ * // - Enable the API at:
686
+ * // https://console.developers.google.com/apis/api/texttospeech.googleapis.com
687
+ * // - Login into gcloud by running:
688
+ * // ```sh
689
+ * // $ gcloud auth application-default login
690
+ * // ```
691
+ * // - Install the npm module by running:
692
+ * // ```sh
693
+ * // $ npm install googleapis
694
+ * // ```
695
+ *
696
+ * const {google} = require('googleapis');
697
+ * const texttospeech = google.texttospeech('v1beta1');
698
+ *
699
+ * async function main() {
700
+ * const auth = new google.auth.GoogleAuth({
701
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
702
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
703
+ * });
704
+ *
705
+ * // Acquire an auth client, and bind it to all future calls
706
+ * const authClient = await auth.getClient();
707
+ * google.options({auth: authClient});
708
+ *
709
+ * // Do the magic
710
+ * const res = await texttospeech.projects.locations.operations.get({
711
+ * // The name of the operation resource.
712
+ * name: 'projects/my-project/locations/my-location/operations/my-operation',
713
+ * });
714
+ * console.log(res.data);
715
+ *
716
+ * // Example response
717
+ * // {
718
+ * // "done": false,
719
+ * // "error": {},
720
+ * // "metadata": {},
721
+ * // "name": "my_name",
722
+ * // "response": {}
723
+ * // }
724
+ * }
725
+ *
726
+ * main().catch(e => {
727
+ * console.error(e);
728
+ * throw e;
729
+ * });
730
+ *
731
+ * ```
617
732
  *
618
733
  * @param params - Parameters for request
619
734
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -702,6 +817,59 @@ export namespace texttospeech_v1beta1 {
702
817
 
703
818
  /**
704
819
  * Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.
820
+ * @example
821
+ * ```js
822
+ * // Before running the sample:
823
+ * // - Enable the API at:
824
+ * // https://console.developers.google.com/apis/api/texttospeech.googleapis.com
825
+ * // - Login into gcloud by running:
826
+ * // ```sh
827
+ * // $ gcloud auth application-default login
828
+ * // ```
829
+ * // - Install the npm module by running:
830
+ * // ```sh
831
+ * // $ npm install googleapis
832
+ * // ```
833
+ *
834
+ * const {google} = require('googleapis');
835
+ * const texttospeech = google.texttospeech('v1beta1');
836
+ *
837
+ * async function main() {
838
+ * const auth = new google.auth.GoogleAuth({
839
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
840
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
841
+ * });
842
+ *
843
+ * // Acquire an auth client, and bind it to all future calls
844
+ * const authClient = await auth.getClient();
845
+ * google.options({auth: authClient});
846
+ *
847
+ * // Do the magic
848
+ * const res = await texttospeech.projects.locations.operations.list({
849
+ * // The standard list filter.
850
+ * filter: 'placeholder-value',
851
+ * // The name of the operation's parent resource.
852
+ * name: 'projects/my-project/locations/my-location',
853
+ * // The standard list page size.
854
+ * pageSize: 'placeholder-value',
855
+ * // The standard list page token.
856
+ * pageToken: 'placeholder-value',
857
+ * });
858
+ * console.log(res.data);
859
+ *
860
+ * // Example response
861
+ * // {
862
+ * // "nextPageToken": "my_nextPageToken",
863
+ * // "operations": []
864
+ * // }
865
+ * }
866
+ *
867
+ * main().catch(e => {
868
+ * console.error(e);
869
+ * throw e;
870
+ * });
871
+ *
872
+ * ```
705
873
  *
706
874
  * @param params - Parameters for request
707
875
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -829,6 +997,63 @@ export namespace texttospeech_v1beta1 {
829
997
 
830
998
  /**
831
999
  * Synthesizes speech synchronously: receive results after all text input has been processed.
1000
+ * @example
1001
+ * ```js
1002
+ * // Before running the sample:
1003
+ * // - Enable the API at:
1004
+ * // https://console.developers.google.com/apis/api/texttospeech.googleapis.com
1005
+ * // - Login into gcloud by running:
1006
+ * // ```sh
1007
+ * // $ gcloud auth application-default login
1008
+ * // ```
1009
+ * // - Install the npm module by running:
1010
+ * // ```sh
1011
+ * // $ npm install googleapis
1012
+ * // ```
1013
+ *
1014
+ * const {google} = require('googleapis');
1015
+ * const texttospeech = google.texttospeech('v1beta1');
1016
+ *
1017
+ * async function main() {
1018
+ * const auth = new google.auth.GoogleAuth({
1019
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
1020
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
1021
+ * });
1022
+ *
1023
+ * // Acquire an auth client, and bind it to all future calls
1024
+ * const authClient = await auth.getClient();
1025
+ * google.options({auth: authClient});
1026
+ *
1027
+ * // Do the magic
1028
+ * const res = await texttospeech.text.synthesize({
1029
+ * // Request body metadata
1030
+ * requestBody: {
1031
+ * // request body parameters
1032
+ * // {
1033
+ * // "advancedVoiceOptions": {},
1034
+ * // "audioConfig": {},
1035
+ * // "enableTimePointing": [],
1036
+ * // "input": {},
1037
+ * // "voice": {}
1038
+ * // }
1039
+ * },
1040
+ * });
1041
+ * console.log(res.data);
1042
+ *
1043
+ * // Example response
1044
+ * // {
1045
+ * // "audioConfig": {},
1046
+ * // "audioContent": "my_audioContent",
1047
+ * // "timepoints": []
1048
+ * // }
1049
+ * }
1050
+ *
1051
+ * main().catch(e => {
1052
+ * console.error(e);
1053
+ * throw e;
1054
+ * });
1055
+ *
1056
+ * ```
832
1057
  *
833
1058
  * @param params - Parameters for request
834
1059
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -937,6 +1162,52 @@ export namespace texttospeech_v1beta1 {
937
1162
 
938
1163
  /**
939
1164
  * Returns a list of Voice supported for synthesis.
1165
+ * @example
1166
+ * ```js
1167
+ * // Before running the sample:
1168
+ * // - Enable the API at:
1169
+ * // https://console.developers.google.com/apis/api/texttospeech.googleapis.com
1170
+ * // - Login into gcloud by running:
1171
+ * // ```sh
1172
+ * // $ gcloud auth application-default login
1173
+ * // ```
1174
+ * // - Install the npm module by running:
1175
+ * // ```sh
1176
+ * // $ npm install googleapis
1177
+ * // ```
1178
+ *
1179
+ * const {google} = require('googleapis');
1180
+ * const texttospeech = google.texttospeech('v1beta1');
1181
+ *
1182
+ * async function main() {
1183
+ * const auth = new google.auth.GoogleAuth({
1184
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
1185
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
1186
+ * });
1187
+ *
1188
+ * // Acquire an auth client, and bind it to all future calls
1189
+ * const authClient = await auth.getClient();
1190
+ * google.options({auth: authClient});
1191
+ *
1192
+ * // Do the magic
1193
+ * const res = await texttospeech.voices.list({
1194
+ * // Optional. Recommended. [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. If not specified, the API will return all supported voices. If specified, the ListVoices call will only return voices that can be used to synthesize this language_code. For example, if you specify `"en-NZ"`, all `"en-NZ"` voices will be returned. If you specify `"no"`, both `"no-\*"` (Norwegian) and `"nb-\*"` (Norwegian Bokmal) voices will be returned.
1195
+ * languageCode: 'placeholder-value',
1196
+ * });
1197
+ * console.log(res.data);
1198
+ *
1199
+ * // Example response
1200
+ * // {
1201
+ * // "voices": []
1202
+ * // }
1203
+ * }
1204
+ *
1205
+ * main().catch(e => {
1206
+ * console.error(e);
1207
+ * throw e;
1208
+ * });
1209
+ *
1210
+ * ```
940
1211
  *
941
1212
  * @param params - Parameters for request
942
1213
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.