The error message may be misleading.
audioCfUrl! incorrect because audioCfUrl is not optional.- The last argument must be the address of the
AudioFileID variable.
As already mentioned in the answer (now deleted), you do not need to allocate NSURL before CFURL :
let audioURL = NSURL.fileURLWithPath("/path") var audioFile : AudioFileID = nil let status = AudioFileOpenURL(audioURL, Int8(kAudioFileReadPermission), 0, &audioFile)
source share