Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Best on Thu 26/08/2004 22:54:02

Title: Play sound - repeat?
Post by: Best on Thu 26/08/2004 22:54:02
Excuse my. I have a sound that I want to play as a background sound. In short: I want it to repeat again and again in loop. Is it possible? Please help me.

Thanx
Title: Re: Play sound - repeat?
Post by: Jay on Thu 26/08/2004 23:12:58
Yes.
Use SetMusicRepeat(1).

But, uh, this is clearly stated in the manual.
Title: Re: Play sound - repeat?
Post by: TerranRich on Fri 27/08/2004 00:11:08
Yes, it is.
Title: Sound repeat
Post by: Best on Fri 27/08/2004 17:13:45
Ok, I try it once more: I dont want to repeat MUSIC. I want to repeat WAV sound. Is it possible or not? When I save wav as music file, it cannot be played. Repeatedly_execute cannot help me here, so what can I do?
Title: Re: Sound repeat
Post by: Ashen on Fri 27/08/2004 17:24:06
Well, you could convert the wav to MP3 or OGG, or one of the supported file types, and use PlayMusic, and SetMusic Repeat.

If you really want / have to use wav, you could use PlaySoundEx and IsChannelPlaying, e.g.:

(in repeatedly execute)
if (IsChannelPlaying(3)==0)   PlaySoundEx(20, 3);

Alternatively, you could use PlayAmbientSound  -check manual for more details on how.

Hopefully one of these will work for you.


Title: Re: Play sound - repeat?
Post by: Radiant on Fri 27/08/2004 18:19:18
PlayAmbient would be best. Also you could probably check if the sound is still playing from RepExAlways, and re-play it from there if it isn't.