Song length for Command

Trying to create a command where it changes the lights to “police” and plays a song but is there a way to set a time limit on the song ?

The song stops when the duration of your creation or command is finished.

No Matter how long a set the duration of the command the song continues to play.