📜  如何为 SpeechClient Java google api 设置凭据 - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:17.365000             🧑  作者: Mango

代码示例1
CredentialsProvider credentialsProvider = FixedCredentialsProvider.create(ServiceAccountCredentials.fromStream(new FileInputStream("path/to/service-account.json")));

SpeechSettings settings = SpeechSettings.newBuilder().setCredentialsProvider(credentialsProvider).build();
SpeechClient speechClient = SpeechClient.create(settings);