Selected 4 samples of Apple, they use AVAudioPlayer to play only one song. However, your result looks very interesting and impressive! Let us know if you stop playback before reinitializing the object with the same address, are you starting a new audio session?
As for me, I would not put the stability of the playback and the application at risk of doing something not mentioned in the documentation, but, to be on the bright side, I will use the AVAudioPlayer class, since it seems to be the most correct, which gives us:
- Use the error variable to track possible errors.
- stop the instance of the AVAudioPlayer player, initialize a new instance of AVAudioPlayer and set it to a property that allows the old person to be freed automatically.
And you probably know yourself that
self.background = [self.background initWithContentsOfURL::
will remove the warning for you.
source share