i can't find no solution!!!
animation size 10kb sound size 20kb
here is the code:
- (void)setupSounds {
NSString * filePath
filePath = [[NSBundle mainBundle] pathForResource:@"shake" ofType:@"mp3"];
soundShuffle = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:filePath ]error:nil];
sound.volume = 0.4;
[sound prepareToPlay];
[sound setDelegate: self];
}
- (void) startAnimation {
[self.Sound setCurrentTime:0.0];
[self.Sound play];
pos1 = CGPointMake(2.0,7.0);
kid.center = CGPointMake(kid.center.x+pos1.x,kid.center.y+pos1.y);
if(kid.center.x > 60 || kid.center.x < 0)
pos1.x = -pos1.x;
if(kid.center.y > 236 || kid.center.y < 105)
pos1.y = -pos1.y;
}
- (void) playSound {
if(self.sound.playing)
{
[self.sound stop];
}
[self.sound setCurrentTime:0.0];
[self.sound play];
}
- (void)viewDidLoad {
[self setupSounds];
}