Articles on: Blocks Creator
This article is also available in:

🟧 Play music

🟧 Play music



The Play music block allows you to launch an audio track in the background, ideal for background music or continuous sound loops.


Unlike the Play Sound block which is designed for one-off effects, this block is optimized for background playback, with an auto-repeat option.


πŸ“₯ Entries


  • music (Sound): The audio file (mp3, wav) containing the background music to play.
  • repeat (Boolean): If activated (True), the music repeats in a loop. Disabled (False) by default.


πŸ“€ Outings


  • out (Flow): The logic flow continues immediately after the music starts, without waiting for it to end.


πŸ’‘ Example of use


Scenario: Ambient music for an adventure game


  1. The player enters an enchanted forest.
  2. The flow reaches a Condition block checking the current area (enchanted_forest).
  3. The Play music block is activated with:
  • music: ambience_foret.mp3
  • repeat: True (for a continuous loop)
  1. The music starts in the background, and the stream moves to the next block (showing a welcome message).
  2. The player explores the forest while the music persists until another audio block replaces or stops it.


βš™οΈ Technical Details

  • Asynchronous behavior: The music continues to play even after moving to the next block, without blocking the stream.
  • Supported formats: MP3 and WAV (prefer MP3 for reduced weight).
  • Loop management: If repeat is disabled, the music stops naturally at the end of the file.

Updated on: 04/03/2026

Was this article helpful?

Share your feedback

Cancel

Thank you!