@googleapis/texttospeech 2.0.1 → 4.0.1

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
@@ -23,7 +23,7 @@ import {
23
23
  Compute,
24
24
  UserRefreshClient,
25
25
  BaseExternalAccountClient,
26
- GaxiosPromise,
26
+ GaxiosResponseWithHTTP2,
27
27
  GoogleConfigurable,
28
28
  createAPIRequest,
29
29
  MethodOptions,
@@ -303,6 +303,10 @@ export namespace texttospeech_v1beta1 {
303
303
  * Optional. The pronunciation customizations are applied to the input. If this is set, the input is synthesized using the given pronunciation customizations. The initial support is for en-us, with plans to expand to other locales in the future. Instant Clone voices aren't supported. In order to customize the pronunciation of a phrase, there must be an exact match of the phrase in the input types. If using SSML, the phrase must not be inside a phoneme tag.
304
304
  */
305
305
  customPronunciations?: Schema$CustomPronunciations;
306
+ /**
307
+ * Markup for HD voices specifically. This field may not be used with any other voices.
308
+ */
309
+ markup?: string | null;
306
310
  /**
307
311
  * The multi-speaker input to be synthesized. Only applicable for multi-speaker synthesis.
308
312
  */
@@ -499,6 +503,67 @@ export namespace texttospeech_v1beta1 {
499
503
 
500
504
  /**
501
505
  * Synthesizes long form text asynchronously.
506
+ * @example
507
+ * ```js
508
+ * // Before running the sample:
509
+ * // - Enable the API at:
510
+ * // https://console.developers.google.com/apis/api/texttospeech.googleapis.com
511
+ * // - Login into gcloud by running:
512
+ * // ```sh
513
+ * // $ gcloud auth application-default login
514
+ * // ```
515
+ * // - Install the npm module by running:
516
+ * // ```sh
517
+ * // $ npm install googleapis
518
+ * // ```
519
+ *
520
+ * const {google} = require('googleapis');
521
+ * const texttospeech = google.texttospeech('v1beta1');
522
+ *
523
+ * async function main() {
524
+ * const auth = new google.auth.GoogleAuth({
525
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
526
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
527
+ * });
528
+ *
529
+ * // Acquire an auth client, and bind it to all future calls
530
+ * const authClient = await auth.getClient();
531
+ * google.options({auth: authClient});
532
+ *
533
+ * // Do the magic
534
+ * const res = await texttospeech.projects.locations.synthesizeLongAudio({
535
+ * // The resource states of the request in the form of `projects/x/locations/x`.
536
+ * parent: 'projects/my-project/locations/my-location',
537
+ *
538
+ * // Request body metadata
539
+ * requestBody: {
540
+ * // request body parameters
541
+ * // {
542
+ * // "audioConfig": {},
543
+ * // "input": {},
544
+ * // "outputGcsUri": "my_outputGcsUri",
545
+ * // "voice": {}
546
+ * // }
547
+ * },
548
+ * });
549
+ * console.log(res.data);
550
+ *
551
+ * // Example response
552
+ * // {
553
+ * // "done": false,
554
+ * // "error": {},
555
+ * // "metadata": {},
556
+ * // "name": "my_name",
557
+ * // "response": {}
558
+ * // }
559
+ * }
560
+ *
561
+ * main().catch(e => {
562
+ * console.error(e);
563
+ * throw e;
564
+ * });
565
+ *
566
+ * ```
502
567
  *
503
568
  * @param params - Parameters for request
504
569
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -508,11 +573,11 @@ export namespace texttospeech_v1beta1 {
508
573
  synthesizeLongAudio(
509
574
  params: Params$Resource$Projects$Locations$Synthesizelongaudio,
510
575
  options: StreamMethodOptions
511
- ): GaxiosPromise<Readable>;
576
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
512
577
  synthesizeLongAudio(
513
578
  params?: Params$Resource$Projects$Locations$Synthesizelongaudio,
514
579
  options?: MethodOptions
515
- ): GaxiosPromise<Schema$Operation>;
580
+ ): Promise<GaxiosResponseWithHTTP2<Schema$Operation>>;
516
581
  synthesizeLongAudio(
517
582
  params: Params$Resource$Projects$Locations$Synthesizelongaudio,
518
583
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -541,7 +606,10 @@ export namespace texttospeech_v1beta1 {
541
606
  callback?:
542
607
  | BodyResponseCallback<Schema$Operation>
543
608
  | BodyResponseCallback<Readable>
544
- ): void | GaxiosPromise<Schema$Operation> | GaxiosPromise<Readable> {
609
+ ):
610
+ | void
611
+ | Promise<GaxiosResponseWithHTTP2<Schema$Operation>>
612
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
545
613
  let params = (paramsOrCallback ||
546
614
  {}) as Params$Resource$Projects$Locations$Synthesizelongaudio;
547
615
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -607,6 +675,56 @@ export namespace texttospeech_v1beta1 {
607
675
 
608
676
  /**
609
677
  * 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.
678
+ * @example
679
+ * ```js
680
+ * // Before running the sample:
681
+ * // - Enable the API at:
682
+ * // https://console.developers.google.com/apis/api/texttospeech.googleapis.com
683
+ * // - Login into gcloud by running:
684
+ * // ```sh
685
+ * // $ gcloud auth application-default login
686
+ * // ```
687
+ * // - Install the npm module by running:
688
+ * // ```sh
689
+ * // $ npm install googleapis
690
+ * // ```
691
+ *
692
+ * const {google} = require('googleapis');
693
+ * const texttospeech = google.texttospeech('v1beta1');
694
+ *
695
+ * async function main() {
696
+ * const auth = new google.auth.GoogleAuth({
697
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
698
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
699
+ * });
700
+ *
701
+ * // Acquire an auth client, and bind it to all future calls
702
+ * const authClient = await auth.getClient();
703
+ * google.options({auth: authClient});
704
+ *
705
+ * // Do the magic
706
+ * const res = await texttospeech.projects.locations.operations.get({
707
+ * // The name of the operation resource.
708
+ * name: 'projects/my-project/locations/my-location/operations/my-operation',
709
+ * });
710
+ * console.log(res.data);
711
+ *
712
+ * // Example response
713
+ * // {
714
+ * // "done": false,
715
+ * // "error": {},
716
+ * // "metadata": {},
717
+ * // "name": "my_name",
718
+ * // "response": {}
719
+ * // }
720
+ * }
721
+ *
722
+ * main().catch(e => {
723
+ * console.error(e);
724
+ * throw e;
725
+ * });
726
+ *
727
+ * ```
610
728
  *
611
729
  * @param params - Parameters for request
612
730
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -616,11 +734,11 @@ export namespace texttospeech_v1beta1 {
616
734
  get(
617
735
  params: Params$Resource$Projects$Locations$Operations$Get,
618
736
  options: StreamMethodOptions
619
- ): GaxiosPromise<Readable>;
737
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
620
738
  get(
621
739
  params?: Params$Resource$Projects$Locations$Operations$Get,
622
740
  options?: MethodOptions
623
- ): GaxiosPromise<Schema$Operation>;
741
+ ): Promise<GaxiosResponseWithHTTP2<Schema$Operation>>;
624
742
  get(
625
743
  params: Params$Resource$Projects$Locations$Operations$Get,
626
744
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -649,7 +767,10 @@ export namespace texttospeech_v1beta1 {
649
767
  callback?:
650
768
  | BodyResponseCallback<Schema$Operation>
651
769
  | BodyResponseCallback<Readable>
652
- ): void | GaxiosPromise<Schema$Operation> | GaxiosPromise<Readable> {
770
+ ):
771
+ | void
772
+ | Promise<GaxiosResponseWithHTTP2<Schema$Operation>>
773
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
653
774
  let params = (paramsOrCallback ||
654
775
  {}) as Params$Resource$Projects$Locations$Operations$Get;
655
776
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -692,6 +813,59 @@ export namespace texttospeech_v1beta1 {
692
813
 
693
814
  /**
694
815
  * Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.
816
+ * @example
817
+ * ```js
818
+ * // Before running the sample:
819
+ * // - Enable the API at:
820
+ * // https://console.developers.google.com/apis/api/texttospeech.googleapis.com
821
+ * // - Login into gcloud by running:
822
+ * // ```sh
823
+ * // $ gcloud auth application-default login
824
+ * // ```
825
+ * // - Install the npm module by running:
826
+ * // ```sh
827
+ * // $ npm install googleapis
828
+ * // ```
829
+ *
830
+ * const {google} = require('googleapis');
831
+ * const texttospeech = google.texttospeech('v1beta1');
832
+ *
833
+ * async function main() {
834
+ * const auth = new google.auth.GoogleAuth({
835
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
836
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
837
+ * });
838
+ *
839
+ * // Acquire an auth client, and bind it to all future calls
840
+ * const authClient = await auth.getClient();
841
+ * google.options({auth: authClient});
842
+ *
843
+ * // Do the magic
844
+ * const res = await texttospeech.projects.locations.operations.list({
845
+ * // The standard list filter.
846
+ * filter: 'placeholder-value',
847
+ * // The name of the operation's parent resource.
848
+ * name: 'projects/my-project/locations/my-location',
849
+ * // The standard list page size.
850
+ * pageSize: 'placeholder-value',
851
+ * // The standard list page token.
852
+ * pageToken: 'placeholder-value',
853
+ * });
854
+ * console.log(res.data);
855
+ *
856
+ * // Example response
857
+ * // {
858
+ * // "nextPageToken": "my_nextPageToken",
859
+ * // "operations": []
860
+ * // }
861
+ * }
862
+ *
863
+ * main().catch(e => {
864
+ * console.error(e);
865
+ * throw e;
866
+ * });
867
+ *
868
+ * ```
695
869
  *
696
870
  * @param params - Parameters for request
697
871
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -701,11 +875,11 @@ export namespace texttospeech_v1beta1 {
701
875
  list(
702
876
  params: Params$Resource$Projects$Locations$Operations$List,
703
877
  options: StreamMethodOptions
704
- ): GaxiosPromise<Readable>;
878
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
705
879
  list(
706
880
  params?: Params$Resource$Projects$Locations$Operations$List,
707
881
  options?: MethodOptions
708
- ): GaxiosPromise<Schema$ListOperationsResponse>;
882
+ ): Promise<GaxiosResponseWithHTTP2<Schema$ListOperationsResponse>>;
709
883
  list(
710
884
  params: Params$Resource$Projects$Locations$Operations$List,
711
885
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -738,8 +912,8 @@ export namespace texttospeech_v1beta1 {
738
912
  | BodyResponseCallback<Readable>
739
913
  ):
740
914
  | void
741
- | GaxiosPromise<Schema$ListOperationsResponse>
742
- | GaxiosPromise<Readable> {
915
+ | Promise<GaxiosResponseWithHTTP2<Schema$ListOperationsResponse>>
916
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
743
917
  let params = (paramsOrCallback ||
744
918
  {}) as Params$Resource$Projects$Locations$Operations$List;
745
919
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -819,6 +993,63 @@ export namespace texttospeech_v1beta1 {
819
993
 
820
994
  /**
821
995
  * Synthesizes speech synchronously: receive results after all text input has been processed.
996
+ * @example
997
+ * ```js
998
+ * // Before running the sample:
999
+ * // - Enable the API at:
1000
+ * // https://console.developers.google.com/apis/api/texttospeech.googleapis.com
1001
+ * // - Login into gcloud by running:
1002
+ * // ```sh
1003
+ * // $ gcloud auth application-default login
1004
+ * // ```
1005
+ * // - Install the npm module by running:
1006
+ * // ```sh
1007
+ * // $ npm install googleapis
1008
+ * // ```
1009
+ *
1010
+ * const {google} = require('googleapis');
1011
+ * const texttospeech = google.texttospeech('v1beta1');
1012
+ *
1013
+ * async function main() {
1014
+ * const auth = new google.auth.GoogleAuth({
1015
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
1016
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
1017
+ * });
1018
+ *
1019
+ * // Acquire an auth client, and bind it to all future calls
1020
+ * const authClient = await auth.getClient();
1021
+ * google.options({auth: authClient});
1022
+ *
1023
+ * // Do the magic
1024
+ * const res = await texttospeech.text.synthesize({
1025
+ * // Request body metadata
1026
+ * requestBody: {
1027
+ * // request body parameters
1028
+ * // {
1029
+ * // "advancedVoiceOptions": {},
1030
+ * // "audioConfig": {},
1031
+ * // "enableTimePointing": [],
1032
+ * // "input": {},
1033
+ * // "voice": {}
1034
+ * // }
1035
+ * },
1036
+ * });
1037
+ * console.log(res.data);
1038
+ *
1039
+ * // Example response
1040
+ * // {
1041
+ * // "audioConfig": {},
1042
+ * // "audioContent": "my_audioContent",
1043
+ * // "timepoints": []
1044
+ * // }
1045
+ * }
1046
+ *
1047
+ * main().catch(e => {
1048
+ * console.error(e);
1049
+ * throw e;
1050
+ * });
1051
+ *
1052
+ * ```
822
1053
  *
823
1054
  * @param params - Parameters for request
824
1055
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -828,11 +1059,11 @@ export namespace texttospeech_v1beta1 {
828
1059
  synthesize(
829
1060
  params: Params$Resource$Text$Synthesize,
830
1061
  options: StreamMethodOptions
831
- ): GaxiosPromise<Readable>;
1062
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
832
1063
  synthesize(
833
1064
  params?: Params$Resource$Text$Synthesize,
834
1065
  options?: MethodOptions
835
- ): GaxiosPromise<Schema$SynthesizeSpeechResponse>;
1066
+ ): Promise<GaxiosResponseWithHTTP2<Schema$SynthesizeSpeechResponse>>;
836
1067
  synthesize(
837
1068
  params: Params$Resource$Text$Synthesize,
838
1069
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -867,8 +1098,8 @@ export namespace texttospeech_v1beta1 {
867
1098
  | BodyResponseCallback<Readable>
868
1099
  ):
869
1100
  | void
870
- | GaxiosPromise<Schema$SynthesizeSpeechResponse>
871
- | GaxiosPromise<Readable> {
1101
+ | Promise<GaxiosResponseWithHTTP2<Schema$SynthesizeSpeechResponse>>
1102
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
872
1103
  let params = (paramsOrCallback || {}) as Params$Resource$Text$Synthesize;
873
1104
  let options = (optionsOrCallback || {}) as MethodOptions;
874
1105
 
@@ -927,6 +1158,52 @@ export namespace texttospeech_v1beta1 {
927
1158
 
928
1159
  /**
929
1160
  * Returns a list of Voice supported for synthesis.
1161
+ * @example
1162
+ * ```js
1163
+ * // Before running the sample:
1164
+ * // - Enable the API at:
1165
+ * // https://console.developers.google.com/apis/api/texttospeech.googleapis.com
1166
+ * // - Login into gcloud by running:
1167
+ * // ```sh
1168
+ * // $ gcloud auth application-default login
1169
+ * // ```
1170
+ * // - Install the npm module by running:
1171
+ * // ```sh
1172
+ * // $ npm install googleapis
1173
+ * // ```
1174
+ *
1175
+ * const {google} = require('googleapis');
1176
+ * const texttospeech = google.texttospeech('v1beta1');
1177
+ *
1178
+ * async function main() {
1179
+ * const auth = new google.auth.GoogleAuth({
1180
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
1181
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
1182
+ * });
1183
+ *
1184
+ * // Acquire an auth client, and bind it to all future calls
1185
+ * const authClient = await auth.getClient();
1186
+ * google.options({auth: authClient});
1187
+ *
1188
+ * // Do the magic
1189
+ * const res = await texttospeech.voices.list({
1190
+ * // 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.
1191
+ * languageCode: 'placeholder-value',
1192
+ * });
1193
+ * console.log(res.data);
1194
+ *
1195
+ * // Example response
1196
+ * // {
1197
+ * // "voices": []
1198
+ * // }
1199
+ * }
1200
+ *
1201
+ * main().catch(e => {
1202
+ * console.error(e);
1203
+ * throw e;
1204
+ * });
1205
+ *
1206
+ * ```
930
1207
  *
931
1208
  * @param params - Parameters for request
932
1209
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -936,11 +1213,11 @@ export namespace texttospeech_v1beta1 {
936
1213
  list(
937
1214
  params: Params$Resource$Voices$List,
938
1215
  options: StreamMethodOptions
939
- ): GaxiosPromise<Readable>;
1216
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
940
1217
  list(
941
1218
  params?: Params$Resource$Voices$List,
942
1219
  options?: MethodOptions
943
- ): GaxiosPromise<Schema$ListVoicesResponse>;
1220
+ ): Promise<GaxiosResponseWithHTTP2<Schema$ListVoicesResponse>>;
944
1221
  list(
945
1222
  params: Params$Resource$Voices$List,
946
1223
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -971,8 +1248,8 @@ export namespace texttospeech_v1beta1 {
971
1248
  | BodyResponseCallback<Readable>
972
1249
  ):
973
1250
  | void
974
- | GaxiosPromise<Schema$ListVoicesResponse>
975
- | GaxiosPromise<Readable> {
1251
+ | Promise<GaxiosResponseWithHTTP2<Schema$ListVoicesResponse>>
1252
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
976
1253
  let params = (paramsOrCallback || {}) as Params$Resource$Voices$List;
977
1254
  let options = (optionsOrCallback || {}) as MethodOptions;
978
1255