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