speaker

Hub's speaker

Example

var hub = serviceSPIKE.PrimeHub();
var speaker = hub.speaker;
// do something with speaker

Methods

static beep(note, seconds)

Plays a beep on the Hub.

Parameters:
Name Type Description
note integer

The MIDI note number [44 to 123 (60 is middle C note)]

seconds number

The duration of the beep in seconds

static start_beep(note)

Starts playing a beep.

Parameters:
Name Type Description
note integer

The MIDI note number [44 to 123 (60 is middle C note)]

static stop()

Stops any sound that is playing.

static get_volume() → {number}

Retrieves the value of the speaker volume.

Returns:
number -

The current volume [0 to 100]

static set_volume(newVolume)

Sets the speaker volume.

Parameters:
Name Type Description
newVolume integer