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

RB.SoundLoopSet

Method  -  Static

public static void SoundLoopSet(SoundReference soundReference, bool loop)

Parameters

soundReference SoundReference Sound reference
loop bool True if sound should loop

Returns

Nothing.

Description

Specify whether the currently playing sound specified by SoundReference should keep looping.

Example

AudioAsset  soundAlarm = new AudioAsset();
SoundReference alarmSoundRef;

void Initialize() {
    soundAlarm.Load("sounds/alarm");
}

void Update()
{
    if (EnemyInRange()) {
        if (!RB.SoundIsPlaying(alarmSoundRef)) {
            alarmSoundRef = RB.SoundPlay(soundAlarm);
            RB.SoundLoopSet(alarmSoundRef, true);
        }
    }
    else if (RB.SoundIsPlaying(alarmSoundRef)) {
        RB.SoundStop(alarmSoundRef);
    }
}

See Also

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

See Docs

Features - Sound