Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #import "SoundController.h"
- @implementation SoundController
- +(instancetype)soundFile
- {
- static SoundController *soundController = nil;
- if(soundController == nil)
- {
- soundController = [[SoundController alloc]init];
- }
- return soundController;
- }
- -(void)playSound
- {
- NSURL *SoundURL = [[NSBundle mainBundle] URLForResource:@"music" withExtension:@"mp3"];
- AudioServicesCreateSystemSoundID((__bridge CFURLRef)(hornSoundFileURL), &(SoundURL));
- AudioServicesPlaySystemSound(SoundURL);
- }
- @end
Advertisement
Add Comment
Please, Sign In to add comment