How do I achieve seamless looping music with Cordova

Get help using Construct 2

Post » Wed Apr 01, 2015 2:28 pm

Hi everyone,

I've been working with XDK / Corvoda / Crosswalk for awhile now and it's been great. However I have been noticing a problem with music files. It seems there is a noticeable hiccup in looping audio.

I realize that this is most likely due to the audio format m4a for iOS.. which is much like mp3 in that it doesn't allow

However even with Android via Crosswalk it too had poor music looping.

So long story short, is there some special setting(s) or perhaps 3rd party audio plugin someone has out there that allows me to load music and have it play great.

I remember one of the nice things I experienced with CocoonJS when I ported my game over to the OUYA was that they had great looping music.

With all the advances we've made with HTML5 / Cordova, I hate to think Construct 2 games are unable to simply play looping music smoothly.. I hope there is a solution for this because so far I've managed to be able to work around this problem, but at some point I'm going to really need the ability to play something seamlessly and I don't think this is an unreasonable request or expectation in 2015 :)

Thanks,
Caleb
B
54
S
9
G
1
Posts: 915
Reputation: 6,362

Post » Sun Apr 05, 2015 7:48 pm

bump.
B
54
S
9
G
1
Posts: 915
Reputation: 6,362

Post » Wed Apr 29, 2015 4:03 pm

bump
B
54
S
9
G
1
Posts: 915
Reputation: 6,362

Post » Sat Dec 10, 2016 5:23 am

yes I would like to know this as well.. just listened to my loops and there's a GIANT pause between the loop point
B
81
S
27
G
14
Posts: 1,111
Reputation: 14,523

Post » Thu Dec 29, 2016 4:49 pm

@jobel the only solution I have found is to use "effects" instead of music for playing songs.. this means basically that music will loop seamlessly.. i think the only trade off is that the music is uncompressed so it might add some size to your game.. so keep your songs short.

I don't know about a giant gap, but yea if you want smooth looping music import the music as a sound effect not as "music" and it should be fine.

if you need to start / stop music it gets trickier.. but for my last game http://www.kongregate.com/games/part12s ... video-game i actually (because it was slowing me down) just played both songs all the time and simply control volume of both turning down the audio on one as i turn up the audio on the other.. not ideal, but it gets the job done.
B
54
S
9
G
1
Posts: 915
Reputation: 6,362

Post » Tue Jan 03, 2017 5:40 pm

part12studios wrote:@jobel the only solution I have found is to use "effects" instead of music for playing songs.. this means basically that music will loop seamlessly.. i think the only trade off is that the music is uncompressed so it might add some size to your game.. so keep your songs short.

I don't know about a giant gap, but yea if you want smooth looping music import the music as a sound effect not as "music" and it should be fine.

if you need to start / stop music it gets trickier.. but for my last game http://www.kongregate.com/games/part12s ... video-game i actually (because it was slowing me down) just played both songs all the time and simply control volume of both turning down the audio on one as i turn up the audio on the other.. not ideal, but it gets the job done.


that reads it into memory though...

I read a work around somewhere that seemed to do the trick... play music NOT LOOPED then make a Trigger on tag finished, then start the track again. Basically manually looping... so far so good..
B
81
S
27
G
14
Posts: 1,111
Reputation: 14,523

Post » Tue Jan 03, 2017 5:56 pm

two relatively short songs wasn't a problem but yea if you wanted lots of music it could become an issue maybe.

yea i'll have to try that approach next time and see how it does.
B
54
S
9
G
1
Posts: 915
Reputation: 6,362


Return to How do I....?

Who is online

Users browsing this forum: alajajm, Evanetot, LaurenceBedford, pokka, robopunch and 13 guests