I have a heart-rate monitor, and a short wav file which sounds like a heart beating. This wav file has a duration of 1 second.
I want to play it in time with the user's heart rate. So if their heart rate is 100bpm, the sound should play for 0.6 seconds. If their heart rate is 60bpm, the sound should play for 1.0 seconds. And if their heart rate is 30bpm they are probably about to die.
Is it possible to alter the duration of time it takes to play a sound file? And what framework should I use? AVPlayer?