【发布时间】:2012-04-25 17:04:08
【问题描述】:
我有一个 xcode (4.3.2) 项目,我正在尝试播放音频。我有两台 iPad2 设备要测试。两者都运行 iOS 5.1 (9B176),但一个是 3G,一个不是。声音在模拟器和没有 3G 的 iPad 上播放,但我无法在 3G 设备上播放音频。
音频可以在我设备上的程序上运行。我播放声音的方法如下
-(void) playSound {
NSString* filePath = [[NSBundle mainBundle] pathForResource:@"gbm_menu_music"
ofType:@"m4a"];
NSURL *soundURL = [NSURL fileURLWithPath:filePath];
avPlayer = [[AVPlayer alloc] initWithURL:soundURL];
[avPlayer play];
}
我打来的电话
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
感谢任何帮助。
【问题讨论】:
-
请原谅我说的很明显但 iPad 没有静音是吗?
标签: ios ipad audio xcode4 avfoundation