need help on looping audio manually

Discussion and feedback on Construct 2

Post » Fri May 09, 2014 3:16 pm

Developing app for NodeWebkit here. Currently I have a looping music that requires looping, but it got a long intro that is not a part of the loop.

For example, http://www.youtube.com/watch?v=t7wJ8pE2qKU This music here got a very long intro of 69 seconds, and at about 4:02, the music loop back to the 69th second.

I got a music like that, so I would like to check the music's time position every tick, and if the music exceeds certain time, I would like to seek back by x seconds to make it sound seamless. These could be simply accomplished with Audio.PlaybackTime("music") and { Seek Tag "music" to x seconds } event.

However, I notice that sometimes "seek to" causes the music to stop playing for several hundred millisec and it's as if the program requires a bit of time to load this particular part of music into memory first. It may or may not happen, but when it happened, it is not good for looping music. Music should be seamless.

Yet I found one possible hack for this, and that is to import the music in as a "sound effect" instead. This time, the music runs flawlessly with "seek to". I can "seek to" anywhere and there are no stuttering.

However, this hack comes with the following penalty: high memory usage and longer preload time. Instead of less than a sec preload, this time, it takes about 3-4 seconds. (My music is 7 minutes long) Checking into Task Manager, I see that the Node Webkit takes 220 MB memory now. On the contrary, it was only 61 MB, when I imported this music as "music" and not "sound effect".

While this hack works, the memory consumption just for one music alone is way too harsh, and I got other music as well. I can accept the 3-4 seconds preload time, but not the memory consumption with only just one music. Is there a way to unload or are there some better alternatives for this?
Last edited by TwinBlazar on Thu May 15, 2014 3:25 pm, edited 1 time in total.
I got a game that you multiply, breath fire with two heads and brawl foes to oblivion with your clones: http://www.newgrounds.com/portal/view/660664 (use Chrome on Windows for best performance)

My sites:
http://twinblazar.deviantart.com
http://twinblazar.newgrounds.com
https://twitter.com/twinblazar
http://www.pixiv.net/member.php?id=15072448
B
30
S
11
G
11
Posts: 411
Reputation: 8,459

Post » Thu May 15, 2014 3:17 pm

BUMP

@Ashley, do you have a suggestion for this case?
I got a game that you multiply, breath fire with two heads and brawl foes to oblivion with your clones: http://www.newgrounds.com/portal/view/660664 (use Chrome on Windows for best performance)

My sites:
http://twinblazar.deviantart.com
http://twinblazar.newgrounds.com
https://twitter.com/twinblazar
http://www.pixiv.net/member.php?id=15072448
B
30
S
11
G
11
Posts: 411
Reputation: 8,459

Post » Thu May 15, 2014 4:02 pm

Sorry i can't help :(

But also i have issue with my main menu music, it not looping and whatever i do, i can't make it looping seamless.
Can i make the music when ended play again from second 1 or 2 and not go to the beginning of the music.
Image
B
60
S
10
G
10
Posts: 1,013
Reputation: 9,155

Post » Thu May 15, 2014 4:02 pm

Make the looping portion a separate sound effect that is played as looping, and play the intro part separately.
Scirra Founder
B
387
S
230
G
88
Posts: 24,251
Reputation: 192,464


Return to Construct 2 General

Who is online

Users browsing this forum: Yahoo [Bot] and 2 guests