I need to loop play a .caf file in my iPhone app.
The AVAudioPlayer looks promising. But there\'s one problem. It won\'t stop or mute even if I pressed the mute button o
my 2 cents for swift 3.0:
let sharedSession = AVAudioSession.sharedInstance() do { try sharedSession.setCategory(AVAudioSessionCategoryAmbient) } catch _{ return false }
or simpler:
try? sharedSession.setCategory(AVAudioSessionCategoryAmbient)