I'm trying to make audio player and instead of using AKAudioPlayer which is taking too much ram on init, i'm using AKClipPlayer like that:
AudioKit.engine.prepare()
let clip = AKFileClip(audioFile: self.recorderAKAudioFile!)
self.player = AKClipPlayer(clips: [clip])
try! AudioKit.engine.start()
if AudioKit.engine.isRunning {
AudioKit.output = self.player
//set the time
self.player?.currentTime = self.playPositionSeconds
self.player?.play()
runPlayerAnimations()
}
The problem is that audio is silent almost every time i run this code on long recording and it does not matter what play position i set. Is there a better way to play audio with specific starting time and not kill app with using all devices ram?