Sound Click Help (example inside)

For questions about using Classic.

Post » Tue Dec 28, 2010 9:58 am

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:
[url:enenkp3s]https://www.sugarsync.com/pf/D283703_6063149_98502[/url:enenkp3s]

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?
B
4
S
1
G
2
Posts: 64
Reputation: 980

Post » Tue Dec 28, 2010 10:51 am

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.
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767

Post » Tue Dec 28, 2010 11:13 am

[quote="newt":1qlsjoy9]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.[/quote:1qlsjoy9]

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.
B
4
S
1
G
2
Posts: 64
Reputation: 980

Post » Tue Dec 28, 2010 11:25 am

Generated a wav in SFXR real quick.
[url:po7yswdj]http://dl.dropbox.com/u/666516/SoundHelp2.zip[/url:po7yswdj]
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767

Post » Tue Dec 28, 2010 11:39 am

[quote="newt":2uknd1zj]Generated a wav in SFXR real quick.
[url:2uknd1zj]http://dl.dropbox.com/u/666516/SoundHelp2.zip[/url:2uknd1zj][/quote:2uknd1zj]

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.
B
4
S
1
G
2
Posts: 64
Reputation: 980

Post » Wed Dec 29, 2010 12:48 pm

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

[url:1h6yiyi5]https://www.sugarsync.com/pf/D283703_6063149_90551[/url:1h6yiyi5]

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!
B
4
S
1
G
2
Posts: 64
Reputation: 980

Post » Wed Dec 29, 2010 3:32 pm

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.

[quote="BluepointVance":298el83k]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.)[/quote:298el83k]Of 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.
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242

Post » Thu Dec 30, 2010 4:39 am

[quote="tulamide":3pit4ze5]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.[/quote:3pit4ze5]

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.
B
4
S
1
G
2
Posts: 64
Reputation: 980


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 8 guests