Legacy GM Audio_play_sound vibration...

T

Tonydaderp

Guest
Hi. I'm currently making a game and when I break pots, the pot smashing sound comes on. Except that the sound sounds a little vibraty. When I use the sword however, it is fine. I am using audio_play_sound. The sound effect is a wav. Is it the compression that throws it off or something? Or the priority?
 

FrostyCat

Redemption Seeker
WAV is generally an uncompressed, lossless format unless the codec used in the file features lossy compression. It looks like you are either accidentally setting off that sound multiple steps in a row, or so many sounds are playing together that the result is loud enough to start clipping.
 
T

Tonydaderp

Guest
WAV is generally an uncompressed, lossless format unless the codec used in the file features lossy compression. It looks like you are either accidentally setting off that sound multiple steps in a row, or so many sounds are playing together that the result is loud enough to start clipping.
I think you may be right about the sound in too many steps.... i'll check it out...
My code is to play sound "snd_pot" when the player collides with it. is that a steps issue?
 

FrostyCat

Redemption Seeker
If you don't destroy the pot after colliding with it or use a flag to prevent consecutive recurrences, of course there would be a "steps issue".
 
T

Tonydaderp

Guest
If you don't destroy the pot after colliding with it or use a flag to prevent consecutive recurrences, of course there would be a "steps issue".
Can I prevent that by saying " sound_exists" or something?
 

FrostyCat

Redemption Seeker
Can I prevent that by saying " sound_exists" or something?
Who taught you sound_exists() checks whether a sound is playing? On GMS it is audio_is_playing(). Before using an unfamiliar function, check its Manual entry to make sure it does what you think it does.

Either way, it won't save you if you don't stop the collision from retriggering. It would just play again once the current one is done. You have to destroy the colliding pot or use a variable to stop the recurring plays.
 

rIKmAN

Member
Can I prevent that by saying " sound_exists" or something?
You could use audio_is_playing to check if the sound is already playing, but if you don't set a variable and the sound is short, then it will play again as soon as it finishes if it is still colliding.

Just set a variable when the collision occurs (ie. hit = true) and check against this before playing the sound.

@FrostyCat Your replies always raise a smirk from me, you're so....frosty! :)
 
Top