Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / [SOLVED] Been away from AGK for a while! Why does the quack sound repeat when I click the mouse?

Author
Message
basicFanatic
7
Years of Service
User Offline
Joined: 7th Jun 2017
Location:
Posted: 17th Nov 2023 15:38 Edited at: 17th Nov 2023 15:39
The quack repeats, and when I press the mouse again, another repeating duck joins in. Hooray, I made a duck choir sim. But really, why?

The author of this post has marked a post as an answer.

Go to answer

Aidan
User Banned
Posted: 17th Nov 2023 15:53 Edited at: 17th Nov 2023 16:04
How many times does it repeat.

Does the sound wave genuinely have 1 quack in the file.

Edit

Please try

GetRawMouseLeftReleased

Instead
basicFanatic
7
Years of Service
User Offline
Joined: 7th Jun 2017
Location:
Posted: 17th Nov 2023 16:04 Edited at: 17th Nov 2023 16:06
Yep, one single geniue quack. No clue why it repeats.

Edit: GetRawMouseLeftReleased didn't help any
Aidan
User Banned
Posted: 17th Nov 2023 16:05 Edited at: 17th Nov 2023 16:38
This post has been marked by the post author as the answer.
Please try

GetRawMouseLeftReleased

Instead

Returns 1 when released

Edit

On your playsound you have a 1 on your loop argument


basicFanatic
7
Years of Service
User Offline
Joined: 7th Jun 2017
Location:
Posted: 17th Nov 2023 16:12
Thanks, nicely spotted! I guess I got the parameters messed up.
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 17th Nov 2023 23:36
Quote: "Why does the quack sound repeat "


Because you told it to repeat lol
Tiled TMX Importer V.2
XML Parser V.2
Base64 Encoder/Decoder
Purple Token - Free online hi-score database
Legend of Zelda
Pixel-Perfect Collision

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds

jd_zoo
6
Years of Service
User Offline
Joined: 12th May 2018
Location: Nova Scotia
Posted: 18th Nov 2023 15:13
Duck choir lol too funny

In the most simple terms you can use this:



What you may want to look at here is using the instance of the sound. Every time you run PlaySound() it is making an instance of that sound and is returning a reference that instance with a unique ID.


With a reference to the sound instance you can now set all kinds of fun things like SetSoundInstanceBalance(DuckInstance, -1.0) to put it in the left channel or SetSoundInstanceBalance(DuckInstance, 1.0) for the right channel. Set that particular instance's volume with SetSoundInstanceVolume(). And for even more fun try playing with SetSoundInstanceRate() to change the pitch and add your own doppler affect if the duck is flying by you.

Automation on Steam now!
Score Table Jr. on Google Play!

Login to post a reply

Server time is: 2024-11-21 15:51:03
Your offset time is: 2024-11-21 15:51:03