tags:

views:

75

answers:

1

I am implementing chat application.I have implemented vibrate effect when user get bips.but i want to remove vibrate effect and implement sound effect.how it is possible?

A: 

You'll need to load a sound file:

dingSoundFileURLRef = CFBundleCopyResourceURL( mainBundle,
             CFSTR ( "ding" ),
             CFSTR ( "caf" ),
             NULL
             );
AudioServicesCreateSystemSoundID( dingSoundFileURLRef, &dingSoundFileObject );

then play it:

AudioServicesPlaySystemSound( self.dingSoundFileObject );
jessecurry