Reputation: 21
In my app I need to use Google Cloud Text to Speech. I add sdk via gralde implementation 'com.google.cloud:google-cloud-texttospeech:0.100.0-beta'.
After that i am not understanding how to add credentials to my android app. In Cloud console I created and added billing for project and downloaded service account json file. But where can i add in android app ? If i run code without adding the app I'm getting an exception
" 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 "
Upvotes: 0
Views: 1211
Reputation: 31
https://github.com/GoogleCloudPlatform/android-docs-samples/tree/master/speech/Speech
Here you can see how to add credentials
Below is a TTS sample project that I created with reference to Google Cloud STT
https://github.com/ivso0001/GoogleCloudTextToSpeech/tree/master
Upvotes: 1