how to set credentials for speechclient java google api

Solutions on MaxInterview for how to set credentials for speechclient java google api by the best coders in the world

showing results for - "how to set credentials for speechclient java google api"
Amelie
31 Jan 2018
1CredentialsProvider credentialsProvider = FixedCredentialsProvider.create(ServiceAccountCredentials.fromStream(new FileInputStream("path/to/service-account.json")));
2
3SpeechSettings settings = SpeechSettings.newBuilder().setCredentialsProvider(credentialsProvider).build();
4SpeechClient speechClient = SpeechClient.create(settings);
5