问题
hi i need to use beep on iphone, but the only thing i have found is this
NSString *soundPath = [[NSBundle mainBundle] pathForResource:@"alert" ofType:@"wav"];
SystemSoundID soundID;
AudioServicesCreateSystemSoundID((CFURLRef)[NSURL fileURLWithPath: soundPath], &soundID);
AudioServicesPlaySystemSound (soundID);
[soundPath release];
it is working and good code but i need to import the alert.wav file.But i rather do this with native (built in) sounds if there exist.
thanks for all the answers cs.
回答1:
Reading the documentation of Apple and this, I'm almost certain that you can play that wanted sound without carrying it.
You can do this:
AudioServicesPlaySystemSound(1005);
that should do.
Reference: here
来源:https://stackoverflow.com/questions/5867058/has-iphone-built-in-beep-sound-effect