Xaudio

For questions about using Classic.

Post » Thu Dec 09, 2010 8:14 pm

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.
B
2
G
2
Posts: 26
Reputation: 702

Post » Thu Dec 09, 2010 10:12 pm

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:
B
3
S
1
G
2
Posts: 30
Reputation: 885

Post » Fri Dec 10, 2010 2:35 pm

Thats great, thanks very much. Sorted :)
B
2
G
2
Posts: 26
Reputation: 702

Post » Sun Dec 12, 2010 11:59 pm

Is that a tiny Ukyo?
Sweet.
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Mon May 16, 2011 11:00 am

Yup, its tiny Ukyo from Shinsetsu Samurai Supirittsu: Bushido Retsuden / Samurai Shodown RPG.
B
3
S
1
G
2
Posts: 30
Reputation: 885


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 1 guest