cocos2d/cocos2d-x — pull request #1775 by mingulov (2012-12-21 21:19:51+00:00)
Title: CocosDenshion Android - missing sound effects with some conditions

Android SoundPool.load returns 0 if sound might not be loaded - for example, it does not exist. Previously - 0 has been ignored and incorrectly written to HashMap, so it was not possible to understand on the application side that something goes wrong (and use some additional workaround).

Use case:
1) On the game loading - preload all possible sound effects (to speed up their playing later, when it will be needed)
2) Game APK does not have any sound file, they are downloaded later in a separate thread.
3) Application tries to play sound effects as usual, when needed.

So due to this bug - as there was no any sound file exist during the game loading - internal HashMap contains incorrect 0 as id for every effect, and there is no any sound effect during
the first application start.

Fixed by adding additional check to Cocos2dxSound.java - to preloadEffect and createSoundIDFromAsset.