@googleapis/texttospeech 3.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/CHANGELOG.md +26 -0
- package/build/v1.d.ts +358 -0
- package/build/v1.js.map +1 -1
- package/build/v1beta1.d.ts +267 -0
- package/build/v1beta1.js.map +1 -1
- package/package.json +1 -1
- package/v1.ts +358 -0
- package/v1beta1.ts +267 -0
package/v1beta1.ts
CHANGED
|
@@ -503,6 +503,67 @@ export namespace texttospeech_v1beta1 {
|
|
|
503
503
|
|
|
504
504
|
/**
|
|
505
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
|
+
* ```
|
|
506
567
|
*
|
|
507
568
|
* @param params - Parameters for request
|
|
508
569
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -614,6 +675,56 @@ export namespace texttospeech_v1beta1 {
|
|
|
614
675
|
|
|
615
676
|
/**
|
|
616
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
|
+
* ```
|
|
617
728
|
*
|
|
618
729
|
* @param params - Parameters for request
|
|
619
730
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -702,6 +813,59 @@ export namespace texttospeech_v1beta1 {
|
|
|
702
813
|
|
|
703
814
|
/**
|
|
704
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
|
+
* ```
|
|
705
869
|
*
|
|
706
870
|
* @param params - Parameters for request
|
|
707
871
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -829,6 +993,63 @@ export namespace texttospeech_v1beta1 {
|
|
|
829
993
|
|
|
830
994
|
/**
|
|
831
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
|
+
* ```
|
|
832
1053
|
*
|
|
833
1054
|
* @param params - Parameters for request
|
|
834
1055
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -937,6 +1158,52 @@ export namespace texttospeech_v1beta1 {
|
|
|
937
1158
|
|
|
938
1159
|
/**
|
|
939
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
|
+
* ```
|
|
940
1207
|
*
|
|
941
1208
|
* @param params - Parameters for request
|
|
942
1209
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|