Page 1 of 1

Xaudio

PostPosted: Thu Dec 09, 2010 8:14 pm
by blind1992
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.

Re: Xaudio

PostPosted: Thu Dec 09, 2010 10:12 pm
by eq2D
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:
[code:325gwshx]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:


I'm new to Contrust too :roll:

Re: Xaudio

PostPosted: Fri Dec 10, 2010 2:35 pm
by blind1992
Thats great, thanks very much. Sorted :)

Re: Xaudio

PostPosted: Sun Dec 12, 2010 11:59 pm
by madster
Is that a tiny Ukyo?
Sweet.

Re: Xaudio

PostPosted: Mon May 16, 2011 11:00 am
by eq2D
Yup, its tiny Ukyo from Shinsetsu Samurai Supirittsu: Bushido Retsuden / Samurai Shodown RPG.