General-Music Rhythm
Function Introduction
-
Device Music Rhythm (Local Music Rhythm) Concept: The volume signal is collected through the local microphone, and the voltage value of the signal is calculated to achieve the effect of music rhythm. Since there is no unified implementation logic for this solution, there are two local music rhythm logics for lighting. For details, please refer to. Note: If the light switch is turned on in music mode, the firmware reports the music dp, and the music status is turned on.
-
App Music Rhythm The mobile phone microphone collects audio information of external music, and the Tuya Smart App converts the audio information into time domain and frequency domain, outputs HSV, and realizes the effect of the light changing with the rhythm of the music. The App combines the control panel of the product and collects the surrounding sound through the peripherals of the mobile phone. The App capability is responsible for receiving the sound and providing it to the interface of the panel related capabilities. The panel is responsible for sending the music rhythm dp to the firmware at an interval of 300ms according to the specified mode. The device parses the control command according to the specified protocol to let the device display the corresponding color.
DP protocol
- dpCode: mic_music_data (For DP parsing details, see MicMusicTransformer)
How to develop
-
Monitor and report DP according to UI interaction
-
Going a step further, we provide extension plug-ins on Tuya MiniApp IDE to assist development. Click
Extension Managementto see `Panel IDE Lighting rhythm library extension, download and use it according to the instructions on the extension.
Notes
None
Related materials
- [Function page]:
- None
- [Component]:
- [Tutorial]:
- None
- [SDK]:
- Monitor App music pickup => onMusic2RgbChange
- Cancel App music pickup => offMusic2RgbChange
- [API]:
- None