need help on looping audio manually

0 favourites
  • 4 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • 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,

    Subscribe to Construct videos now

    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?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • BUMP

    Ashley, do you have a suggestion for this case?

  • 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.

  • Make the looping portion a separate sound effect that is played as looping, and play the intro part separately.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)