Hello all, thought this could help other people having the same issue.
Also possibly related to prior sound issues people had in another thread that was closed.
----
I've had an issue with long sound files vs short ones. Long sound files (longer than 20 secs)would play, but short ones wouldn't play on android.
I contacted Ludei about this and sent them a ZIP.
Well, looks like the game was not detecting my device correctly (android) and tried to play the short sound files in m4a format which is not working on android (I didn't know). Should be playing ogg files instead.
Check the debug menu in Cocoonjs during gameplay (fps number box), verify if you see your sound files being loaded in m4a format.
If so, a temp solution is to do this (you can use Notepad++ on windows):
Modify line 775 of c2runtime.js and change this line:
this.isAndroid = /android/i.test(navigator.userAgent);
for this line:
this.isAndroid = true;
Should force a proper detection of your device and play all sound files as ogg.
By the way, "c2runtime.js" is inside your exported ZIP file for Cocoonjs.
UPDATE:
In any case the above fix doesn't work for you, you can also just replace every instance of the word "m4a" with "ogg" in the above JS file.
Also, make sure you've got the actual ogg files in your game. (C2 creates them for you at the import of sounds)
Ashley: this issue seems to be related to the way C2 detects what device is running the game after Cocoonjs modifies the useragent. Seems to mess up the detection system. The guys over at Ludei told me they would sort this bug out with you guys. UPDATE: looks like this will be fixed in an update of Cocoonjs. Ludei: "A bug that isn't reporting the user agent correctly and that's what's making Construct use the m4a files." You can close this bug I guess. :)
----->Also, is there a way to include only ogg files when we know the game will run on Android? Without the need to delete wav and m4a files manually before the export. Thx