Seamless music transition

Get help using Construct 2

Post » Fri Jul 05, 2013 12:23 am

Well C2 loops music seamlessly which is great (always had problems with that in CC and others) but what do you do when it comes to playing an intro, checking if that's finished, then playing and looping the rest of the song? There's always a slight pause before the main part plays..

I've tried "On Tag Ended" and "Is Playing" inverted but they both do the same thing. Also tried pre-loading both parts. Not sure it's something I can fix on my end :<Tokinsom2013-07-05 18:04:46
Image
B
243
S
30
G
13
Posts: 1,787
Reputation: 18,770

Post » Fri Jul 05, 2013 1:14 am

read the manual
B
18
S
5
G
4
Posts: 568
Reputation: 5,079

Post » Fri Jul 05, 2013 1:16 am

Read the thread.
Image
B
243
S
30
G
13
Posts: 1,787
Reputation: 18,770

Post » Fri Jul 05, 2013 2:01 am

Read my post.

It seems like C2 is maybe preparing the audio to play it afterward

Why don't you try and play the loop a bit before you stop the intro ?

You could play Loop , wait x seconds and then stop Intro

Edit; Muahahaha ! Got more rep than ya :P !Whiteclaws2013-07-05 02:04:00
B
42
S
17
G
17
Posts: 2,247
Reputation: 17,461

Post » Fri Jul 05, 2013 2:09 am

The only thing I can think of is a timer that is the length of the intro. Start the other track just before.

@California How is a comment like that useful? Tokinsom explained 2 perfectly reasonable examples. Put some effort in, and maybe your rep will be as high one day.
@bearboxmedia
www.bearboxmedia.com

Nintendo Wii U Developer using Construct 2
B
80
S
12
G
7
Posts: 965
Reputation: 10,750

Post » Fri Jul 05, 2013 2:14 am

Rep means nothing. Show me some decent games ;)

I had considered a timer but I have a feeling there will be inaccuracies (and that wouldn't be very efficient). I'm fairly positive there's nothing to do on our end about it. Perhaps it'll work properly in a node webkit build..lemme try that.

Nope :T @Ashley any input on this?Tokinsom2013-07-05 02:28:22
Image
B
243
S
30
G
13
Posts: 1,787
Reputation: 18,770

Post » Fri Jul 05, 2013 2:52 am

I've found this is browser related. Here's a small experiment.

OnEndLooping.capx

IE has a subtle delay (less noticeable in this example, but if you switch to looping the same track, you can here it).

Chrome has no delay. Firefox has a terribly noticeable delay.

Also maybe double check that there is no small delay at the end of your intro music file. There was a thread about a small pause being added by the C2 converter, under certain circumstances.
ImageImageImage
B
71
S
22
G
240
Posts: 3,732
Reputation: 133,990

Post » Fri Jul 05, 2013 4:04 am

I thought that might be the case which is why I tried it out on a node webkit build but it still happens. There is a pause in Chrome but it's less than a second.. Still noticeable though, and moreso with the chiptunes I wrote.

The music definitely cuts off right at the end as they loop perfectly by themselves.Tokinsom2013-07-05 04:08:50
Image
B
243
S
30
G
13
Posts: 1,787
Reputation: 18,770

Post » Fri Jul 05, 2013 5:30 am

R2
Last edited by CarHazy on Sun Jun 14, 2015 3:12 am, edited 1 time in total.
B
20
S
7
G
5
Posts: 24
Reputation: 4,505

Post » Fri Jul 05, 2013 6:22 am

I've got this working in my game. You'll have to prepare your audio a little differently than perhaps you're used to. For this to work, don't worry about clean cut-offs so that the two audio tracks join together perfectly. Leave in the overhang of the last note of the intro and have a good start to the main loop.

Use the system > compare two values expression. If Audio.PlaybackTime("intro") = 2.3, then play your main loop.

To do this, you'll have to have at least your "intro" audio file in the Sounds folder since the audio engine doesn't seem to be able to play multiple files from the Music folder simultaneously. You'll also probably need to preload on the previous layout to avoid a wait at the start of the layout.
B
103
S
38
G
19
Posts: 962
Reputation: 17,996

Next

Return to How do I....?

Who is online

Users browsing this forum: Exabot [Bot], R0J0hound and 26 guests