lundi 26 janvier 2015

iOS - how to terminate active AVAudioSession when user presses home or power button?

I'm recording audio using AVAudioSession, and when the user exits the app, the status bar turns red and the app keeps recording audio. When the user presses the power button the screen goes black, but the app is still recording.


How can I specify that the audio session should stop recording once the user presses the home/power buttons on device?



AVAudioSession *session = [AVAudioSession sharedInstance];
[session setCategory:AVAudioSessionCategoryPlayAndRecord error:nil];

Aucun commentaire:

Enregistrer un commentaire