I need to play a sound when an action takes place, I already have the callback when the action ends and it's working fine and now I want to add a sound to it.
I've added AudioToolbox
as framework and this is the code I tried to use:
SystemSoundID playSoundID;
NSURL *clockSound = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"clock" ofType:@"mp3"]]; //the path for my resource
AudioServicesCreateSystemSoundID((__bridge CFURLRef)clockSound, &playSoundID);
AudioServicesPlaySystemSound(playSoundID);
I don't get any errors but the sound isn't played