Wheel IDE

Online demo »

Sound, sample

Sound sample example

This example shows how to include a sound sample file in a project and play the sample.

When you upload this file to your EV3 device then the sample will also be uploaded.

Code

#project "Sound sample example"

#include "lib/modules/standard.whl"
#include "lib/modules/device.whl"
#include "lib/modules/sound.whl"

; Include the sample as resource:
#resource "resources/sounds/information/start.rsf"

#display "EV3"

proc main()
    ; Select the EV3 device in the simulator...
    selectDevice(DEVICE_EV3)

    playSample("start.rsf", 100)

    halt()
end
See also: Modules playSample