-
Notifications
You must be signed in to change notification settings - Fork 0
MiP_Sound
Manages MiP's sounds.
Signature: constexpr uint8_t MIP_CMD_PLAY_SOUND
MiP protocol command bytes used by the sound subsystem.
Details:
These values are placed in the first byte of requests sent to the MiP (and appear in the corresponding responses). See the official MiP BLE Protocol for the complete list.
Signature: constexpr uint8_t MIP_CMD_SET_VOLUME
Signature: constexpr uint8_t MIP_CMD_GET_VOLUME
Signature: MiP_Sound(MiP &mip)
Constructs the sound manager.
Parameters:
| Parameter | Description |
|---|---|
mip |
A reference to the main MiP object to access core services. |
Signature: void beginList()
Starts a new sound list sequence.
Details:
Must be called before adding entries with addEntryToSoundList().
Signature: void addEntryToList(MiPSoundIndex sound, uint16_t delay=0, MiPVolume volume=MIP_VOLUME_DEFAULT)
Adds a sound (with optional delay and volume change) to the current sound list.
Parameters:
| Parameter | Description |
|---|---|
sound |
Sound index. |
delayTime |
Delay in milliseconds before next sound (0-7650 ms). |
volume |
Volume for this sound (or MIP_VOLUME_DEFAULT to keep previous). |
Signature: void playList(uint8_t repeatCount=0)
Plays the current sound list.
Parameters:
| Parameter | Description |
|---|---|
repeatCount |
Number of times to repeat the entire list (0 = once). |
Signature: void play(MiPSoundIndex sound, MiPVolume volume=MIP_VOLUME_DEFAULT)
Plays a single sound at the specified volume.
Details:
Convenience method that builds and plays a one-entry sound list.
Parameters:
| Parameter | Description |
|---|---|
sound |
Sound index to play. |
volume |
Volume level (default = MIP_VOLUME_DEFAULT). |
Signature: void writeVolume(uint8_t volume)
Sets the MiP speaker volume and verifies the change.
Details:
Retries automatically on failure.
Parameters:
| Parameter | Description |
|---|---|
volume |
Volume level (0-7). |
Signature: uint8_t readVolume()
Reads the current speaker volume.
Details:
Performs a verified read with retries.
Returns: Current volume (0-7), or 0 on error.
Signature: void end()
Cleans up the sound subsystem upon end.
Details:
Restores MiP's default volume.
🔗 Quick Links: Main Repository • Report an Issue • Wiki Home
An open-source API for the WowWee MiP Robot. Licensed under Apache-2.0.
- MiP
- MiPChestLED
- MiPClapSettings
- MiPDebug
- MiPHardwareInfo
- MiPHeadLEDs
- MiPIRDongleCode
- MiPSoftwareVersion
- MiPStatus
- MiP_Battery
- MiP_ChestLED
- MiP_Clap
- MiP_EEPROM
- MiP_Gesture
- MiP_HeadLEDs
- MiP_Infrared
- MiP_Mode
- MiP_Motion
- MiP_Odometer
- MiP_Position
- MiP_Radar
- MiP_Serial
- MiP_Shake
- MiP_Sound
- MiP_Version
- MiP_Weight
- MiP_WiFi