Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Olleh19 on Fri 16/10/2020 01:38:25

Title: Math problem, trying to sync a sound with a vibrating Phone
Post by: Olleh19 on Fri 16/10/2020 01:38:25
Question: i've done a 4bar loop. The loop at the moment is 126bpm, it's stretchable ofc, Gamespeed is set at standard 40.

The animation frames needed for the phones sound to vibrate and end  in similar same rate and duration is 24, 0 delay on the animation setting.

However, i don't want to have the "same" phone vibration all the time, and that's why it's crucial to "think" right here.

How i wished the Moderators could get that "propagate sound" feature i've suggested in the next AGS release. Then this would have been a none issue. Being able to have a long sound, that is playing until it ends in the animation view would be great.

I did try with adding the sound in the first frame as if it was a "walking step" sound, but even if i unchecked it to repeat, and just "play once", it's still playing it over and over, which creates aweful phasing artifacts.

Thanks!

Title: Re: Math problem, trying to sync a sound with a vibrating Phone
Post by: KyriakosCH on Fri 16/10/2020 05:41:57
Can't you just have different sounds made of the same sound? Eg one with x duration, another with x/2 or whatever. Assuming you know how long the phone is going to be ringing each time (ie it is not dependent on when you will pick it up). If it is dependent on when you pick it up, you can just code the sound to stop when the phone is picked up.

I am assuming the player character isn't the phone  (laugh)
Title: Re: Math problem, trying to sync a sound with a vibrating Phone
Post by: Olleh19 on Fri 16/10/2020 11:51:37
Quote from: KyriakosCH on Fri 16/10/2020 05:41:57
Can't you just have different sounds made of the same sound? Eg one with x duration, another with x/2 or whatever. Assuming you know how long the phone is going to be ringing each time (ie it is not dependent on when you will pick it up). If it is dependent on when you pick it up, you can just code the sound to stop when the phone is picked up.

I am assuming the player character isn't the phone  (laugh)

Haha, true, already done that you said in the ending ofc. Imagine the player hearing a vibration sound all the time even when the phone is picked up, in a loop! Haha!  (laugh)
The vibrations are a specific length that is "too long" for the "different sound" idea to work. Unless you mean in code that i have it sound at different frames with timer, i'm guessing. But i suck at coding. I have no idea how to set that up efficiently. A certain frame starts one sound, another frame, another, etc. I guess that could work.
I just suck at coding, and wished it could be avoided.  (laugh)
Title: Re: Math problem, trying to sync a sound with a vibrating Phone
Post by: Slasher on Fri 16/10/2020 12:32:31
I'de use 2 timers and a boolean.
Title: Re: Math problem, trying to sync a sound with a vibrating Phone
Post by: Olleh19 on Fri 16/10/2020 13:21:44
Quote from: Slasher on Fri 16/10/2020 12:32:31
I'de use 2 timers and a boolean.

Thanks for your reply Slasher, i guess i have to dive into the world of timers afterall. (laugh)