Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #import "soundTestViewController.h"
- #import <AudioToolbox/AudioToolbox.h>
- @implementation soundTestViewController
- - (IBAction)playSoundX:(id)sender {
- NSString* path = [[NSBundle mainBundle] pathForResource:@"1" ofType:@"caf"];
- NSURL * afUrl = [NSURL fileURLWithPath:path];
- UInt32 soundID;
- AudioServicesCreateSystemSoundID((CFURLRef)afUrl, &soundID);
- AudioServicesPlaySystemSound (soundID);
- path = [[NSBundle mainBundle] pathForResource:@"2" ofType:@"caf"];
- afUrl = [NSURL fileURLWithPath:path];
- //TODO: I NEED TO PAUSE HERE FOR LIKE ONE SECONDS
- pause;
- AudioServicesCreateSystemSoundID((CFURLRef)afUrl, &soundID);
- AudioServicesPlaySystemSound (soundID);
- }
Add Comment
Please, Sign In to add comment