我有一個xcode(4.3.2)項目,我嘗試播放音頻。我有兩臺iPad2設備可以測試。兩者都運行iOS 5.1(9B176),但其中一個是3G,另一個不是。聲音在模擬器中播放,沒有3G iPad,但我無法讓音頻在3G設備上播放。音頻不在所有iOS設備上播放
音頻適用於我在設備上的程序。用於播放聲音的方法,我有如下
-(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並不是靜音是什麼呢? – mttrb 2012-04-25 18:15:33