A_StopSound

From ZDoom Wiki
Jump to: navigation, search

A_StopSound [(int slot)]

Usage

Stops the sound currently playing on the specified channel for the calling actor. The function can only stop sounds that have an actor source. Sounds which are played locally (by calling A_PlaySound with local set to true) are source-less, thus cannot be stopped by this function.

Parameters

  • slot: the sound channel on which the sound to stop is playing. Default is CHAN_VOICE.

Examples

This new fireball plays a loop sound when it spawns, and when it comes to "Death" state, it stops the sound and the projectile explodes.

ACTOR ImpFireBall : DoomImpBall
{
    States
    {
    Spawn:
        BAL1 A 0 NoDelay A_PlaySound("Fireball/Loop", CHAN_6, 1, TRUE)
        BAL1 AB 4 Bright
        Loop
    Death:
        BAL1 C 0 A_StopSound(CHAN_6)
        BAL1 CDE 6 Bright
        Stop
    }
}

See also