blob: 97d610f3745c468118752212776ee3498e5e466a [file] [log] [blame]
Heinrich Schuchardtce2f0c62022-12-04 16:16:12 +01001.. SPDX-License-Identifier: GPL-2.0+
2.. Copyright 2022, Heinrich Schuchardt <xypron.glpk@gmx.de>
3
Heinrich Schuchardt1b0c3162024-01-14 14:53:13 +01004.. index::
5 single: sound (command)
6
Heinrich Schuchardtce2f0c62022-12-04 16:16:12 +01007sound command
8=============
9
10Synopsis
11--------
12
13::
14
15 sound init
Heinrich Schuchardtd5f527a2022-12-15 16:50:39 -080016 sound play [[len freq] ...] [len [freq]]
Heinrich Schuchardtce2f0c62022-12-04 16:16:12 +010017
18Description
19-----------
20
Heinrich Schuchardtd5f527a2022-12-15 16:50:39 -080021The *sound* command is used to play one or multiple beep sounds.
Heinrich Schuchardtce2f0c62022-12-04 16:16:12 +010022
23sound init
24 initializes the sound driver.
25
26sound play
27 plays a square wave sound. It does not depend on previously calling
28 *sound init*.
29
30len
31 duration of the sound in ms, defaults to 1000 ms
32
33freq
34 frequency of the sound in Hz, defaults to 400 Hz
35
Heinrich Schuchardtd5f527a2022-12-15 16:50:39 -080036Examples
37--------
38
39Beep at 400 Hz for 1000 ms::
40
41 sound play
42
43Beep at 400 Hz for 600 ms::
44
45 sound play 600
46
47Beep at 500 Hz for 600 ms::
48
49 sound play 600 500
50
51Play melody::
52
53 sound play 500 1047 500 880 500 0 500 1047 500 880 500 0 500 784 500 698 500 784 1000 698
54
Heinrich Schuchardtce2f0c62022-12-04 16:16:12 +010055Configuration
56-------------
57
58The sound command is enabled by CONFIG_CMD_SOUND=y.
59
60Return value
61------------
62
63The return value $? is 0 (true) if the command succeeds, 1 (false) otherwise.