views:

1458

answers:

7
+2  Q: 

NSbeep() on iPhone

Does NBeep() exist on the iPhone? I just want to play a short error sound to indicate that the key pressed is not a legal character. I will play this in my textField delegate that dissalows the illegal characters.

This site is great btw!

+3  A: 

No, NSBeep() is part of the ApplicationKit framework which doesn't exist on the iPhone.

Jason Coco
A: 

Cheers Jason. I'm using a uialertview instead of just ignoring the inputter. Any good alternatives? Are there any other error system sounds available?

Dan Morgan
Hey Dan, you can look at the documentation for AudioServicePlayAlertSound and AudioServicePlaySystemSound in the System Sound framework on the iPhone. There are no defaults, so you will have to provide the sound file to play (a short beep or whatever). The docs are pretty good.
Jason Coco
Also, this isn't really set up like a forum, so in the future, you should make this a comment on my answer :) Only put something here if you answer your own question. You can also edit your question any time to add more details or whatever.
Jason Coco
+2  A: 

I wouldn't use system sounds all together. They are but annoying - BEEP - Rather give the user a visual clue, like the screen flashing up for the fraction of a second or make the widget wiggle a bit, like when you mistype the password on os x.

A: 

I don't think error beeps as notification would be wise since people might often have their phones muted or earphones dangling.

frou
A: 

Thanks everyone :-)

Dan Morgan
A: 

Gah, I looked and looked and I cant find a basic stock system sound anywhere either, not even a beep.

Its annoying the api is not there, thats all.

(I'm writing a calibration routine that needs a beep, not an audio stream, only a simple beep. It will have a long uptime and may need error "beeps" to signal low battery or low remaining disk space, dont you have a simple error beep for me ?)

A: 

Where is there a large collection of sound files that can be used with the iPhone? I'm looking for a very small (<1k) file that plays a "key click" for <0.5 secs.

All the clips I find are HUGE and LONG.

Gloria