Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: deltamatrix on Sun 12/10/2003 23:21:14

Title: time between ambient sounds
Post by: deltamatrix on Sun 12/10/2003 23:21:14
I need to have an ambient sound of a phone ringing but there needs to be a time gap between each ring...obviously. How do I do it?
Title: Re:time between ambient sounds
Post by: a-v-o on Sun 12/10/2003 23:29:18
insert silence into the sound file after the phone ring
Title: Re:time between ambient sounds
Post by: on Mon 13/10/2003 12:47:32
AAAwwwwwww.

I was afraid you'd say that! Doing that only adds to the size of the file which is annoying.

I would like to suggest for AGS a variable that creates a time gap between the repeating of ambient sounds.

Say if the ambient noise is birds tweeting in a forest, you don't wanna hear them constantly instantly over and over again. They should have time to rest their lungs. Surely otherwise, they'd lose their voices.

Why am I bothering to say this?
Title: Re:time between ambient sounds
Post by: Ben on Mon 13/10/2003 15:26:05
Can't you jsut use a timer and play a regular sound?

Something like:

SetTimer(1,300);

When the phone starts ringing and

if(IsTimerExpired(1)==1) {
PlaySound(1);
SetTimer(1,300);
}

in the repeatedly_execute script.
Title: Re:time between ambient sounds
Post by: Pumaman on Mon 13/10/2003 20:43:03
Yes, ambient sounds are designed for constant background noises like machines humming and so forth.

For incidental sound effects like a bird chirping, just use a normal PlaySound on a timer.
Title: Re:time between ambient sounds
Post by: foz on Tue 14/10/2003 00:15:39
Why don`t you tie the sound into the animation of the phone ringing.....

So it plays sample when the phone anim...moves...and put a still frame with a time delay.......in the view.

The you can control it by using object animate......when character picks up u just stop animation...


foz
Title: Re:time between ambient sounds
Post by: on Tue 14/10/2003 13:23:33
unfortunately the phone rings only during a blocking cutscene. I guess I'll have to do it avo's way!
Title: Re:time between ambient sounds
Post by: CB.. on Tue 14/10/2003 16:06:12
could you change the volume of the ambient sound?

alternating the volume between very low and normal would give it a gap
Title: Re:time between ambient sounds
Post by: Ben on Tue 14/10/2003 20:11:11
Actually, Foz's way would be the best. There's no additional scripting, and it won't increase the file size.
Title: Re:time between ambient sounds
Post by: a-v-o on Tue 14/10/2003 22:09:10
Doin it foz's way you can use 2 frames with the same sprite, one with sound and the other without, if you don't have an animation for the ringing phone.
Title: Re:time between ambient sounds
Post by: on Tue 14/10/2003 23:36:18
ah yeah! Sorry foz. I guess i missed your post. Thats a good idea. I wish i thought of it.

Thanx.

Sorted!