Search results

11 DecThe shortest way to play sound effect on iPhone [code snippet]

Define static SystemSoundID for sound effect Initilize this SystemSoundID Call our static method which plays sound effect: AudioServicesPlaySystemSound static SystemSoundID soundFileObjectClick; – (void)applicationDidFinishLaunching:(UIApplication *)application { CFURLRef soundFileURLRefClick  = CFBundleCopyResourceURL (CFBundleGetMainBundle (), CFSTR (“button-30″), CFSTR (“wav”), NULL); AudioServicesCreateSystemSoundID (soundFileURLRefClick, &soundFileObjectClick); } + (void) clickSoundEffect{ AudioServicesPlaySystemSound (soundFileObjectClick); } Please learn: what music types and quality Apples advises Audio [...]