title: Record and send audio to an API in Xcode with Cocoa
body: <p>I want to use the <a href="https://wit.ai/docs/api" rel="nofollow">Wit API</a> to recognize speech. In Xcode, how can I record audio, send it to the API, and read the response?</p>
  
  <p>I was trying to use <a href="https://developer.apple.com/library/mac/documentation/AVFoundation/Reference/AVCaptureSession_Class/Reference/Reference.html#//apple_ref/occ/cl/AVCaptureSession" rel="nofollow">AVCaptureSession</a>, but how can I only start recording when input or speech starts, and how can I send this to Wit quickly?</p>
  
  <p>Also, is this even a reasonable task? Could Wit return a result in &lt; 2 seconds?</p>