Page 1 of 1

ending a looping sound

Posted: Tue Dec 07, 2021 1:02 pm
by Barbie
Is there a possibility to stop a looping sound that is initiated by SpecialEvent.PlayersPlaySoundEffect.Trigger() → PlayerPawn.ClientPlaySound() → Actor.PlaySound()? I tried it with triggering another SpecialEvent that plays a none looping sound at InitialStage PlayersPlaySoundEffect with but that did not interrupt or override the looping sound.

Re: ending a looping sound

Posted: Tue Dec 07, 2021 7:41 pm
by Aspide
I don't think is possible, once the ClientPlaySound function is called (and the sound loops) there is nothing that can be done to stop the sound from repeating forever. An alternative solution would be to use the WorkingTriggeredAmbientSound from Operation Na Pali (olextras.u), the only problem is that this is Ambient Sound instead of ClientPlaySound, but adding many of those actors all over the map should have the same effect.

Here is the code of WorkingTriggeredAmbientSound:

Code: Select all

// ============================================================
// This package is for use with the Partial Conversion, Operation: Na Pali, by Team Vortex.
// WorkingTriggeredAmbientSound : Triggering changes the actor's ambientsound
// ============================================================

class WorkingTriggeredAmbientSound expands Triggers;
var () bool bInitiallyPlaying;  //is the sound playing on default?
var () sound TheSound; //the ambience.

function PreBeginPlay(){
  Super.PreBeginPlay();
  if (bInitiallyPlaying)
    ambientsound=TheSound;
}

function Trigger( actor Other, pawn EventInstigator )
{
  if (AmbientSound!=None)
    AmbientSound=none;
  else
    AmbientSound=TheSound;
}

state() TriggerToggled
{
}


state() OppositeWhileTriggered
{
  function Trigger( actor Other, pawn EventInstigator )
  {
   if (AmbientSound==none^^bInitiallyPlaying)
     global.Trigger(other,eventinstigator);
  }
  function UnTrigger( actor Other, pawn EventInstigator )
  {
   if (AmbientSound!=none^^!bInitiallyPlaying)
     global.Trigger(other,eventinstigator);
  }

}

defaultproperties
{
}

Re: ending a looping sound

Posted: Tue Dec 07, 2021 8:40 pm
by sektor2111
A new thing added that changes said sound to a sort of null sound with no looping property - Editing Map or injecting in map some "vaccine" patcher...

Re: ending a looping sound

Posted: Tue Dec 14, 2021 1:45 am
by Barbie
Seems to be v469 specific bug in OpenAL (see bug report on github).