4

I'm using AudioUnit to handle the audio record and replay.

And I add audio to UIBackgroundModes key in info.plist to keep it recording or playing when enter background.

The problem is: when my app is not recording or playing audio, the app still running in background, and I can see the red alert bar when device locked or in home screen.

So, how can I enable my app to be suspended when it is not recording to save batt life? Just like before adding the UIBackgroundModes key?

4

1 回答 1

2

终于,我今天想通了。我停止了音频文件写入过程,但不停止音频会话。通过在停止播放时添加AudioSessionSetActive(NO),问题解决了。

于 2013-08-04T09:04:27.930 回答