有Iphone内置的哔哔声效果 [英] has Iphone built in beep sound effect

查看:200
本文介绍了有Iphone内置的哔哔声效果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在iphone上使用哔声,但我发现的唯一的东西是

  NSString * soundPath = [NSBundle mainBundle] pathForResource:@alertofType:@wav]; 

SystemSoundID soundID;

AudioServicesCreateSystemSoundID((CFURLRef)[NSURL fileURLWithPath:soundPath],& soundID);

AudioServicesPlaySystemSound(soundID);

[soundPath release];

它是工作和良好的代码,但我需要导入alert.wav文件。



感谢所有的答案
cs。

解决方案

阅读Apple和的文档,我几乎肯定



您可以执行此操作:



AudioServicesPlaySystemSound(1005);



参考: 此处


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.

解决方案

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

这篇关于有Iphone内置的哔哔声效果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆