VEX IQ C++ API
|
Public Member Functions | |
sound () | |
~sound () | |
void | play (noteType note, uint8_t octave=3, float duration=0.5, timeUnits units=timeUnits::sec) |
Play a musical note on the speaker. More... | |
void | play (uint8_t note, float duration=0.5, timeUnits units=timeUnits::sec) |
Play a musical note on the speaker. More... | |
void | playWave (soundType wave, bool waitForCompletion=true) |
play the wave sample More... | |
void | playMelody (const char *melody) |
Play a melody form a string in a quasi musical alphabet notiation (cdefgab) More... | |
void | setSoundEffect (uint8_t effect) |
set the sound effect type for subsequent notes played More... | |
void | setVolume (uint8_t volume) |
set the sound volume [1-4] More... | |
void | stop () |
Stop playing music. More... | |
vex::brain::sound::sound | ( | ) |
|
inline |
void vex::brain::sound::play | ( | noteType | note, |
uint8_t | octave = 3 , |
||
float | duration = 0.5 , |
||
timeUnits | units = timeUnits::sec |
||
) |
Play a musical note on the speaker.
note | musical note to play |
octave | octave of the note [1-7], optional |
duration | time. 0 to start playing without blocking. Default 0.5 |
units | of time for the duration. Default sec. |
void vex::brain::sound::play | ( | uint8_t | note, |
float | duration = 0.5 , |
||
timeUnits | units = timeUnits::sec |
||
) |
Play a musical note on the speaker.
note | musical note to play: 0=silence/stop, [1-56] numeric value |
duration | time. 0 to start playing without blocking. Default 0.5 |
units | of time for the duration. Default sec. |
void vex::brain::sound::playWave | ( | soundType | wave, |
bool | waitForCompletion = true |
||
) |
play the wave sample
wave | type of the wave sample sound to play |
waitForCompletion | wait for the sample to finish playing |
void vex::brain::sound::playMelody | ( | const char * | melody | ) |
Play a melody form a string in a quasi musical alphabet notiation (cdefgab)
melody | string [cdefgab]: musical alphabet for notes, space: pause, +/-: increase/decrease octave of following notes 0-9: set duration of following notes (in 1/8s: 1=eighth note...8 = full note) |
void vex::brain::sound::setSoundEffect | ( | uint8_t | effect | ) |
set the sound effect type for subsequent notes played
effect | effect type [0..15] |
void vex::brain::sound::setVolume | ( | uint8_t | volume | ) |
set the sound volume [1-4]
volume | value [1=low...4=high] |
void vex::brain::sound::stop | ( | ) |
Stop playing music.