AudioAsset
Ease
FastString
FontAsset
NineSlice
PackedSprite
PackedSpriteID
RB
   HardwareSettings
   IRetroBlitGame
RBAsset
Rect2i
ShaderAsset
SoundReference
SpriteGrid
SpriteSheetAsset
TMXMapAsset
   TMXLayer
   TMXLayerLoadState
   TMXObject
   TMXObjectGroup
   TMXProperties
Vector2i

RB.SoundStop

Method  -  Static

public static void SoundStop(SoundReference soundReference)

Parameters

soundReference SoundReference Sound reference

Returns

Nothing.

Description

Stop the sound currently playing by using its SoundReference. Once the sound is stopped it can no longer be resumed and the specified SoundReference is no longer valid.

Example

AudioAsset  soundSpeech = new AudioAsset();
SoundReference speechSoundRef;

void Initialize() {
    soundSpeech.Load("voice/tutorial");
}

void Update()
{
    if (RB.KeyDown(KeyCode.F1)) {
        if (RB.SoundIsPlaying(speechSoundRef)) {
            RB.SoundStop(speechSoundRef);
        } else {
            speechSoundRef = RB.SoundPlay(soundSpeech);
        }
    }
}

See Also

AudioAsset
RB.SoundPlay
RB.SoundIsPlaying
RB.SoundVolumeSet
RB.SoundVolumeGet
RB.SoundPitchSet
RB.SoundPitchGet
RB.SoundLoopSet

See Docs

Features - Sound