documentation index ◦ reference manual ◦ function index

# renpy.music.play

Function: | renpy.music.play | (filenames, channel=7, loop=True, fadeout=None, synchro_start=False, fadein=0, tight=False, if_changed=False):

This stops the music currently playing on the numbered channel, dequeues any queued music, and begins playing the specified file or files.

filenames may be a single file, or a list of files.

loop - If True, the tracks will loop while they are the last thing in the queue.

fadeout - If None, the fadeout time is taken from config.fade_music, otherwise it is a time in seconds to fade out for.

synchro_start - If True, all the channels that have had play called on them with synchro_start set to True will be started at the same time, in a sample accurate manner. This can be used to, for instance, have a piece of music separated into separate percussion, melody, and background chord audio files, and play them simultaneously.

fadein - The number of seconds to fade the music in for, on the first loop only.

tight - If True, then fadeouts will span into the next-queued sound.

if_changed - If True, and the music file is currently playing, then it will not be stopped/faded out and faded back in again, but instead will be kept playing. (This will always queue up an additional loop of the music.)

## Example

        # Start some music playing in the background with a fade in effect 2
        # seconds after the start of the music play
        $ renpy.music.play("mozart.ogg", fadein=2)

documentation index ◦ reference manual ◦ function index