Skip to content

Commit 63d9b63

Browse files
authored
Update 536-console-sound.markdown
1 parent 10e82df commit 63d9b63

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed
Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,22 @@
11
# SOUND
22

3-
> SOUND freq, dur_ms [, vol] [BG]
3+
> SOUND freq, dur [, vol] [BG]
44
5-
Plays a sound.
5+
Plays a sound with the frequency `freg` in Hz for a duration `dur` in milliseconds. The optional parameter `vol` controls the volume of the sound. Volume is in the range from 0 to 100, where 100 is maximum volume. If the optional parameter `BG` is given, the sound will play in the background: SmallBASIC will not wait with program execution until the sound has finished.
66

7+
### Example1 : Play sound
8+
9+
```
10+
Sound 1000, 800, 50 ' 1000 Hz, 800 ms, 50% volume
11+
```
12+
13+
### Example 2: Play sound in background
14+
15+
```
16+
Sound 1000, 800, 50 BG ' 1000 Hz, 800 ms, 50% volume
17+
print "This line will be printed immediately"
18+
pause
19+
```
720

8-
* freq The frequency
9-
* dur_ms The duration in milliseconds
10-
* vol The volume in 1/100 units
11-
* BG Play it in background
1221

1322

0 commit comments

Comments
 (0)