あなたはこのようなことをすることができます(マイレージは変わるかもしれません、これは私の虚弱な記憶から漏れています):
// i suppose you have your animFrames in some local var animFrames
// and your CCSprite in some other local/iVar frameOne
float animationDuration=0.8f;
int animationFrames=12;
float fourthFrameTime=animationDuration*4/animationFrames;
float animFrameDelay=animationDuration/animationFrames;
id animateSprite=[CCAnimation animationWithFrames:animFrames delay:animFrameDelay];
id playFootsteps = [CCSequence actions:[CCDelayTime actionWithDuration:fourthFrameTime],
[CCCallFunc actionWithTarget:self
selector:@selector(playFootSteps)],nil];
id spawn = [CCSpawn actions:animateSprite,playFootsteps,nil];
[frameOne runAction:spawn];
// and somewhere an
-(void) playFootSteps{
[[SimpleAudioEngine SharedEngine]playEffect:@"footstep.mp3"];
}
これがアプリで繰り返されるテーマである場合は、任意のオブジェクト インスタンスから自家製のプロトコル/インターフェイスを介して呼び出すことができるメタ サウンド マネージャーを作成することをお勧めします (通常は「シングルトン」を使用して、cocos2d の一般的なアプローチに固執します)。そして、そこでサウンドの開始/停止/再開の複雑さを管理します。