摘要: 有时候在 iPhone 游戏中,既要播放背景音乐,同时又要播放比如枪的开火音效。此时您可以试试以下方法。首先要导入框架 AVFoundation.framework,头文件中 #import <AVFoundation/AVFoundation.h>。NSString *musicFilePath = [[NSBundle mainBundle] pathForResource:fileName ofType:@”wav”]; //创建音乐文件路径NSURL *musicURL = [[NSURL alloc] initFileURLWithPath:musicFilePath]; 阅读全文
posted @ 2011-04-25 14:35 Penny●zheng 阅读(420) 评论(0) 推荐(0)