tags:

views:

410

answers:

2

I'm obviously not trying to play full spectrum audio, but is there some way to customize the iPhone/iTouch system alert sounds to play a little melody on the piezo speaker? The functionality is clearly present, so I guess the question is has Apple made it available for developer use...

Thanks, -S

A: 

It isn't. Sorry.

Only thing you can do from an application is this (you can use any SoundID for this, really):

AudioServicesPlayAlertSound(kSystemSoundID_Vibrate);

Discussion

Depending on the particular iPhone OS device, this function plays a short sound and may invoke vibration. Calling this function does the following on various iPhone OS devices:

iPhone—plays the specified sound and, if the user has configured the Settings application for vibration on ring, invokes vibration.

iPod touch, original—plays a short alert melody.

iPod touch, 2nd generation—plays the specified sound.

lhunath
It seems like the only defined kSystemSoundID is Vibrate...do you know how to access the other sounds? ("New Mail", "Sent Mail", "Calendar Alerts" sounds, etc)
spencewah
A: 

There are quite a few predefined sounds you can use in the 0-2000 range. For example, the keyboard click can be called like such:

AudioServicesPlayAlertSound(1104);

There is also a way to play a custom melody on the first-generation iPod touch, but it's not pretty.

rpetrich