Xcode5 iOS7 audio and images not synchronized

99 Views Asked by At

I'm developing an iPad App and I have a problem with animations. I start animations and audio at the same time with an IBAction, they're synchronized using iPad2, but when I run the App on iPad 3 and on simulator 64 bit audio and images are not synchronized because images have a delay.

This is my code:

-(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];

Which is the problem?

Thank you for your help

0

There are 0 best solutions below