iPhone - 一些声音文件不玩 [英] iPhone - some sound files not playing

查看:80
本文介绍了iPhone - 一些声音文件不玩的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有短wav文件的列表。这些文件中的两个不在任模拟器或设备本身发挥。所有的WAV文件的步骤1秒长。

I have a list of short wav files. Two of these files do not play on either the simulator or the device itself. All are wav files 1 second long.

这是我如何播放的文件

SystemSoundID soundID;
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"sound1" ofType:@"wav"];

NSURL *fileUrl = [NSURL fileURLWithPath:filePath];
AudioServicesCreateSystemSoundID((CFURLRef)fileUrl, &soundID);
AudioServicesPlaySystemSound(soundID);

有人能告诉我这个问题可能是什么。谢谢你。

Can someone please tell me what the problem could be. Thanks.

P.S。当我在Finder中查看文件,不播放该文件显示的默认播放器QuickTime和其他显示默认播放器的iTunes,如果以任何方式帮助。

P.S. When I view the files in Finder, the files not playing show the default player as QuickTime and the others show the default player as iTunes if that helps in any way.

作为艾伦的解决方案建议是使用AIFF文件。为WAV转换成AIFF,打开iTunes中的声音文件。在iTunes中,选择preferences->常规 - >导入设置 - >导入使用AIFF恩$ C $铬。选择声音文件,并在高级菜单选项中选择选项创建AIFF版本

推荐答案

看到这个问题
<一href=\"http://stackoverflow.com/questions/258006/trying-to-play-sound-through-iphone-simulator\">http://stackoverflow.com/questions/258006/trying-to-play-sound-through-iphone-simulator

我已经与.AIFF文件的更多的成功。

I've had a lot more success with .aiff files.

这将是一件好事知道的究竟的AudioServicesCreateSystemSoundID是当一个文件被传递给它检查。

It would be good to know what exactly AudioServicesCreateSystemSoundID is checking when a file is passed to it.

这篇关于iPhone - 一些声音文件不玩的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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