开发者

How do I still play sound the iphone(ipod touch) is locked but my program is running?

How do I still play sound the iphone(ipod touch) is 开发者_StackOverflowlocked but my program is running?


Depending on how you are playing a sound, setting the audio session type to media player before you start playing sound and before the device is locked may help.


[[AVAudioSession sharedInstance] setDelegate: self];

// Use this code instead to allow the app sound to continue to play when the screen is locked. [[AVAudioSession sharedInstance] setCategory: AVAudioSessionCategoryPlayback error: nil];

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜