use more then one sound in my iphone application using cocos2d
- by Rana
avc = [[MPAVController sharedInstance] avController];
//avc is AVController
NSString *path = [[NSBundle mainBundle] pathForResource:@"Sound" ofType:@"wav"];
id feeder = [[MPArrayQueueFeeder alloc] initWithPaths:[NSArray arrayWithObject:path]];
[avc setQueueFeeder:feeder];
[avc play:nil];
[feeder release];
NSTimer *sound = [NSTimer scheduledTimerWithTimeInterval:(9.0) target:self selector:@selector(Gamesoundplay) userInfo:nil repeats:YES];
Hear i use tow framework for playing sound.
1. MediaPlayer.framework
2. AudioToolbox.framework
I success to play the background sound with repeat after lodding the game. I also want to play sound after clicking some button action without stop the previous background sound.But when i click the other button that time background sound is stop and start again after time intereval ( 9.0 sec ) which i mention for repeated the sound time line.
If anyone do this work then help me to complete my application.