     
     private var audioFileBuffer: AVAudioPCMBuffer
     private var internalPlayer: AVAudioPlayerNode
+    private var audioFile: AVAudioFile
     
     private var internalFile: String
     private var sampleRate: Double = 1.0

        return 0.0
    }
    
    /// Replace the current audio file with a new audio file
    public func replaceFile( newFile : String )
    {

    public init(_ file: String) {
        internalFile = file
        let url = NSURL.fileURLWithPath(file, isDirectory: false)
        audioFile = try! AVAudioFile(forReading: url)
        let audioFormat = audioFile.processingFormat
        let audioFrameCount = UInt32(audioFile.length)
        audioFileBuffer = AVAudioPCMBuffer(PCMFormat: audioFormat,
                                           frameCapacity: audioFrameCount)
        try! audioFile.readIntoBuffer(audioFileBuffer)
        
        // added for currentTime calculation later on
        sampleRate = audioFile.fileFormat.sampleRate
        totalFrameCount = Int64(audioFrameCount)
        
        internalPlayer = AVAudioPlayerNode()
        super.init()
