CAPX Included!
Problem Description
*EDIT:* Same set of sound files were getting triggered at once when player overlaps with a group enemies. Now I used Trigger Once and the crash rate has reduced.
However after I included BG music and exported to Windows Phone/Emulator, the music stops as soon one or two sound files is played. My CAPX file will show you this happening. I think this is happening with lengthier sound/music files only. (Eg: bgmusic and cricket sounds files are more than 20 seconds in length, and these two files stop playing after few seconds.)
Continuing my App from my previous post(viewtopic.php?f=152&t=114976) where I resolved the Image Distortion issue by Cropping the large PNG files. The App worked wonderfully without any issue until I added the Audio Object.
I am playing a single Music file background and various other sound files (like Footsteps, Enemy sounds, Player Hurt, etc). When I exported the game as an Universal App to my Windows Phone Lumia 720, I noticed that the game crashes after about 2 to 3 mins of gameplay. I decided to debug on the Emulator (512MB). I found that it regularly throws up error at this point:
'WWAHOST.EXE' (Script): Loaded 'Script Code (MSAppHost/2.0)'.
Exception was thrown at line 14761, column 6 in ms-appx://94047361-e2dc-4b28-9958-c9485e8983ae/c2runtime.js
0x80004005 - JavaScript runtime error: Unspecified error.
The program '[1120] WWAHOST.EXE' has exited with code 1 (0x1).
I went to the c2runtime.js file line #14761. Exactly the code that's supposed to play the Sound file!! If you see there is a Win 8.1 comment from the Developers too.
if (this.is_music && isMusicWorkaround && !audRuntime.isInUserInputEvent)
musicPlayNextTouch.push(this);
else
{
try {
--------line #14761-------------------->this.instanceObject.play();
}
catch (e) {} // sometimes throws on WP8.1... try not to kill the app
}[/code:1y7vhwbo][/i]
I started Disabling Audio Play commands until I had only the Foot steps sounds.. Now the rate at which the APP crashed reduced! Infact it seems to run without any issues!
Now my question is., could format of a file by any means cause this issue? All sounds files are in M4A format since I am only developing for Windows Platform. Any help would be greatly appreciated!
[b]Attach a Capx[/b]
h*t*t*p*s://drive.google.com/file/d/0B3-U8v4LYOJNQXZmaVM2dms0T1U/edit?usp=sharing
[b]Description of Capx[/b]
A Platformer prototype, where platform is scrolling to the left with random enemies. Press Left/Right key to dodge them. Space to jump.
I am using multiple BG music files which plays randomly. Enemies have bite and cry sounds played randomly. As time goes, I play a Night sounds with dogs howling. Day time you hear Crows.
[b]Steps to Reproduce Bug[/b]
[ul]
[li] Export the Project to VS2013 - Universal app
[/li][li] Set Windows Phone Project as Start Up
[/li][li] Run on 512 MB, Emulator or Windows Phone (mine is Lumia 720)
[/li][li] Press Start Button when loaded
[/li][li] Game starts BG music, you can see the Player Sprite and platform moving
[/li][li] As soon as player collides with enemy and it makes sounds, the [b]BG music stops.[/b]
[/li][li] Continuing to play, the game crashes or report the above mentioned JS error.[/li][/ul]
[b]Observed Result[/b]
[b]Expected Result[/b]
[b]Affected Browsers[/b]
[ul]
[li] Chrome: (NO)
[/li][li] FireFox: (NO)
[/li][li] Internet Explorer: (NO)[/li][/ul]
[b]Operating System and Service Pack[/b]
Windows Phone 8.1 latest updates
512MB RAM (both Emulator and Phone)
[b]Construct 2 Version ID[/b]
r178 64Bit