How do I add audio?

  • In the game I am creating, I want music to play in the background. I followed the manual on how to import it (it is the right file type). I then imported it, and created an event that would start it (after adding the audio to the object types). But, upon the event happening, the audio did not start playing. Assuming it had something to do with it not being pre-loaded, I saved it again, but as a sound file (with pre-load, I would assume it would wait (and not run) until the file was fully loaded). But, it started up normaly, and when the event happened, the audio did not start playing.

    How do I get audio to work with my game?

    Note: It might have to be with the browser it runs in, but I can't test if it is right now (public computer).

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Can you upload your capx?

  • Can you share a capx?

  • ok so basically to play a sound or music in your game, you have to have the sounds music files, in WAV format, not mp3 , and have bit rate of 16000 hz not 25.k not 8k 16-bit rate that's if u converse it with audacity ul have options in bottom left.

    then c2 automatically converses them to 2 files 1 .ogg and 1 .mp4, the .ogg is for html5 browsers facebook etc the mp4 is for mobiles when u play audio u need to add the audio object and then call a condition when u want to play it lets say at start of game : when layout starts >audio|>play sound, your sound... and if u want to loop it loop it if not will play 1 time.

    also when u run your game you have a game property saying preload sounds at startup , that means all sounds will be loaded when ur loading bar shows at startup so it does not lag ur game, during gameplay or menu show.

  • I ending up fixing it; it was related to the fact that the game being run in IE. When I switched it Chrome, everything started working.

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