S3maphoreDocs
api

Playlist Specification

Fields accepted by a S3maphore playlist.

Every playlist requires a string id, a numeric priority, and an isValidCallback. The remaining fields are optional and describe how the playlist behaves.

Basic fields

FieldTypePurpose
idstringStable playlist name and, when tracks are omitted, the folder name to scan.
priorityPlaylistPriorityPosition in playlist resolution.
tracksstring[]?Explicit VFS paths to tracks.
activeboolean?Whether the playlist can be selected. Defaults to true.
randomizeboolean?Whether tracks are played in random order.
cycleTracksboolean?Whether the playlist repeats after its tracks finish.
playOneTrackboolean?Deactivates the playlist after one track.
isValidCallbackfun(playback) → boolean?Required validity test for the current state. File-based playlists normally omit the parameter and use the injected Playback; programmatic registrations use playback.
fadeOutnumber?Fade duration between tracks.
interruptModeInterruptMode?Controls whether another playlist may interrupt this one.
fallbackPlaylistFallback?Adds fallback playlists or tracks.
exclusionsS3maphorePlaylistExclusions?Removes tracks or playlist folders from discovery.
silenceBetweenTracksPlaylistSilenceParams?Optional playlist-specific silence interval and chance.

silenceBetweenTracks accepts min, max, and chance:

silenceBetweenTracks = {
    min = 5,
    max = 20,
    chance = 0.5,
},

min and max are durations in seconds. They default to 0 and 30 when a playlist-specific silence roll succeeds. chance defaults to 1; if that roll fails, S3maphore can still fall through to the global silence chance.

Fallbacks

fallback can borrow another registered playlist or add extra tracks to the current playlist:

FieldTypePurpose
playlistChancenumber?Chance of selecting a fallback playlist instead of the current playlist. Defaults to 0.5.
playlistsstring[]?Registered playlist IDs from which to select fallback tracks.
tracksstring[]?Relative track paths to add under music/, such as explore/extra.mp3.

Fallback playlist resolution supports nested chains up to depth 10. An inactive or empty fallback returns control to the original playlist.

Exclusions

exclusions removes tracks or playlist folders from automatic folder discovery. The music/ prefix is inferred, so the values use the same IDs and relative paths as playlist definitions:

FieldTypePurpose
playlistsstring[]?Playlist subdirectories to ignore.
tracksstring[]?Explicit tracks to ignore.

For example, tracks = { 'explore/nerevar_rising.mp3' } excludes music/explore/nerevar_rising.mp3.

Folder-derived tracks

If tracks is omitted, S3maphore uses the playlist id to locate a folder. This keeps playlist definitions short and lets music packs add tracks without editing Lua.

return {
    {
        id = 'my-mod/explore',
        priority = PlaylistPriority.Explore,
        randomize = true,
        isValidCallback = function()
            return not Playback.state.isInCombat
        end,
    },
}