         
         // fix player.isPlaying returning true in the completion handler
         return playerPosition < AVAudioFramePosition(buffer.frameLength)
+    }
+    
+    private var currentBuffer: AVAudioPCMBuffer?
+    
+    var currentStingLength: TimeInterval {
+        guard let buffer = currentBuffer else { return 0 }
+        return Double(buffer.frameLength) / buffer.format.sampleRate
+    }
+    var currentStingPosition: TimeInterval {
+        guard
+            let buffer = currentBuffer,
+            let lastRenderTime = player.lastRenderTime,
+            let playerPosition = player.playerTime(forNodeTime: lastRenderTime)?.sampleTime
+        else { return 0 }
+        return Double(playerPosition) / buffer.format.sampleRate
     }
     
     var playbackDelegate: PlaybackDelegate?

        do {
            try engine.start()
        } catch {
            fatalError("Could not start engine. error: \(error).")
        }
    }
    

        }
        
        player.play()
        currentBuffer = sting.buffer
        lastPlayedStingIndex = index
        playbackDelegate?.stingDidStartPlaying(at: index)
    }
