0 Favourites

Sound Click Help (example inside)

This forum is currently in read-only mode.
  • I can't for the life of me get this to work.

    Using Xaudio I want to play an engine thrust-type sound as long as a key is pressed. Then stop it when you let go of the key (think Asteroids.) But no matter how I try it, I end up getting an annoying "Click" noise at the start and stop of the sound that doesn't exist in the original wav file.

    Here is the cap with the sound:

    https://www.sugarsync.com/pf/D283703_6063149_98502

    Sound gets cashed at the start of layout, then:

    + MouseKeyboard: Key Space is down

    + System: Every 260 milliseconds-> XAudio2: Autoplay file AppPath & "boostshorter.wav" (No loop)

    The sound file itself is about 269 milliseconds long. But if I set it to repeat at 269 I get clicks all over the place.

    As it stands now, first time you hit the space bar, the sound will come on WITH NO CLICK. But then when you let go of the space bar you get the CLICK. And from then on it CLICKS at the start and end of the sound without fail.

    Any idea what am I doing wrong? Any suggestions?

  • I think its the file that's the issue.

    I tried to open it up in Audacity, and it crashed the program, every time.

    Try another sound perhaps?

    Also, see where it says accurate resolution to 10 milliseconds in every x milliseconds?

    Might try on key pressed, trigger once, set sound looping.

    Then on key released, exit channel.

  • Also, see where it says accurate resolution to 10 milliseconds in every x milliseconds?

    Might try on key pressed, trigger once, set sound looping.

    Then on key released, exit channel.

    Just tried that. Still Clicks. Then refuses to play a second time. Damn.

    I've tried several different sound files so far... But all of them processed using Adobe Soundbooth. I'll try to find another program to cut up these wav files. (I'll look at Audacity.)

    Has anyone got a working version of an effect like this I could look at?

    Also, these should be wav files at 44100, 16bit, stereo, uncompressed -- correct? (tried saving as ADPCM, but I get a bunch of noise added to end of the file.)

    Thanks.

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • Generated a wav in SFXR real quick.

    http://dl.dropbox.com/u/666516/SoundHelp2.zip

  • Generated a wav in SFXR real quick.

    http://dl.dropbox.com/u/666516/SoundHelp2.zip

    Thanks alot for doing that!

    I guess it must be the sounds I'm generating. Got Audacity and loaded my sound up. Seemed to work fine. Then exported again. Then changed it to mono. No matter what I do, I get the click.

    Of course if you play that file with any program and you don't start at the very beginning and go to the very end (269 milliseconds) then you get the "CLICK." Perhaps construct is cutting the sound off early? Or starting it a little late. Does the frame rate effect this?

    Might have to generate much simpler sounds. Bummer.

  • Okay, I'm tearing my hair out... and I don't have all that much hair anymore!

    I cannot, in any way shape or form, get a constant, even, repeating sound to start and stop with a key press without it CLICKING.

    I'm attaching another example. With a newer version of the thrust sound included (this one done with a moog synthesizer emulator then edited in audacity.)

    Can anyone tell me how to stop the clicking? A quick fade in on keypress, then quick fade out when the key is let go? How would I do that?

    Baring that, can anyone point me towards a ship-thrust or car engine sound (continuous and looping without much change) that starts and stops without clicking -- one that someone has done in construct? Did anyone do an Asteroids clone with sound?

    Newt was kind enough to do one for me a few posts earlier, and it works -- but the sound varies quite a bit before repeating (not that it should matter.) His seems to work great. Can anyone tell me why the sounds I'm generating won't work and the Newt example does?

    Here is mine, (redone as per Newt's example):

    https://www.sugarsync.com/pf/D283703_6063149_90551

    There is also another problem, if you hit space a few times rapidly -- the sound suddenly refuses to stop playing (I think it might be starting it on another channel, or two other channels I can't really tell.)

    Aaarg! This sound stuff is driving me nuts!

  • For a looped car engine sound have a look at Verve!. It also uses XAudio2 a lot (including fades)

    The click problem is a combination of the kind of your sound, Construct's builtin limiter and the poor quality of the D/As of standard soundcards. With a limiter all sound output is flattened towards maximum loudness. If there are sharp (and very low) frequencies in a sound, it will produce such clicks and the limiter makes them sound even louder. The best you can do is to use loud low frequencies as little as possible and to adjust the channels volume until the clicks disappear (just reducing the volume without changing the spectrum of frequencies may not suffice)

    For the fading you may have a look at Verve! again, but I also made a quick cap using "engIdle.wav" from Verve!, showing how to fade in with key press and fade out on release.

    There is also another problem, if you hit space a few times rapidly -- the sound suddenly refuses to stop playing (I think it might be starting it on another channel, or two other channels I can't really tell.)

    f course it refuses to stop; you're using autoplay, which always plays on a free channel. If you are starting a new sound while the old one is still playing it will play the new sound on a new channel. But you exit the loop only on channel 1.

  • For a looped car engine sound have a look at Verve!. It also uses XAudio2 a lot (including fades)

    The click problem is a combination of the kind of your sound, Construct's builtin limiter and the poor quality of the D/As of standard soundcards. With a limiter all sound output is flattened towards maximum loudness. If there are sharp (and very low) frequencies in a sound, it will produce such clicks and the limiter makes them sound even louder. The best you can do is to use loud low frequencies as little as possible and to adjust the channels volume until the clicks disappear (just reducing the volume without changing the spectrum of frequencies may not suffice)

    For the fading you may have a look at Verve! again, but I also made a quick cap using "engIdle.wav" from Verve!, showing how to fade in with key press and fade out on release.

    Thank you so much. That is very helpful. I now, at least, have some idea of what to shoot for when making sounds. I'm going to study the small cap you made.

    Plus that "Verve!" project is a treasure trove! Thanks so much for making it and commenting it like that... A big help for beginners like me.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
0 Favourites
Examples & Tutorials List
110 211,339
abdalghani's avatar
abdalghani
Unread hot topic
108 86,529
TunaUppercut's avatar
TunaUppercut
Unread hot topic
157 12,693
megatronx's avatar
megatronx