Arma 3 Scripting

Command in Sounds

playMusic

Also available as Markdown and JSON, or read the original wiki page.

Description

Plays music defined in Description.ext's CfgMusic or config.cpp. If the musicName could not be found a message is logged into the .rpt file: Music <*musicName*> not found.

Note

To stop the music, use playMusic "";.

Syntax

Syntax 1

playMusic musicName

Parameters:

Returns: Nothing

Syntax 2

playMusic [musicName, start]

Parameters:

Returns: Nothing

Examples

Example 1

playMusic "RadioAmbient1";

Example 2

playMusic ["RadioAmbient3", 3]; // start to play from 00:00:03

Example 3

Play from 00:00:01 to 00:00:05:

0 spawn {
    playMusic ["RadioAmbient5", 1];
    sleep 4;
    playMusic "";
};

See also

getMusicPlayedTime · playSound · say · createSoundSource · addMusicEventHandler · fadeMusic · Arma 3 Utilities