vex.brain.sound package¶
Brain Sound Speaker.
- class vex.brain.sound.BrainSound[source]¶
Bases:
SingletonDeviceBrain Sound.
ROBOT MESH PYTHON B:
robotmesh.com/studio/content/docs/vexiq-python_b/html/classvex_1_1_brain_sound.html
- play(note: NoteType, octave: int = 3, duration: float = 0.5, timeUnits: TimeUnits = TimeUnits.SEC)[source]¶
Play note/sound on Brain Sound Speaker.
ROBOT MESH PYTHON B:
Play a musical note on the speaker.
Parameters: - note: musical note to play: NoteType enum value - octave: octave of the note [1-7], optional - duration: time. 0 to start playing without blocking. Default 0.5 - timeUnits: of time for the duration. Default sec.
- play_melody(melody: str)[source]¶
Play musical melody.
ROBOT MESH PYTHON B:
Play a melody form a string in a quasi musical alphabet notation.
(cdefgab)
Parameters: - 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)
- play_raw(note: NoteType, duration: float = 0.5, timeUnits: TimeUnits = TimeUnits.SEC)[source]¶
Play note/sound on Brain Sound Speaker.
ROBOT MESH PYTHON B:
Play a musical note on the speaker.
Parameters - note: musical note to play: 0=silence/stop, [1-56] numeric value - duration: time. 0 to start playing without blocking. Default 0.5 - timeUnits: of time for the duration. Default sec.
- play_wave(waveType: int, waitForCompletion: bool = True)[source]¶
Play WAV.
ROBOT MESH PYTHON B:
Play the wave sample.
Parameters: - waveType: type of the wave sample sound to play [0..15] - waitForCompletion: wait for the sample to finish playing
- set_sound_effect(effect: int)[source]¶
Set Sound Effect.
ROBOT MESH PYTHON B:
Set the sound effect type for subsequent notes played.
Parameters - effect: effect type [0..15]
- class vex.brain.sound.NoteType(value)[source]¶
Bases:
IntEnumMusical Note.
ROBOT MESH PYTHON B:
Musical note to play.
robotmesh.com/studio/content/docs/vexiq-python_b/html/classvex_1_1_note_type.html
- A: int = 6¶
- B: int = 7¶
- C: int = 1¶
- D: int = 2¶
- E: int = 3¶
- F: int = 4¶
- G: int = 5¶
- silence: int = 0¶
- class vex.brain.sound.SoundType(value)[source]¶
Bases:
EnumSound Effect.
VEXCODE PYTHON:
Sound Effect
- ALARM = 8¶
- ALARM2 = 15¶
- DOOR_CLOSE = 10¶
- FILLUP = 4¶
- HEADLIGHTS_OFF = 6¶
- HEADLIGHTS_ON = 5¶
- POWER_DOWN = 16¶
- RATCHET = 11¶
- RATCHET2 = 14¶
- SIREN = 1¶
- SIREN2 = 13¶
- TADA = 9¶
- TOLLBOOTH = 7¶
- WRENCH = 12¶
- WRONG_WAY = 2¶
- WRONG_WAY_SLOW = 3¶