Now, I haven't tested the code, and some of the things you will hit playing with it are due to the difference between the version of Swift you are using and Swift 3. But I think this demonstrates more what I was going for with my suggestions. Take it or leave it as you see fit.
Awesome, thanks ! I already skimmed through your code, but I will definitely incorporate it into my code and test it out. I think that having concrete code to look at is better than us going back n forth with abstract ideas.
I don't know if you remember, but I did have some problems when I put playback code on the queue (i.e. outside the main thread). The calculated duration went to zero. I suspect some sort of thread-scoped isolation going on. As long as I access playerNode.sampleTime in the main thread, I get the correct value, but outside of the main thread, it's zero. I'll have to investigate this further.
Anyway, thanks again for all your input and your time and effort in writing this code, which I will put to use somehow (if not all of it, surely parts of it). I will let you know what happens.
BTW, I have to ask ... since you've actually cloned my repo and played with my code ... did you actually run my app ? ... I ask because I have not been able to test my app on any machines other than mine, and I'm curious about compatibility and how this performs on other systems ... esp. other MacOS versions (mine is Yosemite). If you tried running it, did it work at all ? This is my first time "distributing" a MacOS app, so I'm totally clueless as to portability challenges, even though this is native OS X code, after all. Any data you can provide would be appreciated.
Last edited: