Scratch for Java

Sprite::addSound()

Add a sound to the sprite. If a sound with the received name already exists do nothing.

Example usage:

this.addSound("footstep_carpet_000");

Examples

View on GitHub

Syntax

Java

.addSound(name, soundPath)
.addSound(name)

Parameters

Name Data Type Description
name String a unique name
soundPath String a sound path, or the name of a built-in sound such as "footstep_carpet_000"

Return

void

addSound()

Create Shareable URL

Select Sections