Sound Effects

This forum is currently in read-only mode.
  • I haven't actually used sound effects in my projects before so this will be a learning experience. I've searched the forums and looked through the wiki, but there seems to be rather limited material on how to implement sound effects properly. Here's my situation, or at least a similar situation that I can get what I need from. What is the proper event setup for:

    Is Button Held?

    Play Sound

    And, more importantly, stopping the sound as soon as the button is released.

    Now, some questions:

    Can I start the sound where it left off?

    Can I force it to loop if it ends?

    How do I prevent it from starting over and over again each tick?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • [quote:283tr7da]How do I prevent it from starting over and over again each tick?

    If Autoplay doesn't work try

    + System: Trigger once
    + MouseKeyboard: Key Space is down
    -> XAudio2: Autoplay file AppPath & "example.wav" (No loop)[/code:283tr7da]
    
    You can play any sound easily with the Autoplay trigger with XAudio2 but if you want more extensive control you can set your sounds to different channels. It might be a bit of an overkill to set every sound to a different channel as I'm sure they are mixed together when played instead of muting each other while overlapping.
    
    I prefer setting a channel for a whole category of sounds such as Player, Enemies, Environment and the like.
    
    [quote:283tr7da]Can I start the sound where it left off?
    
    You can pause and unpause sounds.
    [quote:283tr7da]Can I force it to loop if it ends?
    
    You can quit a loop on a channel.
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)