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