Scratch for Java

Sprite::removeSound()

Removes a sound.

Examples

import org.openpatch.scratch.*;
 
public class SpriteRemoveSound {
 
  public SpriteRemoveSound() {
    var myStage = new Stage(600, 240);
    Sprite zeta = new Sprite("green", "assets/zeta_green_badge.png");
    zeta.addSound("bump", "assets/bump.wav");
    zeta.removeSound("bump");
    myStage.exit();
  }
 
  public static void main(String[] args) {
    new SpriteRemoveSound();
  }
}
 

View on GitHub

Syntax

Java

.removeSound(name)

Scratch

remove sound (name)

Parameters

Name Data Type Description
name String The name of the sound to remove

Return

void

removeSound()