public void sendAudio(final String url,final String accessToken,@NotNull DataRequestBody requestBody,final AsyncCallback<AvsResponse,Exception> callback) throws IOException {
  this.requestBody=requestBody;
  if (callback != null) {
    callback.start();
  }
  Log.i(TAG,"Starting SpeechSendAudio procedure");
  start=System.currentTimeMillis();
  try {
    prepareConnection(url,accessToken);
    final AvsResponse response=completePost();
    if (response != null && response.isEmpty()) {
      if (callback != null) {
        callback.failure(new AvsAudioException("Nothing came back"));
      }
      return;
    }
    if (callback != null) {
      if (response != null) {
        callback.success(response);
      }
      callback.complete();
    }
    Log.i(TAG,"Audio sent");
    Log.i(TAG,"Audio sending process took: " + (System.currentTimeMillis() - start));
  }
 catch (  IOException|AvsException e) {
    onError(callback,e);
  }
}

public void sendAudio ( final String url , final String accessToken , @ NotNull DataRequestBody requestBody , final AsyncCallback < AvsResponse , Exception > callback ) throws IOException { this . requestBody = requestBody ; if ( callback != null ) { callback . start ( ) ; } Log . i ( TAG , "Starting SpeechSendAudio procedure" ) ; start = System . currentTimeMillis ( ) ; try { prepareConnection ( url , accessToken ) ; final AvsResponse response = completePost ( ) ; if ( response != null && response . isEmpty ( ) ) { if ( callback != null ) { callback . failure ( new AvsAudioException ( "Nothing came back" ) ) ; } return ; } if ( callback != null ) { if ( response != null ) { callback . success ( response ) ; } callback . complete ( ) ; } Log . i ( TAG , "Audio sent" ) ; Log . i ( TAG , "Audio sending process took: " + ( System . currentTimeMillis ( ) - start ) ) ; } catch ( IOException | AvsException e ) { onError ( callback , e ) ; } }
post an audio byte [ ] to the alexa speech recognizer api
