Skip to main content

Play Sound

Plays the specified sound.

Play Sound block

Description

The Play Sound block plays the specified sound. This is a code block part of the Sound drawer.

Usage

Plays the specified sound.

Syntax

Inputs in this block:

  • A sound block

Example

The image above is from a predator-prey simulation where a dog agent hunts many smaller cat agents. On collision with a dog, the cat agents will play an audio recording of a cat meowing.

Play Sound example code

Notes

The Play Sound block allows you to add audio feedback to your simulations, making them more interactive and engaging.

  • Sound - Select a sound to play