Xaudio

This forum is currently in read-only mode.
  • 2 help threads today, New record ^^

    • Can someone point me in the direction of a tutorial or example cap file of how to get xAudio to play properly.

    Or explain step by step?

    Also when I got a file to work, before it plays the MP3 it freezes for a split second, anyone got any ideas?

    I'm trying to make a sound effect play/loop for when I hold down a key to fire, I have a 0.5 second audio clip I'd like to play.

  • First of all you must tell Construct to use XAudio2 in your layour, so simply ad it, like adding sprite. Now go to events, and you must tell Xaudio2 about caching some of your files, so:

    New event:

    System -> Start of layout[/code:325gwshx]
    
    Now you must set action for XAudio2, so:
    [code:325gwshx]XAudio2: cache [here is you folder with music][/code:325gwshx]
    
    Now you have many ways to add sound to your action. If you have animation for shooting, then:
    New event:
    [code:325gwshx]
    Player Animation _shooting_ is playing
       + Player Animation frame equal to X (your animation frame) - action - XAudio2 autoplay file: yourfile.wav
       + Trigger Once[/code:325gwshx]
    
    Of course you can set action of autoplay to i.e. "when button pressed", or something like that
    
    Here is my "code" for footsteps:
    <img src="http://img801.imageshack.us/img801/5807/clipboard01yx.jpg">
    
    I'm new to Contrust too
  • Thats great, thanks very much. Sorted

  • Is that a tiny Ukyo?

    Sweet.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Yup, its tiny Ukyo from Shinsetsu Samurai Supirittsu: Bushido Retsuden / Samurai Shodown RPG.

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