tags:

views:

23

answers:

2

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

A: 

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.

hotpaw2
A: 

[[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];

chengyan