开发者

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

开发者 https://www.devze.com 2023-01-14 19:30 出处:网络
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

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

精彩评论

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