More Than 2 Music Files

Get help using Construct 2

Post » Wed Nov 20, 2013 5:41 pm

Is there a capability to play more than 2 music files right now or shuffle the order?

I am aware of the "preload" function and the "play" function which work great.

The problem I ran into it was coding when one music track ends and when the other starts.

Currently, if one does preload for 2 tracks and play, they play simultaneously, not sequentially.AmpedRobot2013-11-20 17:42:12
B
35
S
19
G
18
Posts: 242
Reputation: 12,732

Post » Wed Nov 20, 2013 5:45 pm

I can't remember how I've played with it in one of my prototypes, but try switching volumes.
My professional Royalty Free Music at Scirra Assets Store
--------------------------------
Specs: i5 2500, 16gb of ram, gtx 770, win 7, Focusrite Scarlett 8i6, Mackie mr8mk2, Alesis 320, browsing the net on chrome.
B
89
S
30
G
22
Posts: 1,985
Reputation: 20,099

Post » Wed Nov 20, 2013 5:51 pm

Did you try Audio - On Ending... Play Audio 2

By the way, you don't really need to preload music in most cases.
B
61
S
20
G
56
Posts: 1,077
Reputation: 35,986

Post » Wed Nov 20, 2013 11:15 pm

@AmpedRobot

I set up a similar system in a current project and it works pretty good so far. There are 10 songs in the game; upon import, I renamed them to "1" through "10". The game starts and I call 'Play str(round(random(1,10)))...' and add a condition 'On music ended...' (or whatever tag you give the music) and the action 'Play...' with the same settings that started it off.

I used a Function in this case; at the start of the layout, the music function is called to play the first random song; when a song ends, the Function is called to start a new random song.

If you want to stop songs from repeating, add a variable that records the name of the last song played and compare it before starting a new song.

Take care.
B
16
S
6
G
2
Posts: 152
Reputation: 3,764



Return to How do I....?

Who is online

Users browsing this forum: Anonnymitet, atmas, tarek2 and 26 guests