has Iphone built in beep sound effect

冷暖自知 提交于 2019-12-04 21:33:10

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!