I will talk about how I solved this problem, which may be slightly different.
I created an application where I wanted the user to be able to view the MP3 clip, even if they had a phone in silence.
As I did this, first, importing the Audiobox <AVFoundation/AVFoundation.h> at the beginning of your file, and then into my code, before I initialized my AVAudioPlayer, I did:
[[AVAudioSession sharedInstance] setCategory: AVAudioSessionCategoryPlayback error: nil];
Worked like a charm. Perhaps this is not what the OP requires.
Will Nov 02 2018-12-12T00: 00Z
source share