Control method of light emitting device and related device
By calculating the frequency and energy difference of audio clips, determining the rhythm points and controlling the lighting effects of light-emitting devices, the problem of combining light-emitting devices with audio data is solved, rich lighting synchronization changes are achieved, and the user experience is improved.
Patent Information
- Application Number
- CN202111421695.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-26
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2041-11-26
AI Technical Summary
In the prior art, the control method of the light-emitting device is difficult to effectively combine with audio data, and it is impossible to synchronize the lighting effects according to the audio rhythm points.
By calculating the frequency difference and audio energy difference between the target audio clip and the reference audio clip, it is determined whether the audio clip contains rhythmic points, and the lighting effects of the light-emitting device are controlled according to these differences, including changes in brightness, color, and amount.
The light-emitting devices can be synchronized with the rhythm of the audio, providing rich lighting effects and enhancing the user's visual and auditory experience.
Smart Images

Figure CN116189639B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of smart home technology, and more specifically, to a control method for a light-emitting device and related devices. Background Art
[0002] Lighting devices, such as lamp posts and light strips, are widely used to create lighting atmospheres or present a variety of equivalent scenes. With the development of smart home technology, users have also placed higher demands on lighting devices, and they expect to be able to control lighting devices in conjunction with audio data.
[0003] Therefore, how to control the light-emitting device in combination with audio data is a technical problem that needs to be solved urgently in the existing technology. Summary of the Invention
[0004] In view of the above problems, embodiments of the present application provide a control method for a light-emitting device and related devices to improve the above problems.
[0005] According to one aspect of an embodiment of the present application, a method for controlling a light-emitting device is provided, including: obtaining a target audio segment; determining a first target audio frame having a maximum audio energy value in the target audio segment; calculating a frequency difference between the first target audio frame and a second target audio frame; the second target audio frame refers to an audio frame having a maximum audio energy value in a reference audio segment, and the reference audio segment includes at least one historical audio segment of the target audio segment; calculating the audio energy difference between the target audio segment and the reference audio segment; determining whether the target audio segment has a rhythm point based on the frequency difference and the audio energy difference; if it is determined that the target audio segment has a rhythm point, controlling the light-emitting device to emit light based on the target audio segment.
[0006] According to one aspect of an embodiment of the present application, a light-emitting device is provided, including a controller and a light-emitting module, wherein the light-emitting module is electrically connected to the controller, and the controller is used to control the light-emitting module to emit light according to the method described above.
[0007] According to one aspect of an embodiment of the present application, a control device for a light-emitting device is provided, including: an acquisition module for acquiring a target audio segment; a first target audio frame determination module for determining a first target audio frame having a maximum audio energy value in the target audio segment; a frequency difference calculation module for calculating a frequency difference between the first target audio frame and a second target audio frame; the second target audio frame refers to an audio frame having a maximum audio energy value in a reference audio segment, and the reference audio segment includes at least one historical audio segment before the target audio segment; an audio energy difference calculation module for calculating an audio energy difference between the target audio segment and the reference audio segment; a rhythm point determination module for determining whether the target audio segment has a rhythm point based on the frequency difference and the audio energy difference; and a control module for controlling the light-emitting device to emit light according to the target audio segment if the target audio segment is determined to be a rhythm point.
[0008] In some embodiments, the rhythm point determination module includes: a rhythm point determination unit, configured to determine that a rhythm point exists in the target audio segment if the absolute value of the frequency difference is greater than a first threshold and the audio energy difference is greater than a second threshold.
[0009] In some embodiments, the reference audio segment includes a first historical audio segment, where the first historical audio segment is a previous historical audio segment of the target audio segment.
[0010] In some embodiments, the audio energy difference calculation module includes: a first acquisition unit, used to obtain the short-time energy mean of the target audio segment; a second acquisition unit, used to obtain the short-time energy mean of the reference audio segment; and a subtraction unit, used to subtract the short-time energy mean of the target audio segment from the short-time energy mean of the reference audio segment to obtain the audio energy difference.
[0011] In some embodiments, the control device for the light-emitting device further includes: a first determination module configured to determine whether the absolute value of the frequency difference is greater than a first threshold; and a target audio segment determination module configured to, if the absolute value of the frequency difference is not greater than the first threshold, select the next sampled audio segment as the target audio segment. If the absolute value of the frequency difference is greater than the first threshold, the process proceeds to the audio energy difference calculation module.
[0012] In some embodiments, the control module includes: an audio energy acquisition unit for acquiring the audio energy of the target audio segment; a lighting effect control signal determination unit for determining the lighting effect control signal corresponding to the audio energy of the target audio segment based on a mapping relationship between audio energy and the lighting effect control signal; and a control unit for controlling the light-emitting device to emit light based on the lighting effect control signal corresponding to the audio energy of the target audio segment.
[0013] In some embodiments, the lighting effect control signal includes at least one of a brightness control signal, a light color control signal, and a light quantity control signal.
[0014] In some embodiments, the control device of the light-emitting device also includes: a music recognition result, which is used to perform music recognition on the target audio segment to obtain a music recognition result; if the music recognition result indicates that the target audio segment is music data, it goes to the first target audio frame determination module.
[0015] According to one aspect of an embodiment of the present application, an electronic device is provided, comprising: a processor; and a memory, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the control method of the light-emitting device as described above is implemented.
[0016] According to one aspect of an embodiment of the present application, a computer-readable storage medium is provided, on which computer-readable instructions are stored. When the computer-readable instructions are executed by a processor, the control method of the light-emitting device as described above is implemented.
[0017] In the scheme of the present application, at least one historical audio segment corresponding to the target audio segment is used as a reference audio segment, and the frequency difference is determined by combining the frequency of the first target audio frame with the largest audio energy value in the target audio segment and the frequency of the second target audio frame with the largest audio energy value in the reference audio segment; and the audio energy difference is determined by combining the audio energy of the target audio segment and the audio energy of the reference audio segment, and then the frequency difference and the audio energy difference are used to determine whether the target audio segment has a rhythm point, and when it is determined that the target audio segment has a rhythm point, the light-emitting device is controlled to emit light according to the target audio segment, so that the light-emitting device can switch its light emission according to the rhythm points in the audio, presenting rich lighting effects; and the control of the light-emitting device in combination with audio is effectively realized. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The accompanying drawings are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and those skilled in the art can derive other drawings based on these drawings without inventive effort.
[0019] Figure 1 FIG. 4 is a flowchart of a method for controlling a light emitting device according to an embodiment of the present application.
[0020] Figure 2 FIG. 1 is a flow chart showing step 140 according to an embodiment of the present application.
[0021] Figure 3 FIG. 1 is a flowchart of step 160 according to an embodiment of the present application.
[0022] Figure 4 is a flowchart of a method for controlling a light-emitting device according to another embodiment of the present application.
[0023] Figure 5 is a block diagram of a light-emitting device according to an embodiment of the present application.
[0024] Figure 6 FIG. 4 is a block diagram of a control device for a light emitting device according to an embodiment of the present application.
[0025] Figure 7 is a block diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0026] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this application will be thorough and complete and will fully convey the concepts of the example embodiments to those skilled in the art.
[0027] In addition, described feature, structure or characteristic can be combined in one or more embodiments in any suitable manner.In the following description, many specific details are provided so as to provide a full understanding of the embodiments of the present application. However, it will be appreciated by those skilled in the art that the technical scheme of the present application can be put into practice without one or more of the specific details, or other methods, components, devices, steps etc. can be adopted. In other cases, known methods, devices, implementations or operations are not shown or described in detail to avoid blurring the various aspects of the application.
[0028] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically separate entities. That is, these functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0029] The flowcharts shown in the accompanying drawings are for illustrative purposes only and do not necessarily include all contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may be decomposed, while others may be combined or partially combined. Therefore, the actual execution order may vary depending on the actual situation.
[0030] It should be noted that the term "plurality" used in this document refers to two or more. "And / or" describes a relationship between associated objects, indicating that three possible relationships exist. For example, "A and / or B" can represent: A alone, A and B together, or B alone. The character " / " generally indicates an "or" relationship between the associated objects.
[0031] The following is a detailed description of the implementation details of the technical solution of the embodiment of the present application:
[0032] Figure 1 This is a flow chart of a control method for a light-emitting device according to an embodiment of the present application. The method can be executed by an electronic device with processing capabilities. The electronic device can be a light-emitting device provided with a light-emitting module, wherein one or more light-emitting modules can be provided on the light-emitting device, and the light-emitting modules can be, for example, LED lamps, RGBIC lamp beads, incandescent lamps, etc., which are not specifically limited here. The light-emitting device can be an ambient lighting device, a lamp post, a light strip, an LED light board, or other device with a light-emitting function. In some embodiments, the electronic device can also be a device that is communicatively connected to the light-emitting device. For example, in a smart home system, the electronic device can be a gateway that is communicatively connected to the light-emitting device, etc. Of course, the electronic device can also be other devices with edge computing capabilities in the smart home system, which are not specifically limited here.
[0033] For users, when the frequency in the audio changes suddenly or the audio energy in the audio suddenly increases, the user's perception is very strong. Therefore, the position where the audio energy suddenly increases and the frequency suddenly changes in the audio can be determined as the rhythm point in the audio.
[0034] In this solution, the frequency difference between the first target audio frame in the target audio segment and the second target audio frame in the reference audio segment is calculated in order to determine whether the target audio segment is a position with a larger frequency change amplitude in the audio relative to the reference audio segment; the audio energy difference between the target audio segment and the reference audio segment is calculated in order to determine the increase amplitude of the audio energy of the target audio segment relative to the reference audio segment, and further determine whether the target audio segment is a position where the audio energy suddenly increases in the audio; thus, the frequency difference and the audio energy difference are combined to comprehensively determine whether there is a rhythm point in the target audio segment; and further, when it is determined to be a rhythm point, the light-emitting device is controlled to emit light, so as to achieve the effect of the light-emitting device switching the lighting effect according to the rhythm point in the audio, providing richer lighting effects. In a specific embodiment, the lighting effect switching can be at least one of brightness switching, light-emitting module switching, and light color switching.
[0035] See Figure 1 As shown, the method includes at least steps 110 to 160, which are detailed as follows:
[0036] Step 110: Obtain the target audio segment.
[0037] In some embodiments, the audio data is sampled according to a set sampling frequency, and an audio frame is obtained by sampling once. A first set number of audio frames obtained by sequential sampling can be used as an audio segment. The first set number can be set according to actual needs. For example, the first set number can be 256, 512, etc.
[0038] The target audio segment refers to an audio segment for which it is to be determined whether a rhythm point exists, and the target audio segment includes at least one audio frame. In a specific embodiment, the target audio segment may be an audio segment currently sampled.
[0039] Step 120: Determine a first target audio frame having a maximum audio energy value in the target audio segment.
[0040] The first target audio frame refers to the audio frame with the highest audio energy value in the target audio segment. An audio frame is sampled at a specific moment and has a very short duration. Its energy value can be represented by its amplitude. Based on this, the audio frame with the highest amplitude in the target audio segment can be determined as the first audio frame.
[0041] Step 130 : Calculate the frequency difference between the first target audio frame and a second target audio frame; the second target audio frame is an audio frame having the maximum audio energy value in a reference audio segment, and the reference audio segment includes at least one historical audio segment before the target audio segment.
[0042] Step 140: Calculate the audio energy difference between the target audio segment and the reference audio segment.
[0043] Similar to the first target audio frame, the audio frame with the largest amplitude in the reference audio segment can be determined as the second target audio frame.
[0044] The reference audio clip can be one or more. For example, you can select a single historical audio clip that precedes the target audio clip as the reference audio clip, or you can select two or more historical audio clips that precede the target audio clip as the reference audio clip. The historical audio clips that precede the target audio clip are those that were sampled earlier than the target audio clip.
[0045] In other words, the reference audio clips can be one or more audio clips whose sampling time precedes the target audio clip and whose sampling time falls within the set time range from the target audio clip. It will be appreciated that the audio clips are sorted in descending order of sampling time, and the reference audio clips can be historical audio clips that are directly adjacent to the target audio clip, or historical audio clips that are not directly adjacent to the target audio clip.
[0046] In some embodiments, in order to ensure the accuracy of rhythm point determination, a second set number of audio clips whose sampling time is earlier than the target audio clip and whose sampling time is closest to the target audio clip can be used as reference audio clips. The second set number can be set according to actual needs and is not specifically limited here.
[0047] For example, if audio segment I, audio segment II, audio segment III, and audio segment IV are sampled in sequence, and audio segment IV is used as the target audio segment, if there is one reference audio segment, then audio segment III can be used as the reference audio segment; if there are two reference audio segments, then audio segment III and audio segment II can be used as reference audio segments.
[0048] As described above, in the present application's solution, the purpose of calculating the frequency difference between the first target audio frame and the second target audio frame is to determine whether the target audio segment undergoes a sudden and significant frequency change relative to the reference audio segment. Therefore, to ensure the accuracy of the determination, multiple historical audio segments preceding the target audio segment can be selected as reference audio segments. It will be appreciated that when there are multiple reference audio segments, multiple second target audio frames are also determined. Specifically, the audio frame with the maximum audio energy value within each reference audio segment is selected as the second target audio frame.
[0049] Based on this, the frequency difference between the first target audio frame and the second target audio frame in each reference audio segment is calculated. If the absolute value of each frequency difference is greater than a first threshold, it indicates that the target audio segment has a significant frequency change relative to the previous audio segment. In the solution of the present application, a significant frequency change can be a significant increase in frequency or a significant decrease in frequency.
[0050] In some embodiments, the reference audio segment includes a first historical audio segment, where the first historical audio segment refers to the previous audio segment adjacent to the target audio segment; thus, the frequency difference between the first target audio frame and the second target audio frame in the first historical audio segment can be calculated.
[0051] In some embodiments, the reference audio segment may include a first historical audio segment and a second historical audio segment, wherein the second historical audio segment refers to the previous audio segment adjacent to the first historical audio segment. Based on this, the frequency difference between the first target audio frame and the second target audio frame in the first historical audio segment (assuming frequency difference A1) can be calculated, and the frequency difference between the first target audio frame and the second target audio frame in the second historical audio segment (assuming frequency difference A2) can be calculated. Assuming that the absolute value of frequency difference A1 and the absolute value of frequency difference A2 are both greater than a first threshold, it can be determined that the frequency change amplitude of the target audio segment relative to the adjacent historical audio segment is large.
[0052] In other embodiments, the historical audio segments corresponding to the target audio segment include a first historical audio segment and a second historical audio segment, where the first historical audio segment refers to the previous audio segment adjacent to the target audio segment; and the second historical audio segment refers to the previous audio segment adjacent to the first historical audio segment. In order to determine the frequency change amplitude of the target audio segment relative to the adjacent historical audio segment, a first frequency difference between the frequency of the first target audio frame and the frequency of the second target audio frame in the first historical audio segment can also be calculated; and a second frequency difference between the frequency of the second target audio frame in the first historical audio segment and the frequency of the second target audio frame in the second historical audio segment can be calculated. Then, the first frequency difference is subtracted from the second frequency difference. If the obtained difference is greater than a set threshold (for example, the first threshold, which can also be other thresholds), it can be determined that the frequency change amplitude of the target audio segment relative to the adjacent historical audio segment is larger.
[0053] As described above, the purpose of calculating the energy difference between the target audio segment and the reference audio segment is to determine whether the target audio segment is an audio segment with a larger energy increase relative to the adjacent historical audio segments.
[0054] Similarly, when there is only one reference audio segment, if the energy difference between the target audio segment and the reference audio segment is greater than a set threshold (e.g., a second threshold), it can be determined that the target audio segment is an audio segment with a larger increase in audio energy relative to the reference audio segment.
[0055] When there are multiple reference audio clips, the energy difference between the target audio clip and each reference audio clip can be calculated separately. If the energy difference between the target audio clip and each reference audio clip is greater than the second threshold, it can be determined that the target audio clip is an audio clip with a larger increase in audio energy relative to the reference audio clip.
[0056] In some embodiments, if the reference audio segment includes a first historical audio segment and a second historical audio segment, the audio energy difference between the target audio segment and the first historical audio segment (for ease of distinction, it is assumed to be the audio energy difference B1) can be calculated, as well as the audio energy difference between the first historical audio segment and the second historical audio segment (it is assumed to be the audio energy difference B2) can be calculated, and then the audio energy difference B1 is subtracted from the audio energy difference B2 to obtain the target difference. If the target difference is greater than a set threshold (for example, the second threshold), it can be determined that the audio energy of the target audio segment has increased significantly relative to the adjacent historical audio segment.
[0057] In some embodiments, the reference audio segment includes a first historical audio segment, where the first historical audio segment refers to the previous audio segment of the target audio segment; in this embodiment, Figure 2 As shown, step 140 includes:
[0058] Step 210: Obtain the short-time energy mean of the target audio segment.
[0059] Step 220: Obtain the short-time energy mean of the reference audio segment.
[0060] Step 230: Subtract the short-time energy mean of the target audio segment from the short-time energy mean of the reference audio segment to obtain the audio energy difference.
[0061] In this embodiment, the audio energy of the audio segment is characterized by the short-time energy mean. In a specific embodiment, the short-time energy mean of the audio segment can be determined by performing a short-time Fourier transform (STFT) on the audio segment.
[0062] In other embodiments, the audio energy of an audio segment may be represented by a short-time average amplitude. Thus, the short-time average amplitude of the target audio segment may be subtracted from the short-time average amplitude of the reference audio segment to obtain an audio energy difference.
[0063] Please continue reading Figure 1 , step 150, determining whether the target audio segment has a rhythm point according to the frequency difference and the audio energy difference.
[0064] As described above, this scheme is to determine whether the frequency change amplitude of the target audio segment is larger than that of the adjacent historical audio segment and the audio energy increase is larger. Therefore, it can be judged by the frequency difference and the audio energy difference. If it is determined that the frequency change amplitude of the target audio segment is larger than that of the adjacent historical audio segment and the audio energy increase is larger, then it is determined that there is a rhythm point in the target audio segment; otherwise, it is determined that there is no rhythm point in the target audio segment.
[0065] In some embodiments, step 150 includes: if the absolute value of the frequency difference is greater than a first threshold and the audio energy difference is greater than a second threshold, determining that the target audio segment contains a rhythmic point. Conversely, if the absolute value of the frequency difference is not greater than the first threshold and / or the audio energy difference is not greater than the second threshold, determining that the target audio segment does not contain a rhythmic point. The second threshold can be a non-negative number, such as a positive number. The values of the first and second thresholds can be set according to actual needs and are not specifically limited here.
[0066] Please continue reading Figure 1 In step 160 , if it is determined that the target audio segment has a rhythm point, the light emitting device is controlled to emit light according to the target audio segment.
[0067] In some embodiments, at least one of the brightness, number of lights, area of lights, and color of lights at the rhythm point can be set. Thus, after determining that a rhythm point exists in the target audio clip, the light-emitting device is controlled to emit light according to at least one of the brightness, number of lights, area of lights, and color of lights at the rhythm point.
[0068] In some embodiments, a lighting effect scene can be set for rhythm points. This lighting effect scene can be dynamic or static, such as presenting a set screen. Of course, this lighting effect scene is achieved by comprehensively controlling the lighting color, brightness, lighting area, and number of lighting units. Based on this, when a rhythm point is determined in the target audio clip, the lighting device is controlled to emit light according to the equivalent control signal corresponding to the set lighting effect scene.
[0069] In some embodiments, as Figure 3 As shown, step 160 includes:
[0070] Step 310: Acquire the audio energy of the target audio segment. The audio energy may be the short-term energy mean as described above.
[0071] Step 320 : Determine the lighting effect control signal corresponding to the audio energy of the target audio segment according to the mapping relationship between the audio energy and the lighting effect control signal.
[0072] Step 330 : Control the light-emitting device to emit light according to the light-effect control signal corresponding to the audio energy of the target audio segment.
[0073] In this embodiment, the mapping relationship between audio energy (for example, short-time energy mean) and the equivalent control signal can be set by cosine, so that after determining the audio energy of the target audio segment, the equivalent control signal corresponding to the audio energy of the target audio segment can be determined.
[0074] In some embodiments, the lighting effect control signal includes at least one of a brightness control signal, a light color control signal, and a light quantity control signal. The brightness control signal indicates the brightness of the light, the light color control signal indicates the light color, and the light quantity control signal indicates the number of lights. Alternatively, the light quantity control signal indicates the number of light modules that need to emit light.
[0075] In some embodiments, the correspondence between audio energy and lighting effect control signals can be pre-set. Specifically, the correspondence between the audio energy range and the equivalent control signal can be set. For example, if the lighting effect control signal is a brightness control signal, the correspondence between the audio energy range (assuming it is a short-term energy average range) and the brightness value can be set. The correspondence can be shown in Table 1 below:
[0076] Table 1
[0077] Short-term energy mean range Brightness value (W1, W2] K1 (W2, W3] K2 ....... ...... (Wn-1,Wn] Kn-1
[0078] Based on the correspondence between the short-time energy mean range and the brightness value shown in Table 1, the target audio segment is determined to be a rhythm point, and the short-time energy mean of the target audio segment is within the range of (W2, W3], then the brightness control signal corresponding to the audio energy of the target audio segment is determined to be a control signal indicating that the brightness value is K2.
[0079] Similarly, it is also possible to set a correspondence between audio energy and luminous color, or a correspondence between audio energy and the number of lights on, or a correspondence between audio energy and a lighting effect scene. Thus, after determining that the target audio clip is a rhythm point, the lighting device can be controlled accordingly. It is understandable that a lighting effect scene can be defined by combining one or more of the on and off of the light module, the brightness of the light module, and the light color of the light module. Therefore, the control signal corresponding to the presentation of a lighting effect scene can be pre-set. Then, after determining the equivalent scene corresponding to the audio energy of the target audio clip, the control signal associated with the equivalent scene is obtained as the corresponding equivalent control signal.
[0080] In the scheme of the present application, at least one historical audio segment of the target audio segment is used as a reference audio segment, and the frequency difference between the first target audio frame with the largest audio energy value in the target audio segment and the second target audio frame with the largest audio energy value in the reference audio segment is calculated, and the audio energy difference between the target audio segment and the reference audio segment is calculated. Then, based on the frequency difference and the audio energy difference, it is judged whether there is a rhythm point in the target audio segment. When it is determined that there is a rhythm point in the target audio segment, the light-emitting device is controlled to emit light according to the target audio segment. This can realize the light-emitting device switching with the rhythm points in the audio, presenting rich lighting effects; and effectively realizes the control of the light-emitting device in combination with audio.
[0081] As described above, users have a stronger perception of the locations in the audio where the frequency changes greatly and the audio energy suddenly increases. This solution combines the frequency difference and the audio energy difference to accurately determine whether a certain audio segment in the audio is a location where the frequency changes greatly and the audio energy suddenly increases. Therefore, the audio segment with a large frequency change and a sudden increase in audio energy in the audio is determined as a rhythm point, thereby creating an audio-visual scene for users in which the lighting effects are coordinated with the visual and auditory changes of the rhythm points in the audio, thereby improving the user experience.
[0082] In some embodiments, the duration of the lighting effect presentation can also be set. After determining that there is a rhythm point in the target audio segment, the corresponding lighting effect scene is presented according to the lighting effect control signal corresponding to the audio energy corresponding to the target audio segment. When the presentation time of the lighting effect scene reaches the set lighting effect presentation duration, the light-emitting device is controlled to stop presenting the lighting effect scene, or the light-emitting device is controlled to be extinguished, or the light-emitting device is controlled to emit light according to the set control signal.
[0083] In some embodiments, if it is determined that the target audio segment is not a rhythm point, the current lighting state of each light-emitting module in the light-emitting device can be kept unchanged, or the light-emitting device can be controlled to emit light according to a set control signal, so that the lighting state of the light-emitting device is different at rhythm points and non-rhythm points.
[0084] Figure 4 FIG. 1 is a flow chart of a method for controlling a light emitting device according to another embodiment of the present application. Figure 4 As shown, compared with Figure 1 In a corresponding embodiment, in this embodiment, before step 140, the method further includes:
[0085] Step 131: Determine whether the absolute value of the frequency difference is greater than a first threshold.
[0086] If the frequency increase is determined to be no less than the first threshold, step 140 is executed. Thereafter, step 150 includes the following steps: step 151, determining whether the audio energy difference is greater than a second threshold; if the audio energy difference is determined to be greater than the second threshold, determining that a rhythm point exists in the target audio segment, and then executing step 160; if the audio energy difference is determined to be no greater than the second threshold, step 170 is executed, using the next sampled audio segment as the target audio segment, and then returning to step 110. If the absolute value of the frequency difference is determined to be no greater than the first threshold, step 170 is executed, and then the process returns to step 110.
[0087] In this embodiment, before step 140, it is first determined whether the absolute value of the frequency difference is greater than a first threshold. If it is not greater than the first threshold, there is no need to perform the step of calculating the audio energy difference in step 140. Thus, invalid processing can be avoided, saving processor processing resources.
[0088] In other embodiments, step 130 may be performed first, and then a determination is made as to whether the audio energy difference is greater than a second threshold. If so, step 140 is performed; if not, step 170 is performed. After step 140, a determination is made as to whether the absolute value of the frequency difference is greater than a first threshold. If so, a determination is made that a rhythm point exists in the target audio segment, and step 160 is performed. Otherwise, if the absolute value of the frequency difference is not greater than the first threshold, step 170 is performed.
[0089] In some embodiments, before step 120, the method further includes: performing music recognition on the target audio segment to obtain a music recognition result; if the music recognition result indicates that the target audio segment is music data, executing the step of determining the first target audio frame with the largest audio energy value in the target audio segment.
[0090] The music recognition result indicates whether the target audio clip is music data. If so, subsequent steps 120 and other steps are executed. Conversely, if the music recognition result indicates that the target audio clip is not music data, subsequent steps 120-160 are not executed. Compared to music, other audio data (such as speech (conversational audio)) is not as pleasant to the ear as music. In this solution, music recognition is performed first, followed by rhythm determination. This ensures that the light-emitting device switches its light emission according to the rhythm of the music data, ensuring a good listening experience for the user.
[0091] In some embodiments, since the target audio segment may be mixed with noise, after step 110, the target audio segment may be first denoised, and then steps 120 and 140 may be performed after the denoising process. Since the noise in the target audio segment is filtered out or reduced, the influence of the noise on the determination of the frequency change trend and the determination of the audio energy change trend can be reduced, thereby improving the accuracy of the determined frequency change trend and the audio energy change trend, and further ensuring the accuracy of the rhythm point determination.
[0092] The present application also provides a light emitting device, such as Figure 5 As shown, the light emitting device includes a controller 510 and a light emitting module 520. The light emitting module 520 is electrically connected to the controller 510. The controller 510 is used to control the light emitting module to emit light according to the method in any of the above embodiments. Figure 5 Two light-emitting modules are exemplarily shown in the figure. In other embodiments, the number of light-emitting modules provided in the light-emitting device can also be other numbers, which is not specifically limited here.
[0093] The following describes an embodiment of the device of the present application, which can be used to perform the method described in the above embodiment of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the above method embodiment of the present application.
[0094] Figure 6 FIG. 1 is a block diagram of a control device for a light emitting device according to an embodiment. Figure 6 As shown, the control device of the light-emitting device includes: an acquisition module 610, used to acquire a target audio segment; a first target audio frame determination module 620, used to determine a first target audio frame with the largest audio energy value in the target audio segment; a frequency difference calculation module 630, used to calculate the frequency difference between the first target audio frame and a second target audio frame; the second target audio frame refers to an audio frame with the largest audio energy value in a reference audio segment, and the reference audio segment includes at least one historical audio segment before the target audio segment; an audio energy difference calculation module 640, used to calculate the audio energy difference between the target audio segment and the reference audio segment; a rhythm point determination module 650, used to determine whether the target audio segment has a rhythm point based on the frequency difference and the audio energy difference; and a control module 660, used to control the light-emitting device to emit light according to the target audio segment if it is determined that the target audio segment has a rhythm point.
[0095] In some embodiments, the rhythm point determination module includes: a rhythm point determination unit, configured to determine that a rhythm point exists in the target audio segment if the absolute value of the frequency difference is greater than a first threshold and the audio energy difference is greater than a second threshold.
[0096] In some embodiments, the historical audio segment corresponding to the target audio segment includes a first historical audio segment, where the first historical audio segment refers to a previous historical audio segment of the target audio segment.
[0097] In some embodiments, the audio energy difference calculation module 640 includes: a first acquisition unit, used to obtain the short-time energy mean of the target audio segment; a second acquisition unit, used to obtain the short-time energy mean of the reference audio segment; and a subtraction unit, used to subtract the short-time energy mean of the target audio segment from the short-time energy mean of the reference audio segment to obtain the audio energy difference.
[0098] In some embodiments, the control device for the light-emitting device further includes: a first determination module configured to determine whether the absolute value of the frequency difference is greater than a first threshold; and a target audio segment determination module configured to, if the absolute value of the frequency difference is not greater than the first threshold, select the next sampled audio segment as the target audio segment. If the absolute value of the frequency difference is greater than the first threshold, the process proceeds to the audio energy difference calculation module.
[0099] In some embodiments, the control module includes: an audio energy acquisition unit for acquiring the audio energy of the target audio segment; a lighting effect control signal determination unit for determining the lighting effect control signal corresponding to the audio energy of the target audio segment based on a mapping relationship between audio energy and the lighting effect control signal; and a control unit for controlling the light-emitting device to emit light based on the lighting effect control signal corresponding to the audio energy of the target audio segment.
[0100] In some embodiments, the lighting effect control signal includes at least one of a brightness control signal, a light color control signal, and a light quantity control signal.
[0101] In some embodiments, the control device of the light-emitting device also includes: a music recognition result, which is used to perform music recognition on the target audio segment to obtain a music recognition result; if the music recognition result indicates that the target audio segment is music data, it goes to the first target audio frame determination module.
[0102] An embodiment of the present application further provides an electronic device, such as Figure 7 As shown, the electronic device includes: a processor 710 and a memory 720, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor 710, the control method of the light-emitting device in any of the above embodiments is implemented.
[0103] The processor 710 may include one or more processing cores. The processor 710 utilizes various interfaces and circuits to connect various components within the electronic device 700. It executes instructions, programs, code sets, or instruction sets stored in the memory 720, as well as accesses data stored in the memory 720, to perform various functions and process data within the electronic device 700. Optionally, the processor 710 may be implemented using at least one of the following hardware forms: a digital signal processing (DSP), a field-programmable gate array (FPGA), or a programmable logic array (PLA). The processor 710 may integrate one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. The CPU primarily processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing display content; and the modem handles wireless communications. It is understood that the modem may not be integrated into the processor 710 and may be implemented separately via a communications chip.
[0104] The memory 720 may include a random access memory (RAM) or a read-only memory (ROM). The memory 720 may be used to store instructions, programs, codes, code sets, or instruction sets.
[0105] As another aspect, the present application further provides a computer-readable storage medium, which may be included in the electronic device described in the above embodiments, or may exist independently without being incorporated into the electronic device. The computer-readable storage medium carries computer-readable instructions, and when the computer-readable instructions are executed by a processor, the method of any of the above embodiments is implemented.
[0106] The computer-readable storage medium may be an electronic memory such as a flash memory, an EEPROM (Electrically Erasable Programmable Read-Only Memory), an EPROM, a hard disk, or a ROM. Alternatively, the computer-readable storage medium includes a non-transitory computer-readable storage medium. The computer-readable storage medium has storage space for program code for executing any of the method steps described above. The program code can be read from or written to one or more computer program products.
[0107] According to one aspect of an embodiment of the present application, a computer program product or computer program is provided, the computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor reads the computer instructions from the computer-readable storage medium and executes the computer instructions to implement the method of any of the above embodiments.
[0108] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiment of the application, the features and functions of two or more modules or units described above can be concretized in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be concretized.
[0109] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the embodiments of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the embodiments of the present application.
[0110] Those skilled in the art will readily conceive of other embodiments of the present application after considering the specification and practicing the embodiments disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present application that follow the general principles of this application and include common knowledge or customary techniques in the art that are not disclosed herein.
[0111] It should be understood that the present application is not limited to the exact structures described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A method for controlling a light emitting device, characterized in that: include: Get the target audio clip; Determine a first target audio frame having a maximum audio energy value in the target audio segment; Calculating a frequency difference between the first target audio frame and a second target audio frame, wherein the second target audio frame is an audio frame with a maximum audio energy value in a reference audio segment, and the reference audio segment includes at least one historical audio segment before the target audio segment; Calculating an audio energy difference between the target audio segment and the reference audio segment; Determining whether the target audio segment is a rhythm point based on the frequency difference and the audio energy difference, including: if the absolute value of the frequency difference is greater than a first threshold and the audio energy difference is greater than a second threshold, determining that the target audio segment is a rhythm point; if the absolute value of the frequency difference is not greater than the first threshold and / or the audio energy difference is not greater than the second threshold, determining that the target audio segment is not a rhythm point; If it is determined that the target audio clip is a rhythm point, controlling the light-emitting device to emit light according to the lighting effect control signal corresponding to the audio energy of the target audio clip to present the corresponding lighting effect scene until the presentation time of the lighting effect scene reaches the set lighting effect presentation duration; If it is determined that the target audio segment is not a rhythm point, the light emitting device is controlled to emit light according to a set control signal, wherein the light emitting state of the light emitting device is different at a rhythm point and at a non-rhythm point.
2. The method according to claim 1, characterized in that The calculating the audio energy difference between the target audio segment and the reference audio segment includes: Obtaining a short-time energy mean of the target audio segment; Obtaining a short-time energy mean of the reference audio segment; The short-time energy mean of the target audio segment is subtracted from the short-time energy mean of the reference audio segment to obtain the audio energy difference.
3. The method according to claim 1, characterized in that Before calculating the audio energy difference between the target audio segment and the reference audio segment, the method further includes: Determining whether the absolute value of the frequency difference is greater than a first threshold; If the absolute value of the frequency difference is greater than a first threshold, performing the step of calculating the audio energy difference between the target audio segment and the reference audio segment; If the absolute value of the frequency difference is not greater than the first threshold, the next sampled audio segment is used as the target audio segment.
4. The method according to claim 1, wherein The step of controlling the light-emitting device to emit light according to the light-effect control signal corresponding to the audio energy of the target audio segment includes: Acquiring audio energy of the target audio segment; determining, according to a mapping relationship between audio energy and lighting effect control signals, a lighting effect control signal corresponding to the audio energy of the target audio segment; The light-emitting device is controlled to emit light according to the light-effect control signal corresponding to the audio energy of the target audio segment.
5. The method according to claim 4, characterized in that The lighting effect control signal includes at least one of a brightness control signal, a light color control signal, and a light quantity control signal.
6. The method according to claim 1, characterized in that Before determining the first target audio frame having the largest audio energy value in the target audio segment, the method further includes: Performing music recognition on the target audio clip to obtain a music recognition result; If the music recognition result indicates that the target audio segment is music data, the step of determining the first target audio frame with the maximum audio energy value in the target audio segment is performed.
7. A light emitting device, characterized in that: The system comprises a controller and a light-emitting module, wherein the light-emitting module is electrically connected to the controller, and the controller is used to control the light-emitting module to emit light according to the method according to any one of claims 1 to 6.
8. A control device for a light emitting device, characterized in that: include: An acquisition module is used to obtain a target audio segment; a first target audio frame determining module, configured to determine a first target audio frame with a maximum audio energy value in the target audio segment; a frequency difference calculation module, configured to calculate a frequency difference between the first target audio frame and a second target audio frame; the second target audio frame being an audio frame with a maximum audio energy value in a reference audio segment, the reference audio segment including at least one historical audio segment preceding the target audio segment; an audio energy difference calculation module, configured to calculate an audio energy difference between the target audio segment and the reference audio segment; a rhythm point determination module, configured to determine whether the target audio segment is a rhythm point according to the frequency difference and the audio energy difference; a control module configured to, if it is determined that the target audio segment is a rhythm point, control the light-emitting device to emit light according to a lighting effect control signal corresponding to the audio energy of the target audio segment, so as to present a corresponding lighting effect scene until the presentation time of the lighting effect scene reaches a set lighting effect presentation duration; and, if it is determined that the target audio segment is not a rhythm point, control the light-emitting device to emit light according to the set control signal, wherein the lighting state of the light-emitting device is different at the rhythm point and at non-rhythm points; The rhythm point determination module is configured to: determine that the target audio segment is a rhythm point if the absolute value of the frequency difference is greater than a first threshold and the audio energy difference is greater than a second threshold; and determine that the target audio segment is not a rhythm point if the absolute value of the frequency difference is not greater than the first threshold and / or the audio energy difference is not greater than the second threshold.
9. An electronic device, characterized in that: include: processor; A memory having computer-readable instructions stored thereon, wherein when the computer-readable instructions are executed by the processor, the method according to any one of claims 1 to 6 is implemented.
10. A computer-readable storage medium having computer-readable instructions stored thereon, wherein when the computer-readable instructions are executed by a processor, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Light effect control method and device, equipment and storage medium
CN113613369A
Equipment control method and device, terminal equipment and storage medium
CN113692091A