XAudio2 Distortion & insane tempo - help

This forum is currently in read-only mode.
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • 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...

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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)

  • Download this -

    http://dl.dropbox.com/u/15858089/2d%20Game%20Starter%20pack.rar

    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

    http://beatboxmusicstudio.yolasite.com

  • 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:

    <img src="http://img259.imageshack.us/img259/593/clipboard01lb.jpg">

    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

    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:

    <img src="http://img826.imageshack.us/img826/2165/clipboard01pl.jpg">

    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!

  • 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

  • Don't use or. It's buggy and can cause crashes.

  • Don't use or. It's buggy and can cause crashes.

    Are you talking to me, him, or both of us?

  • I'm talking to everyone who uses construct and doesn't know or is buggy and can cause crashes. Don't use it.

  • I don't understand your ironic.

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