【发布时间】:2011-09-05 07:07:22
【问题描述】:
在我的应用程序中,我正在从库目录播放声音。
这里的声音以不同的命名约定存储在不同的文件夹中。
例如,
文件夹喜欢:Test,Test 2
现在,当我尝试从Test 播放声音时,它会播放声音。
但是当我尝试从Test 2 播放声音时,它没有播放任何声音。
我正在使用以下代码播放声音:
recordFile : "/Users/taxsmart2/Library/Application Support/iPhone Simulator/4.3/Applications/E2F2C422-605A-4EC7-A40A-7429A966351C/Library/List13-Test/rec212:13:21.caf" // 播放声音
recordFile : "/Users/taxsmart2/Library/Application Support/iPhone Simulator/4.3/Applications/E2F2C422-605A-4EC7-A40A-7429A966351C/Library/
List13-Test 2/rec212:13:21.caf" // 可以不播放声音
// May be because of space `Test 2`
AVAudioPlayer *player = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL URLWithString:recordFile] error:nil];
[player prepareToPlay];
在按钮上单击我有以下代码:
[player play];
我该如何解决这个问题?
【问题讨论】:
标签: iphone objective-c ios4 avaudioplayer