AudioServicesPlay* does not work if play and record audio session active
| Originator: | colin.cornaby | ||
| Number: | rdar://12760142 | Date Originated: | 27-Nov-2012 11:52 AM |
| Status: | Open | Resolved: | |
| Product: | iPhone SDK | Product Version: | 6.0 |
| Classification: | Enhancement | Reproducible: | Always |
Summary: Our app tries to use AudioServicesPlayAlertSound or AudioServicesPlaySystemSound while recording audio with a kAudioSessionCategory_PlayAndRecord audio session. However, it does not play/vibrate. Steps to Reproduce: 1) Start a kAudioSessionCategory_PlayAndRecord audio session. 2) Attempt to vibrate using AudioServicesPlaySystemSound(kSystemSoundID_Vibrate); Expected Results: The device should vibrate. Actual Results: Device does not vibrate. Regression: If the audio session is off, vibration works. Notes: The Apple docs note: "If the user has configured the Settings application for vibration on ring, also invokes vibration. However, the device does not vibrate if your app’s audio session is configured with the AVAudioSessionCategoryPlayAndRecord or AVAudioSessionCategoryRecord audio session category. This ensures that vibration doesn’t interfere with audio recording. For an explanation of audio session categories, see “Categories Express Audio Roles” in Audio Session Programming Guide." We chose the play and record session type because we have an augmented reality application and we HAVE to provide feedback to the user in response to recording. We understand vibration may alter the recording, but we want to vibrate anyway. Not only that, but play and record allows other media to continue playing anyway. We would REALLY like to have the ability to override.
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!
My own rdar://7495788 from December 2009 was closed as a dupe of this. Did you ever get any feedback? My report is below.
Summary: It doesn't seem possible to vibrate the phone while it's recording
Steps to Reproduce: - Set the audio session category to RecordAudio, or PlayAndRecord. - Try to vibrate using AudioServicesPlayAlertSound(kSystemSoundID_Vibrate)
Expected Results: The device vibrates
Actual Results: Nothing happens
Notes: I've seen claims that you can make this work by also setting kAudioSessionProperty_OverrideCategoryMixWithOthers, but in my experience this doesn't seem to fix the problem.
We'd really like to see this feature as an accessibility measure. While recording in our app, if the user is approaching a time limit this is indicated visually. A non-sighted user won't see this warning, and we'd like to vibrate instead.