9

We're creating an audio application for iPad (only) which will be used for live performances. The device will be wired directly into the console. As such, the last thing you want during a live performance is to have the device suddenly chirp out an unexpected alarm or reminder.

With research in Apple's SDK, it looks like you can block everything except calendar and alarms (and calls on iPhone).

That said, does anyone know how to tell the device 'While we're in 'On Air' mode, don't allow any OS notifications'?

If not, can we at least query if they're turned on so we can warn the user?

Jailbeaking is not an option because we want to sell this via the App Store.

UPDATE

Another option is to allow the regular alerts and such to still play through the iPad's speaker, but we send our sounds out via the line-out in the dock connector.

Of course we could always develop our own hardware for this, but we're trying to leverage as much of the device's built-in functionality as possible.

Mark A. Donohoe
  • 28,442
  • 25
  • 137
  • 286

3 Answers3

1

It may make your app ineligible for App Store distribution but there is apparently a private API that some people have gotten to do this. See:

Some people report that there are certain API calls that have the byproduct of taking over all sound output. See iOS 5 Audio Alarms Don't Sound Without kAudioSessionProperty_OverrideCategoryMixWithOthers On for one example.

Your safest bet is probably to prompt the user to change the setting when the app opens.

Community
  • 1
  • 1
Moshe Katz
  • 15,992
  • 7
  • 69
  • 116
  • This looked very promising as you're correct, this will kill the system sounds. However, when you read further, you'll see that he says his sound still ducks down which of course we absolutely don't want. And as for setting the alert volume, even if you do it manually, you can't actually get all the way to '0'. Try it. If you slide it all the way over, you still get a very low volume, but it's there, which again, when you're live, you can't have. This project may be DOA. – Mark A. Donohoe May 04 '12 at 04:39
  • I don't have an iPad in front of me right now but my iPod Touch DOES go to 0 when you slide all the way to the left. – Moshe Katz May 04 '12 at 12:55
  • Not in front of my iPad right now, but on my iPhone, it doesn't go completely silent. Odd Apple would have two different behaviors like that, but it may be possible because this is a phone and therefore you always want the ringer on if the switch isn't on 'silent'. I'll have to play with it. If it works on iPad, you'll get the answer. – Mark A. Donohoe May 04 '12 at 14:35
  • Confirmed that the iPad too doesn't go completely silent when all the way to the left. As I said above, I'd double-check that again on your device. Doesn't make sense that two of their devices would work differently than a third when all run the same OS and framework. – Mark A. Donohoe May 08 '12 at 15:09
0

Note: I don't have an iPad in front of me now but I assume that it has the same option as my iPod. EDIT: No, it doesn't.

iPod ONLY: In 'Settings' => 'Sounds', you can drag the "Ringer and Alerts" volume all the way down. My iPod makes no noises at all when this volume slider is all the way down, except for noises from programs I open.

Screenshot of iPod settings

The iPad does not appear to allow separate volume control of System sounds and program sounds like the iPod does.

Photo of iPad settings

Moshe Katz
  • 15,992
  • 7
  • 69
  • 116
  • Do you know if that can be done programmatically. That's what we're trying to find out. We want our app to automatically do that when we go into 'Live' mode. If we can't change it via code, we're hoping we can at least query it via code to warn the user if it isn't set all the way down. – Mark A. Donohoe May 02 '12 at 05:16
  • Actually, did some more research here. Two things. One, yes you can figure out how to do this programmatically (although it's a private API) but more importantly, I don't think what you stated is actually true as when I drag it all the way to the left, you can still hear the sound, albeit very slightly. You even hear it via the headphones. In other words, you can't completely silence it. – Mark A. Donohoe May 04 '12 at 04:36
  • As I mentioned above, on my iPod, the system sounds do get completely silent when you drag all the way to the left. – Moshe Katz May 04 '12 at 12:56
  • You must be using an older version of iPad software because on my iPad, like the iPhone, there is a switch underneath the volume slider that says 'Change with buttons'. Either way, as I said, on both my iPhone and iPad, setting the slider completely to the left only sets the volume to its lowest level, not mutes it. I don't have an iPod to test with however. Still, I'd be very surprised Apple would do things differently for the same OS version. I could be wrong, but I'd take that bet. Double-check that by holding it up to your ear. It is very low. – Mark A. Donohoe May 08 '12 at 15:06
0

I haven’t actually tried this, but after a quick Google search I found the AVAudioSession class reference says that settings the mode to AVAudioSessionCategoryRecord might achieve what you want.

The note about AVAudioSessionCategoryPlayAndRecord says:

If you want to ensure that sounds such as Messages alerts do not play while your app is recording, use the AVAudioSessionCategoryRecord category instead.

http://developer.apple.com/library/ios/documentation/AVFoundation/Reference/AVAudioSession_ClassReference/Reference/Reference.html#//apple_ref/c/data/AVAudioSessionCategoryRecord

(Can also use the C API: http://developer.apple.com/library/ios/#documentation/AudioToolbox/Reference/AudioSessionServicesReference/Reference/reference.html#//apple_ref/doc/c_ref/kAudioSessionCategory_PlayAndRecord )

DouglasHeriot
  • 1,674
  • 2
  • 13
  • 19
  • Yeah, but that's for recording. Not sure that's sufficient for playback which is what we're after. – Mark A. Donohoe May 03 '12 at 00:23
  • Confirmed: It isn't. It only mutes system sounds while recording, and while it is, it doesn't support *any* playback, yours or the systems. As you said there is a companion PlayAndRecord variant, but that is still susceptible to system sounds. – Mark A. Donohoe May 08 '12 at 15:10