File tree 2 files changed +41
-0
lines changed
2 files changed +41
-0
lines changed Original file line number Diff line number Diff line change
1
+ # Sounds
2
+
3
+ !!! note
4
+ Scratch only supports MP3 and WAV files.
5
+ Other formats will (as of now) not raise a warning or error, and the project will
6
+ refuse to load in Scratch.
7
+
8
+ You can add sounds to a sprite by specifying their file paths relative to the project
9
+ directory.
10
+
11
+ ``` goboscript
12
+ sounds "path/to/sound.mp3";
13
+ ```
14
+
15
+ ### Listing Multiple Sounds
16
+ To add multiple sounds, separate their file paths with commas. Sounds will appear in the
17
+ order you list them in the ` sounds ` statement.
18
+
19
+ ``` goboscript
20
+ sounds "path/to/sound1.mp3", "path/to/sound2.wav";
21
+ ```
22
+
23
+ Each sound's name is taken from the file name without its extension.
24
+
25
+ ### Renaming Sounds
26
+ You can rename a sound using the ` as ` keyword.
27
+
28
+ ``` goboscript
29
+ sounds "path/to/sound.mp3" as "new name";
30
+ ```
31
+
32
+ ### Using Wildcards (Globs)
33
+ You can use wildcards to include multiple sounds, such as all ` .mp3 ` files in a
34
+ directory. Use the ` * ` wildcard for this.
35
+
36
+ ``` goboscript
37
+ sounds "path/to/sounds/*.mp3";
38
+ ```
39
+
40
+ Sounds added this way are sorted alphabetically.
Original file line number Diff line number Diff line change 8
8
- Syntax : language/syntax.md
9
9
- Sprites : language/sprites.md
10
10
- Costumes : language/costumes.md
11
+ - Sounds : language/sounds.md
11
12
- Variables : language/variables.md
12
13
- Lists : language/lists.md
13
14
- Operators : language/operators.md
You can’t perform that action at this time.
0 commit comments