Package org.openpatch.scratch.internal
Class BuiltinSounds
java.lang.Object
org.openpatch.scratch.internal.BuiltinSounds
Registry for the sound effects that ship inside the Scratch for Java jar.
The bundled sounds come from kenney.nl and are released under CC0, so they can be used for any purpose without attribution. They can be addressed by plain name:
sprite.addSound("footstep_carpet_000");
Every bundled sound has a unique name, so no folder has to be given. Lookup ignores case.
-
Method Summary
-
Method Details
-
get
Looks up a bundled sound.- Parameters:
name- the name of a bundled sound, without folder or extension- Returns:
- the resource path to hand to the sound loader, or null if unknown
-
contains
Checks whether a bundled sound with this name exists.- Parameters:
name- the name to look for- Returns:
- true if it exists
-
getNames
Returns every bundled sound name.- Returns:
- all available names
-
suggest
Finds bundled sound names close to what was typed, so a wrong name can be answered with "did you mean ...?".- Parameters:
name- the name that could not be foundlimit- how many suggestions to return at most- Returns:
- the closest matching names, best first
-