Switching Music

Get help using Construct 2

Post » Sat Jan 04, 2014 10:28 pm

--------------
Found solution
--------------

Seems to be a bug when playing music files in Chrome.

Just set my music files as sound files instead. No problems now.

Also, music files were interfering with my pathfinding. Now that they are set to sound files, there is no issue.


----------------
Original Problem
----------------


Hello,
Not sure why this is happening.

I've loaded two music files, both work fine when played on their own.

For example:

---
On Layout Start
-> Play "Music 1" looping. Tag = "Music 1"
---

((Music plays on startup))

Then I added a sprite "button" which should stop Music 1, and play Music 2.

---
On "Sprite 1" clicked
-> Stop "Music 1"
-> Play "Music 2" looping. Tag = "Music 2"
---

*When running in debug, it shows the first music play, then when the sprite is pressed, it shows the first music stop and second music as "playing". However, the second music does not play (music time playing stays at zero).

Am I missing something simple?

Should I pre-load the second music file??


Thanks for reading.


PortaCannon2014-01-05 03:08:27
B
5
S
1
Posts: 14
Reputation: 754

Post » Sat Jan 04, 2014 10:32 pm

have you tried preloading it yet?
B
3
Posts: 36
Reputation: 299

Post » Sat Jan 04, 2014 10:54 pm

I have, but I'd rather avoid it. It is a decent sized file and takes a long time to load.

I don't think I need to preload it -- as Kyatric's Asteroid clone does not preload the music when it switches between stages.

https://www.scirra.com/tutorials/358/asteroid-clone-in-less-than-100-events/page-1

So... since his works... not sure why my basic example is not working.

Is it possible that Construct 2 starts streaming the first file, then when it switches, it tries to stream both files??

Very bizarre.
B
5
S
1
Posts: 14
Reputation: 754

Post » Sun Jan 05, 2014 3:10 am

Found solution.
Might be a chrome bug.

(Not using "music" files anymore. Just using "Sound" files fixed the problem).
B
5
S
1
Posts: 14
Reputation: 754


Return to How do I....?

Who is online

Users browsing this forum: amazingdream, lordsas, mekonbekon and 54 guests