XAudio2 Distortion & insane tempo - help

For questions about using Classic.

Post » Sun Dec 05, 2010 10:24 pm

I try to make sound effect when character walk. I think everything is good with wave file and I even add some silence to sound in audacity, but still XAudio2 play sound file insane fast. Whats wrong?

Here are my cap with sound effect:
http://www.speedyshare.com/files/25553701/test.7z

I know its probably newbie question, but I try many things, read wiki, and anything wouldn't work good, so I you guys can help...
B
3
S
1
G
2
Posts: 30
Reputation: 885

Post » Sun Dec 05, 2010 11:46 pm

The problem is that the event for play sound is triggering every single frame that your character is on the ground and walking. To get the right tempo add the following conditions to the event.

Play only on animation frames that the foot hits the ground (You'l have to figure this out on your own)
Trigger once while true (System even, place at end)

or

Every 400 miliseconds
(If you want to be quick)
B
51
S
10
G
7
Posts: 184
Reputation: 6,825

Post » Mon Dec 06, 2010 12:11 am

Download this -
[url:nolhgqc1]http://dl.dropbox.com/u/15858089/2d%20Game%20Starter%20pack.rar[/url:nolhgqc1]

1, Run the '2d base.cap' and you will hear the players footsteps.

2, Go to the relevant event sheets in the cap to see how its done.

Based on your description, it appears to be repeat looping?

Hope this helps

chrisbrobs

[url:nolhgqc1]http://beatboxmusicstudio.yolasite.com[/url:nolhgqc1]
B
19
S
6
G
7
Posts: 1,206
Reputation: 7,300

Post » Mon Dec 06, 2010 8:29 am

Hi guys!

Chrisbrobs, I tried your method and this works! But now I see that my wave file for footsteps are really bad (weird echo). And on other side - there are one bad thing in 2D Starter cap. Lynda running.ogg is playing when running animation are show on screen, so this produce sound even when player jump, because - I think - some of walking (running) animation are still played even when character are in air, perform jump. Here is my set-up:



This set-up for walking/running sound don't "produce" any effects when character are in air. Don't get me wrong, I'm using Construct for three days, but this is what I learned. Really big thanks!

[quote:2vti7wbc]Play only on animation frames that the foot hits the ground[/quote:2vti7wbc]

Sound interesting, I must figure how to make it. Too bad that my English so bad, so I don't understand half of functions...

edit:

I think I know hot to make play sound on certain animation frames:



I don't know about better solution (for now), but sound are really distorted, even when I make "play sound only on frame 4". Any solution?

Happy Santa Claus day!
B
3
S
1
G
2
Posts: 30
Reputation: 885

Post » Mon Dec 06, 2010 2:41 pm

You'll need to toss in a "trigger once when true" condition. (System object)

Each second of game play has around 60 frames of game play (Actual numbers can vary).
Each frame, your game goes through your whole event list
This means it checks to to see if your conditions are true around 60 times a second
If your events don't limit how often they activate, they will rapidly repeat
In this case: creating a rapidly repeating sound.

P.s.: You don't have to make a separate condition for both Frames 4 and 10
You can write
On animation frame: 4 or 10
B
51
S
10
G
7
Posts: 184
Reputation: 6,825

Post » Mon Dec 06, 2010 3:09 pm

Don't use or. It's buggy and can cause crashes.
Moderator
B
88
S
32
G
33
Posts: 3,005
Reputation: 27,432

Post » Mon Dec 06, 2010 5:44 pm

[quote="Arima":2u8mkoll]Don't use or. It's buggy and can cause crashes.[/quote:2u8mkoll]

Are you talking to me, him, or both of us?
B
51
S
10
G
7
Posts: 184
Reputation: 6,825

Post » Mon Dec 06, 2010 6:00 pm

I'm talking to everyone who uses construct and doesn't know or is buggy and can cause crashes. Don't use it.
Moderator
B
88
S
32
G
33
Posts: 3,005
Reputation: 27,432

Post » Mon Dec 06, 2010 6:04 pm

I don't understand your ironic.
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 5 guests