Xcode5 iOS7音频和图像未同步

时间:2014-05-04 09:05:55

标签: ios xcode ipad animation audio-video-sync

我正在开发一款iPad App和 我的动画有问题。 我使用IBAction同时启动动画和音频,他们使用iPad2进行同步,但是当我在iPad 3和模拟器上运行应用时,64位音频和图像不同步,因为图像有延迟。

这是我的代码:

-(IBAction)Action:(id)sender {

UIButton *Namebutton = (UIButton*) sender;
Namebutton.enabled = NO;

animation.animationImages = [NSArray arrayWithObjects:
                                  GetImgWithoutCachingP6(@“image1.png"),
                                  GetImgWithoutCachingP6(@"image2.png"),
                                  GetImgWithoutCachingP6(@"image3.png"),
                                  GetImgWithoutCachingP6(@"image4.png"),
                                  GetImgWithoutCachingP6(@"image5.png"),
                                  GetImgWithoutCachingP6(@"image6.png"),
                                  GetImgWithoutCachingP6(@"image7.png"),
                                  GetImgWithoutCachingP6(@"image8.png"),
                                  GetImgWithoutCachingP6(@"image9.png"),
                                  GetImgWithoutCachingP6(@"image10.png"),
                                  GetImgWithoutCachingP6(@"image11.png"),
                                  GetImgWithoutCachingP6(@"image12.png"),
                                  GetImgWithoutCachingP6(@"image13.png"),
                                  GetImgWithoutCachingP6(@"image14.png"),
                                  GetImgWithoutCachingP6(@"image15.png"),
                                  GetImgWithoutCachingP6(@"image16.png"),
                                  nil];

animation.animationRepeatCount = 2;
animation.animationDuration = 4.0;
[animation startAnimating];


NSString *Sound = [[NSBundle mainBundle] pathForResource:@“NameSound" ofType:@"wav"];
Scenesound=[[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath: Sound] error:NULL];
Scenesound.volume = 4.0;
Scenesound.numberOfLoops = 1;
[Scenesound play];

问题出在哪?

感谢您的帮助

0 个答案:

没有答案