load a pcm into a AVAudioPCMBuffer
<p>I have this code:</p>

<pre><code>func loadSoundfont(_ pitch : String) {
    let path: String = Bundle.main.path(forResource: "\(self.id)/\(pitch)", ofType: "f32")!
    let url = URL(fileURLWithPath: path)

    do {
        let file = try AVAudioFile(forReading: url, commonFormat: AVAudioCommonFormat.pcmFormatFloat32, interleaved: true)
        let format = file.processingFormat
        let capacity = AVAudioFrameCount(file.length)
        self.buffer = AVAudioPCMBuffer(pcmFormat: format, frameCapacity: capacity)
        try file.read(into: self.buffer!)
    } catch let error as NSError {
        print("ERROR HERE", error.localizedDescription)
    }
}
</code></pre>

<p>And I get the following error: <code>1954115647</code> which is: <code>kAudioFileUnsupportedFileTypeError</code></p>

<p>My A4.f32 file contains a PCM float 32. Is there something I'm missing here? There's no header in my file, is it something that could lead to this problem?</p>