Audio not playing after switching Layouts

Get help using Construct 2

Post » Sun Feb 23, 2014 6:36 pm

Hello! Every time I get stuck with something, I can usually overcome the problem after some attempt, searching in the manual and/or browsing through the forums to see if someone had the same problem before and how it was solved. As none of these options helped me in this case, I will try my last resort with this topic.

My issue is simple: I have two layouts, menu and stage. Each one plays and loops a different music on the start. When the player goes from the menu to the stage and vice versa, the current music would stop and the new one would start from the corresponding event page. Problem is that the current layout music plays and stops alright when it should, but in the next layout the corrsponding music doesn't play at all. Strangely enough, when switching back to the starting layout, the corresponding music plays. This also happens for both cases: If I start the testplay on "Menu", the "Stage" music don't play. If I start on "Stage", the "Menu" music don't play.

Running the debug mode it's possible to see that the music supposed to play in fact starts, but it doesn't plays for some reason:
Image
Left is the music playing on the starting scene, Right is the music "playing" after swithing the layout. It's possible to see that on the right there's a "0s/NaN s", showing that the audio file is playing but not running (?)

I personally think that the key to the problem origin can be there, but I tried some things and none of them worked. I tried preloading the audio files, playing the audio before switching the scene instead of playing in the beginning, messing with volume... I also created another test project just to test the audio switching, and it worked perfectly.

Here are the lines controling the starting and ending of the looping music.

They are basically "At the start of layout, if this is not playing, play it" and "Before switching the layout, stop the music."

So... does any one knows what can be the problem or the solution? Thank you so much for any help.
B
14
S
5
G
1
Posts: 2
Reputation: 1,104

Post » Thu Mar 06, 2014 7:13 am

I'm having the same problem. I want to play a music file on start of layout (i only have one layout in the project), and it just won't play. The debug mode reports the same as mentioned above: music file "playing" but not "running". If anyone knows what causes this problem, i'd be most grateful.
B
4
Posts: 1
Reputation: 254

Post » Thu Mar 06, 2014 9:56 am

Can you please post a capx containing that problem?Use the same codes you used for the audio
I will not let you reach the sisters
Nature Forums
B
11
S
5
G
2
Posts: 496
Reputation: 2,306


Return to How do I....?

Who is online

Users browsing this forum: justifun, wizdigitech, Yahoo [Bot] and 9 guests