-(void)Eduqu{
NSError *err=nil; NSString *str=[NSStringstringWithFormat:@"http://127.0.0.1/audio/upload/%d.aif",I]; NSURL *fileUrl=[NSURL URLWithString:str]; NSData *data=[NSData dataWithContentsOfURL:fileUrl]; //設定後台播放 [[AVAudioSessionsharedInstance]setCategory:AVAudioSessionCategoryPlaybackerror:&err]; //設定激活狀態 [[AVAudioSession sharedInstance]setActive:YES error:&err]; //播放 player=[[AVAudioPlayer alloc]initWithData:data error:&err]; [player play]; }