Wheel IDE

Online demo »

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_SOUND5

Module calls for playing sounds
Source: lib/modules/sound.whl, line: 13
SOUND_PLAY_TONE0
SOUND_PLAY_SAMPLE1

Tone frequencies
Source: lib/modules/sound.whl, line: 17
TONE_C4262
TONE_C4_CIS277
TONE_D4294
TONE_D4_DIS311
TONE_E4330
TONE_F4349
TONE_F4_FIS370
TONE_G4392
TONE_G4_GIS415
TONE_A4440
TONE_A4_AIS466
TONE_B4494
TONE_C5523
TONE_C5_CIS554
TONE_D5587
TONE_D5_DIS622
TONE_E5659

Procedures

playTone
Source: lib/modules/sound.whl, line: 36

Play a tone.

proc playTone(number frequency, number duration, number volume)
Parameters:
NameTypeDescription
frequencynumberThe frequency.
durationnumberThe duration in milliseconds.
volumenumberThe volume.

playSample
Source: lib/modules/sound.whl, line: 45

Play a sample.

proc playSample(string filename, number volume)
Parameters:
NameTypeDescription
filenamestringThe filename.
volumenumberThe volume.