Guest User

Untitled

a guest
Feb 23rd, 2016
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. #import "SoundController.h"
  2.  
  3. @implementation SoundController
  4.  
  5. +(instancetype)soundFile
  6. {
  7. static SoundController *soundController = nil;
  8.  
  9. if(soundController == nil)
  10. {
  11. soundController = [[SoundController alloc]init];
  12. }
  13. return soundController;
  14. }
  15.  
  16.  
  17. -(void)playSound
  18. {
  19. NSURL *SoundURL = [[NSBundle mainBundle] URLForResource:@"music" withExtension:@"mp3"];
  20. AudioServicesCreateSystemSoundID((__bridge CFURLRef)(hornSoundFileURL), &(SoundURL));
  21. AudioServicesPlaySystemSound(SoundURL);
  22. }
  23.  
  24. @end
Advertisement
Add Comment
Please, Sign In to add comment