【发布时间】:2017-11-19 11:11:43
【问题描述】:
我想将录制的音频文件语音转换为文本。我正在尝试使用 异步语音识别 来使用 Google Speech API。
我对如何进行没有几个问题。
1 . 我想实时转换音频文本,但不想要它。所以我应该使用异步识别?
Google sample project 使用 SpeechGrpc。 androidA同步语音识别中是否需要使用?或者我可以使用 SpeechClient 身份验证后..如何?
2 . SpeechGrpc (com.google.cloud.speech.v1.SpeechGrpc) 不在我的包裹中! (com.google.cloud.speech.v1)。我必须从这里安装它? grpc.io
3 . 我使用 Google Cloud Platform Console API 密钥对 Speech API(ManagedChannel 对象)进行身份验证,但我不明白如何使用它以及使用哪个函数用于异步语音识别。
// Authentication
try {
GoogleCredentials creds = GoogleCredentials.fromStream(stream);
creds = creds.createScoped(SCOPE);
mChannel = ManagedChannelBuilder.forAddress(HOSTNAME, PORT)
.intercept(new ClientAuthInterceptor(creds, Executors.newSingleThreadExecutor()))
.build();
}catch (IOException e){
Log.e(TAG, "Failed to create channel.", e);
}
那么认证后我应该怎么做。 android中的异步语音识别是否有任何代码参考或文档。
【问题讨论】:
标签: java android api google-cloud-platform google-speech-api