use more then one sound in my iphone application using cocos2d
Posted
by Rana
on Stack Overflow
See other posts from Stack Overflow
or by Rana
Published on 2009-02-24T07:30:49Z
Indexed on
2010/04/05
1:03 UTC
Read the original article
Hit count: 406
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.
© Stack Overflow or respective owner