Sound#
Introduction#
The VEX IQ (2nd generation) Brain can produce audio through its built-in speaker using blocks from the Sound category. These blocks play preloaded sound effects or musical notes.
For the examples below, the constructed Brain includes access to the Sound methods and will be used in all subsequent examples throughout this API documentation when referring to those methods.
Below is a list of all available methods:
Actions – Play sounds from the Brain.
Actions#
playSound#
playSound
plays one of the Brain’s built-in sounds.
Usage:
Brain.playSound(sound);
Parameters |
Description |
---|---|
|
The specified sound to play from the Brain. |
Sound Name |
Play Sound |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Example coming soon
playNote#
playNote
plays a musical note from the Brain.
Usage:
Brain.playNote(octave, note, duration);
Parameters |
Description |
---|---|
|
The integer that represents the octave the note is played in:
|
|
The note to play:
|
|
Optional. The duration in milliseconds to play the note for, up to a max of 500 milliseconds. If no duration is provided, the default duration is 500 milliseconds. |
// Example coming soon