Guest User

Untitled

a guest
Jun 18th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. #import "soundTestViewController.h"
  2. #import <AudioToolbox/AudioToolbox.h>
  3.  
  4.  
  5. @implementation soundTestViewController
  6.  
  7. - (IBAction)playSoundX:(id)sender {
  8.  
  9. NSString* path = [[NSBundle mainBundle] pathForResource:@"1" ofType:@"caf"];
  10. NSURL * afUrl = [NSURL fileURLWithPath:path];
  11. UInt32 soundID;
  12.  
  13. AudioServicesCreateSystemSoundID((CFURLRef)afUrl, &soundID);
  14. AudioServicesPlaySystemSound (soundID);
  15.  
  16.  
  17. path = [[NSBundle mainBundle] pathForResource:@"2" ofType:@"caf"];
  18. afUrl = [NSURL fileURLWithPath:path];
  19.  
  20.  
  21. //TODO: I NEED TO PAUSE HERE FOR LIKE ONE SECONDS
  22. pause;
  23.  
  24. AudioServicesCreateSystemSoundID((CFURLRef)afUrl, &soundID);
  25. AudioServicesPlaySystemSound (soundID);
  26.  
  27. }
Add Comment
Please, Sign In to add comment