Title: [google-cloud-java][Text-to-Speech][Android] want to use api key · Issue #3400 · googleapis/google-cloud-java · GitHub
Open Graph Title: [google-cloud-java][Text-to-Speech][Android] want to use api key · Issue #3400 · googleapis/google-cloud-java
X Title: [google-cloud-java][Text-to-Speech][Android] want to use api key · Issue #3400 · googleapis/google-cloud-java
Description: I use the Text-to-Speech Java Library on my Android app. I want to use google cloud api-key to use the Text-to-Speech Java Library. On my android. If I did the following code, it got the error message. try (TextToSpeechClient textToSpeec...
Open Graph Description: I use the Text-to-Speech Java Library on my Android app. I want to use google cloud api-key to use the Text-to-Speech Java Library. On my android. If I did the following code, it got the error mess...
X Description: I use the Text-to-Speech Java Library on my Android app. I want to use google cloud api-key to use the Text-to-Speech Java Library. On my android. If I did the following code, it got the error mess...
Opengraph URL: https://github.com/googleapis/google-cloud-java/issues/3400
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[google-cloud-java][Text-to-Speech][Android] want to use api key","articleBody":"I use the [Text-to-Speech Java Library](https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-clients/google-cloud-texttospeech) on my Android app. \r\nI want to use google cloud api-key to use the Text-to-Speech Java Library.\r\n\r\nOn my android. If I did the following code, it got the error message.\r\n```\r\ntry (TextToSpeechClient textToSpeechClient = TextToSpeechClient.create()) { \r\n}\r\n\r\n/* \r\nerror message\r\njava.io.IOException: The Application Default Credentials are not available. \r\nThey are available if running in Google Compute Engine. \r\nOtherwise, the environment variable GOOGLE_APPLICATION_CREDENTIALS must be defined pointing to a file defining the credentials.\r\nSee https://developers.google.com/accounts/docs/application-default-credentials for more information.\r\n*/\r\n```\r\nSo I read the [Authentication API Keys document](https://cloud.google.com/docs/authentication/api-keys) and found API-Key not support Text-to-Speech, so I can't use api-key to Text-to-Speech Java Library.\r\n\r\nIf I want to use Text-to-Speech by API-Key or Text-to-Speech Java Library on Android. How can I do it ?\r\n\r\nThe following code is my command line and execute on mac and It work fine and can get the \"audioContent\". I think I can use http method by java. Is there any other way ?\r\n```\r\nCurl -H \"X-Goog-Api-Key: API_KEY\" \\\r\n -H \"Content-Type: application/json; charset=utf-8\" \\\r\n --data \"{\r\n 'input':{\r\n 'text':'Hello I am david, Nice to meet you'\r\n },\r\n 'voice':{\r\n 'languageCode':'en-gb',\r\n 'name':'en-GB-Standard-A',\r\n 'ssmlGender':'FEMALE'\r\n },\r\n 'audioConfig':{\r\n 'audioEncoding':'MP3'\r\n }\r\n }\" \"https://texttospeech.googleapis.com/v1beta1/text:synthesize\"\r\n```\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n","author":{"url":"https://github.com/changemyminds","@type":"Person","name":"changemyminds"},"datePublished":"2018-06-22T09:36:54.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":6},"url":"https://github.com/3400/google-cloud-java/issues/3400"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:715618df-41bf-7132-4a83-26f8fa75a564 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A2B2:53D51:35D519:4AABEC:6A4C7CC2 |
| html-safe-nonce | 8931b482ccd66abc1813794afabb1df9416417e6e557cebb62e5abf3b63971a0 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMkIyOjUzRDUxOjM1RDUxOTo0QUFCRUM6NkE0QzdDQzIiLCJ2aXNpdG9yX2lkIjoiNjM4MzI2NDA0MTU4NjY4NzE3MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | f00a0565f8c023319dce549a031673cfeb302a650cd409a04c867fbda03041dd |
| hovercard-subject-tag | issue:334811962 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/googleapis/google-cloud-java/3400/issue_layout |
| twitter:image | https://opengraph.githubassets.com/85a1abb6acd8e59c25b2ceb9acf1e21ff42f6f34fc2ae6019d41501ab7cd7ca7/googleapis/google-cloud-java/issues/3400 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/85a1abb6acd8e59c25b2ceb9acf1e21ff42f6f34fc2ae6019d41501ab7cd7ca7/googleapis/google-cloud-java/issues/3400 |
| og:image:alt | I use the Text-to-Speech Java Library on my Android app. I want to use google cloud api-key to use the Text-to-Speech Java Library. On my android. If I did the following code, it got the error mess... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | changemyminds |
| hostname | github.com |
| expected-hostname | github.com |
| None | 3d11bb817438277de2a940854450e83a7d32b6aeb5014e9e6b00a6423900251c |
| turbo-cache-control | no-preview |
| go-import | github.com/googleapis/google-cloud-java git https://github.com/googleapis/google-cloud-java.git |
| octolytics-dimension-user_id | 16785467 |
| octolytics-dimension-user_login | googleapis |
| octolytics-dimension-repository_id | 26181278 |
| octolytics-dimension-repository_nwo | googleapis/google-cloud-java |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 26181278 |
| octolytics-dimension-repository_network_root_nwo | googleapis/google-cloud-java |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | cd470457e909b9d062f8002cf438ba870e6acff6 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width