use of com.ibm.watson.speech_to_text.v1.SpeechToText in project java-sdk by watson-developer-cloud.
the class SpeechToTextExample method main.
public static void main(String[] args) throws FileNotFoundException {
Authenticator authenticator = new IamAuthenticator("<iam_api_key>");
SpeechToText service = new SpeechToText(authenticator);
File audio = new File("src/test/resources/speech_to_text/sample1.wav");
RecognizeOptions options = new RecognizeOptions.Builder().audio(audio).contentType(HttpMediaType.AUDIO_WAV).build();
SpeechRecognitionResults transcript = service.recognize(options).execute().getResult();
System.out.println(transcript);
}
Aggregations