Looping a sound in Spring

Looping a sound in Spring

Discuss sound effects, game music, and the creation thereof.

Moderator: Moderators

Post Reply
Jay_sound
Posts: 6
Joined: 01 Nov 2009, 09:31

Looping a sound in Spring

Post by Jay_sound » 11 Nov 2009, 00:06

Hello.

Say I have a flamethrow wav sound loop, is there there any script I can add which will, instead of starting the sound each time a projectile comes out, rather it will play it once only and loop the sound while the flame projectiles are coming out?
0 x

User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Looping a sound in Spring

Post by Argh » 11 Nov 2009, 04:10

Loop, no- Spring does not support true endless looping atm. You can approximate it, but that's all.

Play sound only at the start of a burst, so that it doesn't stutter, yes. Use soundTrigger = true in the weaponDef, IIRC.
0 x

User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14564
Joined: 17 Nov 2005, 02:43

Re: Looping a sound in Spring

Post by Forboding Angel » 16 Nov 2009, 01:38

Yeah, flamethrowers have been an endless pain in the ass because of the non-looping sounds since the beginning of time.
0 x

User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: Looping a sound in Spring

Post by jK » 16 Nov 2009, 09:09

sounds.lua ?
0 x

User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Looping a sound in Spring

Post by Argh » 16 Nov 2009, 18:39

...does not actually allow for endless loops. The "loop" instruction merely cuts it off, which is not the same thing as a true endless loop. Try testing it, you'll see what I mean.
0 x

User avatar
Jools
XTA Developer
Posts: 2802
Joined: 23 Feb 2009, 16:29

Re: Looping a sound in Spring

Post by Jools » 27 Nov 2012, 11:45

I have the same problem but for Laser Beam type weapons. I already made a check that it will only play the sound once per every living projectile, but it still stutters. The reason is that the frequency of projectiles is so huge in comparison with sound length.

Any ideas? What can be done in sounds.lua?

Edit: I mean weapons such as Penetratror and Doomsday Machine...
0 x

User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14564
Joined: 17 Nov 2005, 02:43

Re: Looping a sound in Spring

Post by Forboding Angel » 14 Dec 2012, 21:41

The only way I have found to make it work nicely are using short sounds without an obvious beginning or end, just quickfade the beginning and end of it.

Sucks, but it's about all we have.
0 x

User avatar
Jools
XTA Developer
Posts: 2802
Joined: 23 Feb 2009, 16:29

Re: Looping a sound in Spring

Post by Jools » 15 Dec 2012, 18:00

But I'm using the same sounds as the ones included in basecontent. I just play them manually from playsoundfile and then this happens. It doesn't happen if the sound is played by the engine. So that led me to believe that playsoundfile-items are not pre-cached.
0 x

Post Reply

Return to “Sound Effects & Music”