Forum

Looping sound > start then stop

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

Looping sound > start then stop

Postby ajay » Mon May 24, 2010 1:40 pm

Is it possible to start a looping sound, then stop it?
User avatar
ajay
 
Posts: 559
Joined: Fri Oct 29, 2004 6:44 am
Location: Swindon, UK

Postby Lardarse » Mon May 24, 2010 2:07 pm

Create an entity that will start by playing .noise1 until triggered, then switch between .noise1 and .noise2 whenever triggered. Then make .noise1 be the looping sound, and .noise2 be a sound that isn't looping.
Roaming status: Testing and documentation
User avatar
Lardarse
 
Posts: 266
Joined: Sat Nov 05, 2005 1:58 pm
Location: Bristol, UK

Postby Spike » Mon May 24, 2010 2:56 pm

and from a QC perspective:
a sound is replaced if you play another sound on the same entity+channel (except not channel 0).
this is true whether the old sound was looping or not.
so you can stop a sound by playing a null sound.
note that this is similar to the sounds made by moving trains (except that the replacement sound is not silent in that case).

with qw engines, be careful about phs (replacement sound should have no attenuation)...
Spike
 
Posts: 2892
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Postby ajay » Mon May 24, 2010 4:54 pm

Cheers for that, got it working using the null.wav.
User avatar
ajay
 
Posts: 559
Joined: Fri Oct 29, 2004 6:44 am
Location: Swindon, UK

Postby Lardarse » Tue May 25, 2010 8:20 am

There is a map hack that can do this if you're not modifying code.
Roaming status: Testing and documentation
User avatar
Lardarse
 
Posts: 266
Joined: Sat Nov 05, 2005 1:58 pm
Location: Bristol, UK


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest