title: exception com.apple.coreaudio.avfaudio reason: error -50
body: <p>I have this message when i try to play an audio with a different pitch:
  <img src="https://i.stack.imgur.com/a6HHC.jpg" alt="enter image description here"></p>
  
  <p>And i googled for that error with no succeed. If i set breakpoints it stops here:
  <img src="https://i.stack.imgur.com/Q9YCr.jpg" alt="enter image description here"></p>
  
  <p>I test printing all objects to see is anything is nit but i didnt found anything. The most misterious thing is that only happens in my iphone6+, in other phones i tested this out doesnt break. Then searched the project where i looked into to add this sound effects which is this:
  <a href="https://github.com/atikur/Pitch-Perfect" rel="noreferrer">https://github.com/atikur/Pitch-Perfect</a>
  And if you run it it works, until you change...</p>
  
  <pre><code>AVAudioSession.sharedInstance().setCategory(AVAudioSessionCategoryPlayAndRecord, error: &amp;error)
  </code></pre>
  
  <p>To:</p>
  
  <pre><code>AVAudioSession.sharedInstance().setCategory(AVAudioSessionCategoryPlayback, error: &amp;error)
  </code></pre>
  
  <p>And then boom (ONLY IN REAL DEVICE ATTACHED TO XCODE, it works in the simulator):</p>
  
  <p>2015-03-21 11:56:13.311 Pitch Perfect[1237:607678] 11:56:13.311 ERROR:     [0x10320c000] AVAudioFile.mm:496: -[AVAudioFile readIntoBuffer:frameCount:error:]: error -50
  2015-03-21 11:56:13.313 Pitch Perfect[1237:607678] <strong>* Terminating app due to uncaught exception 'com.apple.coreaudio.avfaudio', reason: 'error -50'
  *</strong> First throw call stack:
  (0x18687a530 0x1978040e4 0x18687a3f0 0x1851ea6c0 0x185232d38 0x1852130f8 0x185212ccc 0x100584fd4 0x100584f94 0x10058fdb8 0x1005882c4 0x1005925d4 0x100592208 0x198037dc8 0x198037d24 0x198034ef8)
  libc++abi.dylib: terminating with uncaught exception of type NSException</p>
  
  <p>And the really really weird thing is this screenshot, for some reason after printing audioEngine, audioEngine.outputNode gets nil?
  <img src="https://i.stack.imgur.com/TpdxV.jpg" alt="weird bug"></p>