Is "Audio/preloads complete" event useless?

Discussion and feedback on Construct 2

Post » Sat May 31, 2014 10:44 pm

Hi everyone,

I'm making a game for a client. They were slightly unhappy with the browser version of the game because sometimes the song would take a while to load and game would start without it.

I saw the feature Audio/preloads complete and offered to my client that I could add a loading screen to the game, that would say "loading", and this loading screen would preload all sounds and the music, then disappear and go to the rest of the game once the pre-loads are finished....simple, right?

Unfortunately, at least on IOS safari the action "preloads complete" NEVER triggers after the first time the game is run, so if someone resets, the game gets stuck in the loading screen.

Worse still, it seems on IOS safari, the sounds all reload for every frame, so you can't preload them all in a loading screen, as they'll be GONE and need to be re-downloaded as soon as you go to the actual game screen.

Am I missing something? Has anyone made any use of this event, and if so, how?

Thanks,
Mike
B
49
S
9
G
4
Posts: 426
Reputation: 7,041

Post » Sun Jun 01, 2014 4:07 am

Hi

Checklist
-make sure all audio are stereo (very important)
-try use lower frequency 22khz
-before move to next layout, make sure audio preload complete is triggered (for me it will always triggered or try to add wait like 5 seconds before move to next layout as backup)
-i put music in audio folder, not music folder
-music try to use less than 30 seconds


I use audacity for audio editing. So far i dont have issues anymore on audio. Usually i just use preloads event once at warming up layout.

Clear browser or safari cache and try again
B
75
S
22
G
14
Posts: 389
Reputation: 12,224

Post » Sun Jun 01, 2014 8:01 am

Hi tumira,

Thanks very much for the suggestions...but do you see how this feels like developing voodoo rituals in hopes it fixes the problem? If you we need to use sounds so specifically formatted and placed in only a specific folder in hopes of getting a very basic feature to work, shouldn't these requisites be carefully mentioned in the manual section for the action, AND in the chapter regarding audio in general..for example: WARNING, you must jump through hoops a, b, c, d, e, f, g etc in hopes that the on pre-loaded completed event to hopefully work...

Because now, best case scenario, I convert, re-export and reimport all my sounds and music and cross my fingers.

I had purposefully made sure all my sound sample were mono in an attempt to save download time/file-space, and maybe even processor time...they play fine in all browsers/runtimes etc, but now I discover it might be breaking this other critical sound-related functionality... :(
-Mike
B
49
S
9
G
4
Posts: 426
Reputation: 7,041

Post » Sun Jun 01, 2014 8:27 am

I have 50 sounds in my game.
And i preload all of them on start of layout, otherwise some sounds will not play during the game.
I'v suggest before : Preload all sounds.
B
60
S
10
G
10
Posts: 1,013
Reputation: 9,155

Post » Sun Jun 01, 2014 9:45 am

@Brashmonkey

I would highly suggest use stereo sound. I found out it may causes audio issues in Safari. I understand your frustrations.
B
75
S
22
G
14
Posts: 389
Reputation: 12,224

Post » Sun Jun 01, 2014 10:25 am

@ A0Nasser, I do preload the sounds. The problem is, the event Audio/ on preloads completed, does NOT work as expected, at least on the platforms/browsers I've tried.
B
49
S
9
G
4
Posts: 426
Reputation: 7,041

Post » Sun Jun 01, 2014 3:39 pm

There are three points I would like to add into consideration.

IOS Safari doesn't do much with the audio until the first touch. This is a Safari browser problem. I'm not sure if this relates to preloading or not. But it might.

Second. I found that some audio files just don't load correctly the first time. Some times I will have a sound fx that just won't play the first time(or preload). Sometimes I will have a song that won't work the first time. Usually if I edit the song in audacity and cut the first second out it fixes the problem. I have no idea what it is or why. It's really annoying.

Three. Ashley says in the documentation that trying to preload more than 5 files at time may not work out so well.
B
90
S
18
G
9
Posts: 2,455
Reputation: 15,018

Post » Sun Jun 01, 2014 7:13 pm

Thanks so much jayderyu (and everyone else).
I should have looked at the documentation closer to see the issue with safari on IOS not playing sounds until the first touch, at least knowing this makes it easier to tell what is actually working and now working within the confines of support for the crappy browser. ;)

cheers,
Mike
B
49
S
9
G
4
Posts: 426
Reputation: 7,041

Post » Thu Sep 18, 2014 11:32 am

Hi everybody .. I'm just ressurecting this old thread because I'm having similar problems -
the issue:
If I use the project setting preload sounds (I.e not the preload you can set in events) the game loads, plays sounds and work correctly. secons (or third for that matter) time i start the game the loading fails and it just stops on the standard scirra load screen....
If i disable the general preload and preload a few sounds on my first layout/eventsheet it doesn't cause any problems...

So my question is - does anybody else have this specific problem where the general preload sound doesn't work but preload via eventsheet does work ?

ahh and just to make it clear - this is on safari - everything works in chrome .. and even on the freaky samsung stock browser...

2 question - I see that some of you recomend using stereo sounds because mono causes havoc on safari .. is this a confirmed thing ?
Image
Get it on Google play or play on papio.nu
B
11
S
2
Posts: 79
Reputation: 786

Post » Thu Sep 18, 2014 1:52 pm

@Kali - try the latest beta, we've made some fixes to do with audio preloading lately.

Also since the OP is fairly old now, preloading sound effects is now redundant in the latest builds if you enable 'Preload sounds' in project properties.
Scirra Founder
B
395
S
232
G
88
Posts: 24,368
Reputation: 193,746

Next

Return to Construct 2 General

Who is online

Users browsing this forum: paxto22 and 6 guests