         }
         internalPlayer.play()
         // get the initialFrameCount for currentTime as it's relative to the audio engine's time.
-        if (initialFrameCount == -1){
+        if initialFrameCount == -1 {
             if let t = internalPlayer.lastRenderTime {
                 initialFrameCount = t.sampleTime
             }

        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 )

    private var internalPlayer: AVAudioPlayerNode
    
    private var internalFile: String
    private var sampleRate: Double = 1.0
    private var totalFrameCount: Int64
    private var initialFrameCount: Int64 = -1
    
    /// Boolean indicating whether or not to loop the playback
    public var looping = false
