SimpleAudioEngine::playEffect() don't work

Hey,

On:
cocos2d-1.0.0-x-0.9.0
Marmalade 5.1

SimpleAudioEngine::playEffect() don’t work.

CocosDenshion::SimpleAudioEngine::sharedEngine()~~>playBackgroundMusic;
~~ music is played

CocosDenshion::SimpleAudioEngine::sharedEngine()~~>playEffect;
~~ generates assertion:

IwAssert failure:
Channel: GAME
File: simpleaudioengine.cpp
Line: 181
Expression: false
Message: Play sound Sounds/CoinCollected.wav Failed. Error Code : S3E_SOUND_ERR_PARAM in s3eSoundChannelPlay

Am I missing something or it just don’t work?

P

Bug #662 created. And thanks for your fix in another thread.

Hey,

To my mind there are two problems/bugs.

First: assertion doesn’t get called despite error generated (fix enclosed before)
Second: playEffect() don’t work

Considering Max’s responsiveness to my posts, it’s time to have a look at playEffect()

Thanks Walzer,
P

Merged at https://github.com/cocos2d/cocos2d-x/commit/034ed1911ede7b14ae9940c400d1ee7371aa2cbd

It does appear there are problems with the playEffect() for marmalade. I can play one effect but as soon as I start loading others it just uses the last loaded effect. It seems the logic is not correct for supporting multiple effects, looing at the Win32 implementation it doesn’t look too difficult to follow the same logic but replace the MCI stuff with Maralade code.

Also the function in SimplieAudioEngine.cpp for Marmalade uses s3eSoundChannelPlay() to play WAV files but this function only plays RAW files.

This blog has some information on this function: http://www.immortalcode.com/2010/09/notes-on-running-soxexe-to-prepare-raw.html

It should have been solved in version 0.11.0