Is there a way to implement custom shutter sound when capturing still image in camera controller? I guess default sound plays automatically and can't be turned off but is it ok to play another sound over it?
Asked
Active
Viewed 879 times
1 Answers
0
Yes,
use this:
AudioServicesPlaySystemSound(1108);
You can check all full sounds here:
For a custom sound:
AVAudioPlayer *audioPlayer;
NSString *soundFilePath = [[NSBundle mainBundle] pathForResource:@"Name of your audio file"
ofType:@"type of your audio file example: mp3"];
NSURL *soundFileURL = [NSURL fileURLWithPath:soundFilePath];
audioPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:soundFileURL error:nil];
audioPlayer.numberOfLoops = -1;
[audioPlayer play];
Make sure you import
<AVFoundation/AVFoundation.h>

Pedro Pinho
- 652
- 3
- 6
-
I am looking to play custom sound and not default one. – ZassX Aug 09 '17 at 12:14