Audio Issue

0 favourites
From the Asset Store
100+ Musical High Quality Sound Effects for your game!
  • I have an audio issue (on chrome) imported wav music (around 3 minutes) on start of layout play looped.

    No other sound gets played after that! The strange thing is that if I do the same thing on the first layout it works, I can't post the capx because it's a finished game for the competition, I would like to know if this is a know issue or if there are thing I should know about this.

  • I also found out the if the game goes into game over (which stops the music) and you start again this time both music and sounds works.. why?

  • 1/ don't forget to tag your sounds when you launch them (I always do that)

    2/ sounds are kinda global, if you launch a sound and you restart the layout the sound won't stop. In your case you can do

    System: On start of layout
      Audio: stop sound tag "music"
      Audio: play sound tag "music"

    This way you're sure the music isn't played twice

    If you don't want to restart the music but let it play without duplication you should use a global number

    Global number music = 0
    System: On start of layout
    System: music = 0
      -> Audio: play sound looped tag "music"
      -> System: set music to 1
  • I did everything you suggest, I have to find out, my game has a lot of "code" and at the current state debugging with construct is not easy.. It's very strange though, I have to look into this..

  • I found out the problem which I think it's a bug Ashley please shed some light.

    After excruciating tests <img src="smileys/smiley19.gif" border="0" align="middle" /> I found out the following.

    The music gets started BEFORE any other sound (the song is in the music folder). Sound do NOT get loaded until the song finishes to stream. This is the reason why the title song (which is only 20 seconds long) do not create this behaviour. I'm using the latest (stable) chrome.

    I fixed this by moving the music in the sounds folder, but it's hackish since this way people will have to wait until the song streamed before hearing it.

    Solutions (apart from preloading)?

  • I don't have that kind of issue on cubemaze. The main music (kinda weird sound that appears progressively) and the woosh in the intro are in the music folder, and the other sound plays nicely.

    Also, if you test on localhost, the downloading phase should be pretty fast so following your hypothesis, the sound in the sound folder should plays after like 2 or 3 seconds.

    Try to create a test capx the best you can with sound and if you can reproduce your bug, send it over here (:

  • Ok, I'll try to recreate the error in a new capx, thanks

  • Yann

    I'm trying to get a sound to play on start-up on an iPad.

    I used your following code:

    Global number music = 0

    System: On start of layout

    System: music = 0

    -> Audio: play sound looped tag "music"

    -> System: set music to 1

    It works fine on browsers but wont work at all on iPad. The only way I know to get sound to work is to attach a button or something that triggers the sound to play. Do you know why this is and is there a solution?

  • The mystery continues..

    This bug applies ONLY to chrome.

    I don't understand the reason, but you can try this. Import 2 songs. As soon as the first layout starts play the first one. Then as soon as the user clicks somewhere take him to another layout stop the first song and start the other. ALL subsequent sounds will not play until the song has finished streaming! This, I repeat only in chrome every other browser doeasn't do this.

  • 0plus1: then you should report this bug to chrome.

  • 0plus1: then you should report this bug to chrome.

    I'll do it! Thanks for the link

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi, I just starting using this amazing software.

    Using Chrome I stumbled on the issue of playing a Music track on Layout Start and having all subsequent Sounds fail to play.

    I solved the issue by applying the "Preload" action in Audio to all my Sounds in Layout Start.

    Thanks,

    Dave

  • Good to know! Thanks for having posted this!

  • I will also confirm Dave's solution. I have a title screen and tell system to preload the music for the rest of the project. Otherwise, no sounds will play or music will play late.

  • That still sounds like a bug, it should work fine without the workaround. Can someone reproduce it in a new project and submit to the bugs forum?

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