title: swift 3 using speech recognition and AVFoundation together
body: <p>I am successfully able to use Speech (speech recognition) and I can use AVFoundation to play wav files in Xcode 8/IOS 10. I just can't use them both together.  I have working speech recognition code where I import Speech.  When I import AVFoundation into the same app and use the following code, there is no sound and no errors are generated:</p>
  
  <pre><code>var audioPlayer: AVAudioPlayer!
  func playAudio()  {
          let path = Bundle.main.path(forResource: "file.wav", ofType: nil)!
      let url = URL(fileURLWithPath: path)
  
      do {
          let sound = try AVAudioPlayer(contentsOf: url)
          audioPlayer = sound
          sound.play()
      } catch {
          //handle error
      }
  
  }
  </code></pre>
  
  <p>I assume it is because both use audio.  Can anyone suggest how to use both in the same app? I also find that I cannot use speech recognition and text-to-speech together in the same app.</p>