Sound
This file contains procedures to play samples and tones on the EV3 device.
Constants
The sound module.
Source: lib/modules/sound.whl, line: 10
Module calls for playing sounds
Source: lib/modules/sound.whl, line: 13
| SOUND_PLAY_TONE | 0 |
| SOUND_PLAY_SAMPLE | 1 |
Tone frequencies
Source: lib/modules/sound.whl, line: 17
| TONE_C4 | 262 |
| TONE_C4_CIS | 277 |
| TONE_D4 | 294 |
| TONE_D4_DIS | 311 |
| TONE_E4 | 330 |
| TONE_F4 | 349 |
| TONE_F4_FIS | 370 |
| TONE_G4 | 392 |
| TONE_G4_GIS | 415 |
| TONE_A4 | 440 |
| TONE_A4_AIS | 466 |
| TONE_B4 | 494 |
| TONE_C5 | 523 |
| TONE_C5_CIS | 554 |
| TONE_D5 | 587 |
| TONE_D5_DIS | 622 |
| TONE_E5 | 659 |
Procedures
playTone
Source: lib/modules/sound.whl, line: 36
Play a tone.
proc playTone(number frequency, number duration, number volume)
Parameters:
| Name | Type | Description |
| frequency | number | The frequency. |
| duration | number | The duration in milliseconds. |
| volume | number | The volume. |
playSample
Source: lib/modules/sound.whl, line: 45
Play a sample.
proc playSample(string filename, number volume)
Parameters:
| Name | Type | Description |
| filename | string | The filename. |
| volume | number | The volume. |