title: How can i continuously send requests after speech_event_type: END_OF_SINGLE_UTTERANCE Google Speech cloud Java
body: <p>I know that google cloud speech API (recognize) is limited to 65 seconds, but i assume that is per request and only a limitation if your speak is actually longer than that.</p>
  
  <p>So, assume i just want some commands translations from the microphone and do a request to google speech.I add the model command_and_search and set setSingleUtterance(true) to config.</p>
  
  <p>Below code send one request and print the results but i fail to understand how i can spawn new request for the next commands..like "help"...."right"...etc </p>
  
  <pre><code>import com.google.api.gax.rpc.ClientStream;
  import com.google.api.gax.rpc.ResponseObserver;
  import com.google.api.gax.rpc.StreamController;
  import com.google.cloud.speech.v1p1beta1.*;
  import com.google.protobuf.ByteString;
  import java.io.IOException;
  import javax.sound.sampled.AudioFormat;
  import javax.sound.sampled.AudioInputStream;
  import javax.sound.sampled.AudioSystem;
  import javax.sound.sampled.DataLine;
  import javax.sound.sampled.TargetDataLine;
  
  
  public class App {
  
  
  public static void AskGoogle (ClientStream&lt;StreamingRecognizeRequest&gt; c,byte[]  b ) {
  
      StreamingRecognizeRequest request =
              StreamingRecognizeRequest.newBuilder()
                      .setAudioContent(ByteString.copyFrom(b))
                      .build();
  
      c.send(request);
      return;
  
  }
  
  
  public static void main(String[] args) {
      // Target data line
      TargetDataLine line = null;
      AudioInputStream audio = null;
  
      // Capture Microphone Audio Data
      try {
  
          // Signed PCM AudioFormat with 16kHz, 16 bit sample size, mono
          int sampleRate = 16000;
          AudioFormat format = new AudioFormat(sampleRate, 16, 1, true, false);
          DataLine.Info info = new DataLine.Info(TargetDataLine.class, format);
  
          // Check if Microphone is Supported
          if (!AudioSystem.isLineSupported(info)) {
              System.out.println("Line not supported");
              System.exit(0);
          }
  
          // Get the target data line
          line = (TargetDataLine) AudioSystem.getLine(info);
          line.open(format);
          line.start();
  
          // Audio Input Stream
          audio = new AudioInputStream(line);
  
      } catch (Exception ex) {
          ex.printStackTrace();
      }
  
  
      // Send audio from Microphone to Google Servers and return Text
      try (SpeechClient client = SpeechClient.create()) {
  
          ResponseObserver&lt;StreamingRecognizeResponse&gt; responseObserver =
                  new ResponseObserver&lt;StreamingRecognizeResponse&gt;() {
  
                      public void onStart(StreamController controller) {
                          // do nothing
                      }
  
                      public void onResponse(StreamingRecognizeResponse response) {
  
                          System.out.println(response);
  
  
                      }
  
                      public void onComplete() {
                      }
  
                      public void onError(Throwable t) {
                          System.out.println(t);
                      }
                  };
  
          ClientStream&lt;StreamingRecognizeRequest&gt; clientStream =
                  client.streamingRecognizeCallable().splitCall(responseObserver);
  
          RecognitionConfig recConfig =
                  RecognitionConfig.newBuilder()
                          .setEncoding(RecognitionConfig.AudioEncoding.LINEAR16)
                          .setLanguageCode("sv-SE")
                          .setSampleRateHertz(16000)
                          .setModel("command_and_search")
                          .build();
          StreamingRecognitionConfig config =
                  StreamingRecognitionConfig.newBuilder().setConfig(recConfig).setSingleUtterance(true).build();
  
          StreamingRecognizeRequest request =
                  StreamingRecognizeRequest.newBuilder()
                          .setStreamingConfig(config)
                          .build(); // The first request in a streaming call has to be a config
  
          clientStream.send(request);
  
          while (true) {
              byte[] data = new byte[100];
              try {
                  audio.read(data);
              } catch (IOException e) {
                  System.out.println(e);
              }
  
              AskGoogle(clientStream,data);
  
  
          }
      } catch (Exception e) {
          System.out.println(e);
      }
  
   }
  
  }
  </code></pre>