-
Notifications
You must be signed in to change notification settings - Fork 0
MiP_Sound
Manages MiP's sound playback, audio sequence building, and volume levels.
Signature: void beginList()
Summary: Starts a new sound list sequence.
Details:
Clears internal sequence indices and prepares the command buffer. Must be called prior to invoking addEntryToList().
Signature: void addEntryToList(MiPSoundIndex sound, uint16_t delayTime=0, MiPVolume volume=MIP_VOLUME_DEFAULT)
Summary: Adds a sound entry (with optional delay and inline volume modification) to the sequence.
Details:
Appends a sound clip to the sequence buffer. If a custom volume is specified that differs from the sequence volume, an inline volume change command is automatically injected. Up to 8 sound entries can be added per sequence.
Parameters:
| Parameter | Description |
|---|---|
sound |
Sound index to add. |
delayTime |
Delay in milliseconds before playing the next sound (0 to 7650 ms, converted to 30ms ticks). |
volume |
Inline volume for this sound, or MIP_VOLUME_DEFAULT to maintain active volume. |
Signature: void playList(uint8_t repeatCount=0)
Summary: Plays the currently assembled sound list sequence.
Details:
Pads any remaining sequence slots with mute sound codes and transmits the 18-byte play sound command to MiP over UART.
Parameters:
| Parameter | Description |
|---|---|
repeatCount |
Number of times to repeat the entire sequence (0 = play once). |
Signature: void play(MiPSoundIndex sound, MiPVolume volume=MIP_VOLUME_DEFAULT)
Summary: Plays a single sound effect at an optional volume level.
Details:
Convenience helper method that internally calls beginList(), addEntryToList(), and playList().
Parameters:
| Parameter | Description |
|---|---|
sound |
Sound index to play. |
volume |
Volume level for playback (default = MIP_VOLUME_DEFAULT). |
Signature: void writeVolume(uint8_t volume)
Summary: Sets MiP's speaker volume level and verifies the change.
Details:
Sends the set volume command and reads back the active volume level to confirm success. Automatically retries on communication failure or mismatch.
Parameters:
| Parameter | Description |
|---|---|
volume |
Speaker volume level (0 = mute to 7 = maximum volume). |
Signature: uint8_t readVolume()
Summary: Reads the current speaker volume level from MiP.
Details:
Performs a verified read query with automatic retries on communication failure.
Returns: uint8_t Current speaker volume level (0-7), or 0 on error.
Signature: void end()
Summary: Cleans up the sound subsystem when ending communication.
Details:
Restores MiP's default speaker volume (level 7).
🔗 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