Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

stop effect in cocos2d?

after so much searching , i couldnt find any solution to stopping effect in cocos2d.

my effect is playing a sound that been taken from database, so to stop that particular sound i have to to this :

[[SimpleAudioEngine sharedEngine] stopEffect:[NSString stringWithFormat:@"%@.wav",sound]];

BUT i got warning : stopEffect making integer from pointer without cast ..

why is that ? how can i stop all the sounds that being playing at once ??? or not a particular one ? any other way ?

thanks a lot .

like image 581
Curnelious Avatar asked Aug 28 '11 15:08

Curnelious


1 Answers

ok you do this :

ALuint soundEffectID;

//to start
soundEffectID=[[SimpleAudioEngine sharedEngine] playEffect:@"my sound"];
//to stop
[[SimpleAudioEngine sharedEngine] stopEffect:soundEffectID];
like image 68
Curnelious Avatar answered Oct 02 '22 13:10

Curnelious