1

ユーザーが画面に触れた場合、音楽/サウンドの再生を停止するにはどうすればよいですか? 現在、サウンドは次のシーンに再生され続けています。

- (void)setup {

self.isTouchEnabled = YES;
CGSize winSize = [[CCDirector sharedDirector] winSize];

CCSprite *background = [CCSprite spriteWithFile:[AssetHelper getDeviceSpecificFileNameFor:@"StartBackground.png"]];
background.position = CGPointMake(winSize.width / 2, winSize.height / 2);
[self addChild:background];

SimpleAudioEngine *sae = [SimpleAudioEngine sharedEngine];
[sae playEffect:@"airplane_pass.m4a" ];
}

- (void)ccTouchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
[[CCDirector sharedDirector] replaceScene:[CCTransitionFade transitionWithDuration:0.5f scene:[MenuScene scene]]];
}
4

1 に答える 1