Skip navigation links

Package com.google.cloud.speech.v1

A client to Cloud Speech API.

See: Description

Package com.google.cloud.speech.v1 Description

A client to Cloud Speech API.

The interfaces provided are listed below, along with usage samples.

============ SpeechClient ============

Service Description: Service that implements Google Cloud Speech API.

Sample for SpeechClient:

 
 try (SpeechClient speechClient = SpeechClient.create()) {
   RecognitionConfig.AudioEncoding encoding = RecognitionConfig.AudioEncoding.FLAC;
   int sampleRateHertz = 44100;
   String languageCode = "en-US";
   RecognitionConfig config = RecognitionConfig.newBuilder()
     .setEncoding(encoding)
     .setSampleRateHertz(sampleRateHertz)
     .setLanguageCode(languageCode)
     .build();
   String uri = "gs://bucket_name/file_name.flac";
   RecognitionAudio audio = RecognitionAudio.newBuilder()
     .setUri(uri)
     .build();
   RecognizeResponse response = speechClient.recognize(config, audio);
 }
 
 
Skip navigation links

Copyright © 2019 Google LLC. All rights reserved.