Thursday, November 27, 2008

How to play sound in iPhone

You can easily play .aiff with GSEventPlaySoundAtPath

example:
GSEventPlaySoundAtPath(@"/System/Library/CoreServices/SpringBoard.app/lock.aiff");

Add one line to LDFLAGS:
LDFLAGS += -framework GraphicsServices

Other related:
GSEventPlayAlertOrSystemSoundAtPath
GSEventPlaySoundLoopAtPath
GSEventPrimeSoundAtPath
GSEventStopSoundAtPath

No comments: