         var srcFormat = AudioStreamBasicDescription()
         var dstFormat = AudioStreamBasicDescription()
 
-        ExtAudioFileOpenURL(inputURL as CFURL, &sourceFile)
+        error = ExtAudioFileOpenURL(inputURL as CFURL, &sourceFile)
+        if error != noErr {
+            completionHandler?(createError(message: "Unable to open the input file."))
+            return
+        }
+
         var thePropertySize = UInt32(MemoryLayout.stride(ofValue: srcFormat))
 
         guard let inputFile = sourceFile else {

        let outputSampleRate = options?.sampleRate ?? srcFormat.mSampleRate
        let outputChannels = options?.channels ?? srcFormat.mChannelsPerFrame
        var outputBitRate = options?.bitDepth ?? srcFormat.mBitsPerChannel

        var outputBytesPerFrame = outputBitRate * outputChannels / 8
        var outputBytesPerPacket = options?.bitDepth == nil ? srcFormat.mBytesPerPacket : outputBytesPerFrame

            return
        }

        let inputFormat = inputURL.pathExtension.lowercased()
        let outputFormat = options?.format ?? outputURL.pathExtension.lowercased()

        AKLog("convertToPCM() to \(outputURL)")
