public ServiceCall<RecognitionJob> createRecognitionJob(final File audio,final RecognizeOptions recognizeOptions,final RecognitionJobOptions recognitionJobOptions){
  Validator.isTrue((audio != null) && audio.exists(),"audio file is null or does not exist");
  final double fileSize=audio.length() / Math.pow(1024,2);
  Validator.isTrue(fileSize < 100.0,"The audio file is greater than 100MB.");
  String contentType=MediaTypeUtils.getMediaTypeFromFile(audio);
  if ((recognizeOptions != null) && (recognizeOptions.contentType() != null)) {
    contentType=recognizeOptions.contentType();
  }
  Validator.notNull(contentType,"The audio format cannot be recognized");
  final RequestBuilder requestBuilder=RequestBuilder.post(PATH_RECOGNITIONS);
  buildRecognizeRequest(requestBuilder,recognizeOptions);
  buildRecognitionJobRequest(requestBuilder,recognitionJobOptions);
  requestBuilder.body(RequestBody.create(MediaType.parse(contentType),audio));
  return createServiceCall(requestBuilder.build(),ResponseConverterUtils.getObject(RecognitionJob.class));
}

public ServiceCall < RecognitionJob > createRecognitionJob ( final File audio , final RecognizeOptions recognizeOptions , final RecognitionJobOptions recognitionJobOptions ) { Validator . isTrue ( ( audio != null ) && audio . exists ( ) , "audio file is null or does not exist" ) ; final double fileSize = audio . length ( ) / Math . pow ( 1024 , 2 ) ; Validator . isTrue ( fileSize < 100.0 , "The audio file is greater than 100MB." ) ; String contentType = MediaTypeUtils . getMediaTypeFromFile ( audio ) ; if ( ( recognizeOptions != null ) && ( recognizeOptions . contentType ( ) != null ) ) { contentType = recognizeOptions . contentType ( ) ; } Validator . notNull ( contentType , "The audio format cannot be recognized" ) ; final RequestBuilder requestBuilder = RequestBuilder . post ( PATH_RECOGNITIONS ) ; buildRecognizeRequest ( requestBuilder , recognizeOptions ) ; buildRecognitionJobRequest ( requestBuilder , recognitionJobOptions ) ; requestBuilder . body ( RequestBody . create ( MediaType . parse ( contentType ) , audio ) ) ; return createServiceCall ( requestBuilder . build ( ) , ResponseConverterUtils . getObject ( RecognitionJob . class ) ) ; }
creates an asynchronous recognition request .
