Fire sound play

This forum is currently in read-only mode.
  • Hi all,

    Actually I have a little problem with the audio channels, it's a very messy thing.

    I want a sound to play when I left click, so I did that:

    AT START OF LAYOUT:

    XAudio: Load file "AppPath" & "pistolfire.ogg" to Channel 2 (Non Loop)

    WHEN LEFT CLICK:

    XAudio: Play Channel 2

    --

    So, the sound plays one time, when I left click, but when I click again, the sound is don't playing again.

    As you can read, my prob is that the sound don't play again and again, I want the sound to play again and again when I click to the left button of my mouse.

    What's the problem ? (Seriously, I don't like how actually Construct Classic works with audio files... I prefer the Construct 2 method, but I know... Technologies etc...)

    Thanks guys <img src="smileys/smiley10.gif" border="0" align="middle" />

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The reason for this is that any sound file is only attached to a channel as long as it is playing.

    Instead of loading the sound at start of layout just load it at mouseclick. Sound files are cached, so you will not have delays on subsequent loads. If you are afraid of a delayed play when it is loaded the first time, you can additionally cache the file manually.

    + Start of layout

    -> Cache file (or cache directory, if you want to cache more than one file)

    + On mouse click

    -> XAudio: Load file "AppPath" & "pistolfire.ogg" to Channel 2 (No Loop)

    -> XAudio: Play Channel 2

  • Ahh... now as you tell me this, I understand better what CC do with audio files...

    Works fine, thanks ! :)

    By the way, is there any tutorials to have good beggins in CC ?

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