GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [google-cloud-java][Text-to-Speech][Android] want to use api key · Issue #3400 · googleapis/google-cloud-java

[google-cloud-java][Text-to-Speech][Android] want to use api key #3400

New issue
Copy link
New issue
Copy link
Closed
Closed
[google-cloud-java][Text-to-Speech][Android] want to use api key#3400
Copy link
Assignees
yihanzhen
Labels
androidapi: texttospeechIssues related to the Text-to-Speech API.priority: p2Moderately-important priority. Fix may not be included in next release.type: questionRequest for information or clarification. Not an issue.

Description

@changemyminds
changemyminds
opened on Jun 22, 2018
Issue body actions

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 textToSpeechClient = TextToSpeechClient.create()) { 
}

/* 
error message
java.io.IOException: The Application Default Credentials are not available. 
They are available if running in Google Compute Engine. 
Otherwise, the environment variable GOOGLE_APPLICATION_CREDENTIALS must be defined pointing to a file defining the credentials.
See https://developers.google.com/accounts/docs/application-default-credentials for more information.
*/

So I read the Authentication API Keys document and found API-Key not support Text-to-Speech, so I can't use api-key to Text-to-Speech Java Library.

If I want to use Text-to-Speech by API-Key or Text-to-Speech Java Library on Android. How can I do it ?

The 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 ?

Curl -H "X-Goog-Api-Key: API_KEY" \
  -H "Content-Type: application/json; charset=utf-8" \
  --data "{
    'input':{
      'text':'Hello I am david, Nice to meet you'
    },
    'voice':{
      'languageCode':'en-gb',
      'name':'en-GB-Standard-A',
      'ssmlGender':'FEMALE'
    },
    'audioConfig':{
      'audioEncoding':'MP3'
    }
  }" "https://texttospeech.googleapis.com/v1beta1/text:synthesize"
Reacted by IrfanJam33L

Activity

  1. JustinBeckwith
    added
    triage meI really want to be triaged.
    on Jun 23, 2018
  2. changemyminds commented on Jun 24, 2018

    @changemyminds
    changemyminds
    on Jun 24, 2018
    Author
    More actions

    I use http-method to use the API_KEY on Android and it work fine for me.

    Here is the example. But if you use restricted Google API key on Android, it can't work.

    If the Text-to-Speech Java Library can support the API_KEY, please let me know. Thanks.

  3. yihanzhen
    added
    type: questionRequest for information or clarification. Not an issue.
    android
    priority: p2Moderately-important priority. Fix may not be included in next release.
    api: texttospeechIssues related to the Text-to-Speech API.
    and removed
    triage meI really want to be triaged.
    on Jun 26, 2018
  4. yihanzhen commented on Jun 27, 2018

    @yihanzhen
    yihanzhen
    on Jun 27, 2018
    Contributor
    More actions

    Thanks for the information. Currently there probably won't be a better way, but we are working on an authentication approach for android right now. Please stand by.

  5. yihanzhen
    closed this as completedon Jun 27, 2018
  6. yankarinRG commented on Jul 7, 2019

    @yankarinRG
    yankarinRG
    on Jul 7, 2019
    More actions

    Thanks for the information. Currently there probably won't be a better way, but we are working on an authentication approach for android right now. Please stand by.

    Hello @hzyi-google, since your reply is one year old, were there any updates on a dedicated Android library for Google Cloud Text-to-Speech?

    Thank you.

  7. IrfanJam33L commented on Aug 26, 2019

    @IrfanJam33L
    IrfanJam33L
    on Aug 26, 2019
    More actions

    heyy can you provide full code? I want to use this API in my app but there is no proper documentation for using it in Android

  8. yihanzhen commented on Aug 26, 2019

    @yihanzhen
    yihanzhen
    on Aug 26, 2019
    Contributor
    More actions

    I stopped working on the Java libraries a while ago so I don't know the latest status.

    cc/ @ajaaym @chingor13

  9. JustinBeckwith
    assigned
    yihanzhen
    on Feb 1, 2021
  10. nikste commented on Jun 18, 2023

    @nikste
    nikste
    on Jun 18, 2023
    More actions

    Any update on this?

  11. chingor13
    added 5 commits that reference this issue on Mar 24, 2026

    Revert "feat: Add experimental S2A integration in client libraries gr…

    ed915ab

    feat: revert #3400: reintroduce experimental S2A integration in clien…

    ac0df2d

    chore(main): release 2.52.0 (#3576)

    1dca4fb

    feat: Enable MTLS_S2A bound token by default for gRPC S2A enabled flo…

    6866c91

    chore(main): release 6.79.0 (#3400)

    076ff38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @yihanzhen
    yihanzhen

Labels

androidapi: texttospeechIssues related to the Text-to-Speech API.priority: p2Moderately-important priority. Fix may not be included in next release.type: questionRequest for information or clarification. Not an issue.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.