Bijoy Thangaraj
Bijoy Thangaraj

Reputation: 5546

Looping sound effects in CocosDension, Cocos 2d

CocosDension's SimpleAudioEngine offers way to loop background music. But only one music file can be played at a time. I need to loop multiple sound files. Is there an easy way to achieve this using CocosDension of Cocos 2d?

Upvotes: 1

Views: 671

Answers (2)

abnvp
abnvp

Reputation: 1027

You can also use the

SimpleAudioEngine::playEffect(soundfile, true)

This will play the effect in a loop

Upvotes: 0

Sebastián Castro
Sebastián Castro

Reputation: 1408

If you use the CDSoundSource you can set if you want to loop or not the sound. Yes define a CDSoundSource for each sound and play independently.

Check the samples in the CocosDenshion folder, specifically FadeToGrey/TheAudioCode class.

Upvotes: 1

Related Questions