I use this code to play a short sound effect. This happens when user clicks the return button of the keyboard, which makes the keyboard click sound effect louder than usual. Is it possible to play the effect at certain volume without affecting system sounds?
- (void)playCorrectAnswerSound {
NSString *path = [[NSBundle mainBundle] pathForResource:@"correct" ofType:@"mp3"];
NSURL *urlPath = [NSURL fileURLWithPath:path];
self.player = [[AVAudioPlayer alloc] initWithContentsOfURL:urlPath error:nil];
self.player.volume = 0.04;
[self.player prepareToPlay];
[self.player play];
}