I am trying to build an app that use google speech cloud api in android kotlin
here is my code
launch {
googleTextToSpeech = TextToSpeechC
I'm not an Android developer, but my feeling is that you shouldn't call the TextToSpeech directly from your Android app. You should call it through a backend (On AppEngine for example, or on Firebase Functions).
This backend is authenticated by the TextToSpeech API, and your Android client is authenticated on your backend.
Thereby, you can control who use your app, and your TextToSpeech feature. In any case, never put the service account secret key file in your app, either anybody that download you app can steal the key and perform call on the service account behalf and you will pay the bill!