Here's what I'm looking to do: I have an AVAudioPlayer called primaryPlayer
playing a track, and I want it to continue uninterrupted while I transfer the player to secondaryPlayer
. I'll then be using the primaryPlayer
for a new AVAudioPlayer instance to play alongside the original track.
Maybe it's as simple as this:
secondaryPlayer=primaryPlayer;
primaryPlayer=[[AVAudioPlayer alloc] initWithContentsOfURL:songURL error:nil];
*these two variables are properties of the class, hence their lack of definition.
I'm worried that I may be missing something. For instance, does this code just set the two variables to point to the same memory address? So that after the second line of code, both variables correspond to the same player?
I think this may be more of an Objective C (or maybe just C) question than anything else, but thanks for reading and any "pointers" on this would be terrific! :)