Skip to content

Stop Music

Stop Music

Stops the currently playing music track with an optional fade-out duration.

Properties

System

Name Explanation Type
Fade-Out (milliseconds) The duration in milliseconds over which the music fades out before stopping. Variable or Value

Examples

Stop Music Immediately

Stops the currently playing music track without any fade-out.

stop_music();
{"Data":{"FadeOutDuration":{"IsGlobalVariable":false,"IsLocalVariable":false,"IsValue":true,"Value":"0","VariableIndex":0,"Metadata":null},"Metadata":null},"TypeName":"MAR.Game.Shared.Models.Scripts.Commands.Audio.StopMusicCommand"}

Stop Music with a Fade-Out Duration

Stops the currently playing music with a 500 millisecond fade-out.

stop_music(500);
{"Data":{"FadeOutDuration":{"IsGlobalVariable":false,"IsLocalVariable":false,"IsValue":true,"Value":"500","VariableIndex":0,"Metadata":null},"Metadata":null},"TypeName":"MAR.Game.Shared.Models.Scripts.Commands.Audio.StopMusicCommand"}

Stop Music with a Variable Fade-Out Duration

Stops the currently playing music with a fade-out duration stored in a global variable.

stop_music($gv[0]);
{"Data":{"FadeOutDuration":{"IsGlobalVariable":true,"IsLocalVariable":false,"IsValue":false,"Value":"","VariableIndex":0,"Metadata":null},"Metadata":null},"TypeName":"MAR.Game.Shared.Models.Scripts.Commands.Audio.StopMusicCommand"}