title: How to record FLAC format in iOS 11+
body: <p>I changed the code in <a href="https://github.com/GoogleCloudPlatform/ios-docs-samples/blob/master/speech/Swift/Speech-gRPC-Streaming/Speech/AudioController.swift" rel="nofollow noreferrer">AudioController.swift</a> to:</p>
  
  <pre class="lang-swift prettyprint-override"><code>...
  // Set format for mic input (bus 1) on RemoteIO's output scope
  var asbd = AudioStreamBasicDescription()
  ...
  asbd.mFormatID = kAudioFormatFLAC
  asbd.mFormatFlags = kAppleLosslessFormatFlag_16BitSourceData
  ...
  </code></pre>
  
  <p>and <a href="https://github.com/GoogleCloudPlatform/ios-docs-samples/blob/master/speech/Swift/Speech-gRPC-Streaming/Speech/SpeechRecognitionService.swift" rel="nofollow noreferrer">SpeechRecognitionService.swift</a> to</p>
  
  <pre class="lang-swift prettyprint-override"><code>...
  // send an initial request message to configure the service
  let recognitionConfig = RecognitionConfig()
  recognitionConfig.encoding =  .flac
  ...
  </code></pre>
  
  <p>I tried tinkering around with AudioStreamBasicDescription.mFormatFlags but cannot find the right flags for Google Speech API to recognize the format.</p>
  
  <p>How do I make iOS to record FLAC using the given iOS API?</p>