blob: 2cfe9b7ad156cf469cd664f8b03261a28002c1b1 [file] [log] [blame]
Heinrich Schuchardt3f013072022-12-04 16:16:12 +01001.. SPDX-License-Identifier: GPL-2.0+
2.. Copyright 2022, Heinrich Schuchardt <xypron.glpk@gmx.de>
3
4sound command
5=============
6
7Synopsis
8--------
9
10::
11
12 sound init
Heinrich Schuchardtea58b9a2022-12-15 16:50:39 -080013 sound play [[len freq] ...] [len [freq]]
Heinrich Schuchardt3f013072022-12-04 16:16:12 +010014
15Description
16-----------
17
Heinrich Schuchardtea58b9a2022-12-15 16:50:39 -080018The *sound* command is used to play one or multiple beep sounds.
Heinrich Schuchardt3f013072022-12-04 16:16:12 +010019
20sound init
21 initializes the sound driver.
22
23sound play
24 plays a square wave sound. It does not depend on previously calling
25 *sound init*.
26
27len
28 duration of the sound in ms, defaults to 1000 ms
29
30freq
31 frequency of the sound in Hz, defaults to 400 Hz
32
Heinrich Schuchardtea58b9a2022-12-15 16:50:39 -080033Examples
34--------
35
36Beep at 400 Hz for 1000 ms::
37
38 sound play
39
40Beep at 400 Hz for 600 ms::
41
42 sound play 600
43
44Beep at 500 Hz for 600 ms::
45
46 sound play 600 500
47
48Play melody::
49
50 sound play 500 1047 500 880 500 0 500 1047 500 880 500 0 500 784 500 698 500 784 1000 698
51
Heinrich Schuchardt3f013072022-12-04 16:16:12 +010052Configuration
53-------------
54
55The sound command is enabled by CONFIG_CMD_SOUND=y.
56
57Return value
58------------
59
60The return value $? is 0 (true) if the command succeeds, 1 (false) otherwise.