title: speech to text macOS swift playground
body: <p>I am trying to get speech to text working on my mac in swift. I found a few articles but they are all for iOS. I'm trying to follow this one:
  <a href="http://www.appcoda.com/siri-speech-framework/" rel="nofollow noreferrer">http://www.appcoda.com/siri-speech-framework/</a></p>
  
  <p>So far this is my code in Playground:</p>
  
  <pre><code>//: Playground - noun: a place where people can play
  
  import Cocoa
  import PlaygroundSupport
  PlaygroundPage.current.needsIndefiniteExecution = true
  import Speech
  
  while true {
      microphoneButton.isEnabled = false  //2
  
      speechRecognizer.delegate = self  //3
  
      SFSpeechRecognizer.requestAuthorization { (authStatus) in  //4
  
          var isButtonEnabled = false
  
          switch authStatus {  //5
          case .authorized:
              isButtonEnabled = true
  
          case .denied:
              isButtonEnabled = false
              print("User denied access to speech recognition")
  
          case .restricted:
              isButtonEnabled = false
              print("Speech recognition restricted on this device")
  
          case .notDetermined:
              isButtonEnabled = false
              print("Speech recognition not yet authorized")
          }
  
          OperationQueue.main.addOperation() {
              self.microphoneButton.isEnabled = isButtonEnabled
          }
      }
  }
  </code></pre>
  
  <p>It comes up with the error, "No such Module Speech"</p>
  
  <p>My questions are, is it possible in macOS? Is it possible in playgrounds? </p>
  
  <p>Thanks in advance,
  Jersh</p>