CN116343757A - Interface light control method based on audio data and computer readable storage medium - Google Patents

Interface light control method based on audio data and computer readable storage medium Download PDF

Info

Publication number
CN116343757A
CN116343757A CN202111597818.2A CN202111597818A CN116343757A CN 116343757 A CN116343757 A CN 116343757A CN 202111597818 A CN202111597818 A CN 202111597818A CN 116343757 A CN116343757 A CN 116343757A
Authority
CN
China
Prior art keywords
drum
detection period
drum point
energy level
level detection
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111597818.2A
Other languages
Chinese (zh)
Inventor
林飞虎
林海
黄文书
徐继芸
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujian Star Net eVideo Information Systems Co Ltd
Original Assignee
Fujian Star Net eVideo Information Systems Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujian Star Net eVideo Information Systems Co Ltd filed Critical Fujian Star Net eVideo Information Systems Co Ltd
Priority to CN202111597818.2A priority Critical patent/CN116343757A/en
Publication of CN116343757A publication Critical patent/CN116343757A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
    • G10L15/00Speech recognition
    • G10L15/02Feature extraction for speech recognition; Selection of recognition unit
    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
    • G10L25/00Speech or voice analysis techniques not restricted to a single one of groups G10L15/00 - G10L21/00
    • G10L25/03Speech or voice analysis techniques not restricted to a single one of groups G10L15/00 - G10L21/00 characterised by the type of extracted parameters
    • G10L25/18Speech or voice analysis techniques not restricted to a single one of groups G10L15/00 - G10L21/00 characterised by the type of extracted parameters the extracted parameters being spectral information of each sub-band
    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
    • G10L25/00Speech or voice analysis techniques not restricted to a single one of groups G10L15/00 - G10L21/00
    • G10L25/03Speech or voice analysis techniques not restricted to a single one of groups G10L15/00 - G10L21/00 characterised by the type of extracted parameters
    • G10L25/21Speech or voice analysis techniques not restricted to a single one of groups G10L15/00 - G10L21/00 characterised by the type of extracted parameters the extracted parameters being power information
    • HELECTRICITY
    • H05ELECTRIC TECHNIQUES NOT OTHERWISE PROVIDED FOR
    • H05BELECTRIC HEATING; ELECTRIC LIGHT SOURCES NOT OTHERWISE PROVIDED FOR; CIRCUIT ARRANGEMENTS FOR ELECTRIC LIGHT SOURCES, IN GENERAL
    • H05B47/00Circuit arrangements for operating light sources in general, i.e. where the type of light source is not relevant
    • H05B47/10Controlling the light source
    • H05B47/105Controlling the light source in response to determined parameters
    • H05B47/115Controlling the light source in response to determined parameters by determining the presence or movement of objects or living beings
    • H05B47/12Controlling the light source in response to determined parameters by determining the presence or movement of objects or living beings by detecting audible sound
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02BCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO BUILDINGS, e.g. HOUSING, HOUSE APPLIANCES OR RELATED END-USER APPLICATIONS
    • Y02B20/00Energy efficient lighting technologies, e.g. halogen lamps or gas discharge lamps
    • Y02B20/40Control techniques providing energy savings, e.g. smart controller or presence detection

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Human Computer Interaction (AREA)
  • Acoustics & Sound (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Spectroscopy & Molecular Physics (AREA)
  • Circuit Arrangement For Electric Light Sources In General (AREA)

Abstract

The invention discloses an interface light control method based on audio data and a computer readable storage medium, wherein the method comprises the following steps: acquiring audio data in real time, and identifying drum points in the audio data in real time; according to a preset drum point frequency grade detection period, the number of drum points in the current drum point frequency grade detection period is obtained, and according to the number of drum points, the drum point frequency grade is determined; according to a preset drum point energy level detection period, obtaining the maximum spectrum energy sum of the drum points in the current drum point energy level detection period, and determining the drum point energy level according to the maximum spectrum energy sum; and controlling the interface light of the next drum point frequency level detection period according to the drum point frequency level, and/or controlling the interface light of the next drum point energy level detection period according to the drum point energy level. The invention can enrich the visual effect of the display screen.

Description

Interface light control method based on audio data and computer readable storage medium
Technical Field
The invention relates to the technical field of screen light control, in particular to an interface light control method based on audio data and a computer readable storage medium.
Background
In entertainment places such as KTVs, bars, dance halls and the like, relatively cool and dazzling scene lights or scene lights with unique theme are often arranged, so that clients can perform omnibearing sensory entertainment.
Currently, technologies for controlling scene lighting according to audio have been presented in the market, for example, in patent document with patent application number of cn202110127046.X, named "audio-based light control system and method", an audio-based light control system and method are disclosed, including: the system comprises an audio signal input unit, an audio signal equalization unit, a tone data analysis unit, a loudness data analysis unit and a light mode unit; each data analysis unit reads the audio digital signal and analyzes the audio digital signal into tone data, tone data and loudness data respectively; the light mode unit converts tone data into a light main tone signal, converts tone data into a light local tone signal, and converts loudness data into a light overall brightness signal; the light control system performs layered control on the light through tone data, tone data and loudness data; the tone data is used for controlling the main tone of the lamplight; the tone data is used for controlling the local tone of the lamplight; the loudness data is used to control the overall brightness of the light. The invention can realize the change of brightness and color of the lamplight along with the change of tone, tone and loudness, has more abundant rhythm effect and improves user experience.
As can be seen from the above patent, the display of scene lights by audio control has been achieved at present. However, digital entertainment places such as KTV and bar often have display screens (television screens or large screens), and currently, the display screens of these places usually only display songs MV or preset pictures or videos, and are not associated with the played audio, so that the display effect is relatively single, and users cannot be better fused into the field atmosphere.
Disclosure of Invention
The technical problems to be solved by the invention are as follows: the interface light control method based on the audio data and the computer readable storage medium are provided, so that the visual effect of a display screen can be enriched, and the visual experience of a user is improved.
In order to solve the technical problems, the invention adopts the following technical scheme: an interface light control method based on audio data comprises the following steps:
acquiring audio data in real time, and identifying drum points in the audio data in real time;
according to a preset drum point frequency grade detection period, obtaining the number of drum points in the current drum point frequency grade detection period, and determining the drum point frequency grade of the current drum point frequency grade detection period according to the number of the drum points;
according to a preset drum point energy level detection period, acquiring the maximum spectrum energy sum of drum points in the current drum point energy level detection period, and determining the drum point energy level of the current drum point energy level detection period according to the maximum spectrum energy sum;
and controlling the interface light of the next drum point frequency level detection period according to the drum point frequency level of the current drum point frequency level detection period, and/or controlling the interface light of the next drum point energy level detection period according to the drum point energy level of the current drum point energy level detection period.
The present invention also provides a computer readable storage medium having stored thereon a computer program which when executed by a processor implements a method as described above.
The invention has the beneficial effects that: through detecting the drumming point in the audio data to according to the frequency and the energy size of drumming point, the demonstration of control interface light animation makes interface light can change according to audio frequency change, has enriched the visual effect of display screen, more can attract the user's eye in the place, promotes user's visual experience.
Drawings
FIG. 1 is a flow chart of an interface light control method based on audio data according to the present invention;
FIG. 2 is a flow chart of a method according to a first embodiment of the invention;
fig. 3 is a flowchart of step S1 in the second embodiment of the present invention.
Detailed Description
In order to describe the technical contents, the achieved objects and effects of the present invention in detail, the following description will be made with reference to the embodiments in conjunction with the accompanying drawings.
Referring to fig. 1, an interface light control method based on audio data includes:
acquiring audio data in real time, and identifying drum points in the audio data in real time;
according to a preset drum point frequency grade detection period, obtaining the number of drum points in the current drum point frequency grade detection period, and determining the drum point frequency grade of the current drum point frequency grade detection period according to the number of the drum points;
according to a preset drum point energy level detection period, acquiring the maximum spectrum energy sum of drum points in the current drum point energy level detection period, and determining the drum point energy level of the current drum point energy level detection period according to the maximum spectrum energy sum;
and controlling the interface light of the next drum point frequency level detection period according to the drum point frequency level of the current drum point frequency level detection period, and/or controlling the interface light of the next drum point energy level detection period according to the drum point energy level of the current drum point energy level detection period.
From the above description, the beneficial effects of the invention are as follows: based on the frequency and the energy of the drumming points in the audio data, the display of the interface light is controlled, the interaction between the audio and the display screen is realized, the visual effect of the display screen is enriched, and the visual experience of a user is improved.
Further, according to the preset drum point frequency level detection period, the number of drum points in the current drum point frequency level detection period is obtained, and according to the number of drum points, the drum point frequency level of the current drum point frequency level detection period is determined as follows:
when a preset drum point frequency level detection period is reached, obtaining a drum point with an energy difference value larger than a preset first threshold value in the current drum point frequency level detection period, and obtaining a first drum point;
and determining the drum point frequency grade corresponding to the current drum point frequency grade detection period according to the number of the first drum points.
Further, according to the number of the first drum points, determining the drum point frequency level corresponding to the current drum point frequency level detection period specifically includes:
if the number of the first drum points is 0 or 1, setting the drum point frequency grade corresponding to the current drum point frequency grade detection period to be 1;
if the number of the first drum points is 2, setting the drum point frequency grade corresponding to the current drum point frequency grade detection period to be 2;
if the number of the first drum points is 3 or 4, setting the drum point frequency grade corresponding to the current drum point frequency grade detection period to be 3;
and if the number of the first drum points is greater than or equal to 5, setting the drum point frequency grade corresponding to the current drum point frequency grade detection period to be 4.
From the above description, it is known that the drum frequency level is determined according to the number of drum points whose energy difference value is greater than a preset threshold value.
Further, according to the preset drum point energy level detection period, the maximum spectrum energy sum of the drum points in the current drum point energy level detection period is obtained, and according to the maximum spectrum energy sum, the drum point energy level of the current drum point energy level detection period is determined as follows:
when a preset drum point energy level detection period is reached, obtaining the maximum value of the sum of the frequency spectrum energy of each drum point in the current drum point energy level detection period, and determining the drum point energy level corresponding to the current drum point energy level detection period according to the maximum value.
Further, when the preset drum point energy level detection period is reached, obtaining a maximum value of a sum of frequency spectrum energy of each drum point in the current drum point energy level detection period, and determining, according to the maximum value, a drum point energy level corresponding to the current drum point energy level detection period specifically includes:
when a preset drum point energy level detection period is reached, judging whether a drum point exists in the current drum point energy level detection period;
if the drum energy level does not exist, setting the drum energy level corresponding to the current drum energy level detection period to be 1;
if so, acquiring the maximum value of the sum of the frequency spectrum energy of each drum point in the current drum point energy level detection period;
if the maximum value is in a preset first value range, setting the drum point energy level corresponding to the current drum point energy level detection period to be 2;
and if the maximum value is in the preset second value range, setting the drum point energy level corresponding to the current drum point energy level detection period to be 3.
From the above description, it follows that the drum energy level is determined from the maximum spectral energy sum of the drum points.
Further, the interface light comprises a spotlight, wherein the spotlight comprises a left spotlight, a right spotlight and a bottom spotlight;
the interface light for controlling the next drum point frequency grade detection period according to the drum point frequency grade of the current drum point frequency grade detection period specifically comprises the following steps:
in the next drum point frequency grade detection period, controlling the display of left and right spot lights according to the preset spot light animation effect corresponding to the drum point frequency grade;
and in the next drum point frequency grade detection period, controlling the display of the bottom spotlight according to the preset spotlight animation effect corresponding to the drum point frequency grade.
From the above description, it is apparent that the display of the left and right spot lights and the bottom spot light is controlled according to the drum frequency level.
Further, in the next drum frequency level detection period, according to the preset shot-light animation effect corresponding to the drum frequency level, the control of the left and right shot-light display is specifically:
obtaining a corresponding spot lamp animation effect according to the drum point frequency grade of the current drum point frequency grade detection period;
and selecting a shot lamp animation effect from the corresponding shot lamp animation effects, and controlling the display of the left shot lamp and the right shot lamp according to the shot lamp animation effect in the next drum frequency grade detection period.
It can be seen from the above description that a plurality of spot lamp animation effects can be preset, and one of the spot lamp animation effects is dynamically selected to control the display of the left and right spot lamps, so as to realize different light effects.
Further, the interface light includes a bottom backlight;
the interface light for controlling the next drum point energy level detection period according to the drum point energy level of the current drum point energy level detection period specifically comprises the following steps:
and determining the transparency of the bottom background lamp according to the maximum value of the sum of the frequency spectrum energy of each drum point in the current drum point energy level detection period, and controlling the display of the bottom background lamp according to the animation effect and the transparency of the background lamp corresponding to the preset drum point energy level in the next drum point energy level detection period.
From the above description, it is seen that the display of the bottom backlight is controlled in accordance with the drum point energy level and the maximum spectral energy sum of the drum points.
Further, the determining, according to the maximum value of the sum of the spectral energies of the drum points in the current drum point energy level detection period, the transparency of the bottom backlight is specifically:
if the maximum value of the sum of the frequency spectrum energy of each drum point in the current drum point energy level detection period is smaller than or equal to a preset energy threshold value, setting the transparency of the bottom background lamp as the preset transparency;
and if the maximum value of the sum of the frequency spectrum energy of each drum point in the current drum point energy level detection period is larger than the preset energy threshold value, setting the transparency of the bottom background lamp according to the maximum value of the sum of the frequency spectrum energy of each drum point in the current drum point energy level detection period.
As can be seen from the above description, the transparency is determined according to the maximum spectral energy of the drum point, and when the drum point is weak, the transparency is small, so that the display effect of the bottom backlight is weak, and when the drum point is strong, the transparency is large, so that the display effect of the bottom backlight is strong.
The present invention also provides a computer readable storage medium having stored thereon a computer program which when executed by a processor implements a method as described above.
Example 1
Referring to fig. 2, a first embodiment of the invention is as follows: an interface light control method based on audio data can be applied to audio-visual places such as KTVs, bars, dance halls and the like, as shown in FIG. 2, and comprises the following steps:
s1: and acquiring audio data in real time, and identifying drum points in the audio data in real time.
In this embodiment, audio data is acquired, then each 0.3s or each 0.4s of audio data is used as an audio frame, the difference value of the sum of the frequency spectrum energy of adjacent audio frames is calculated to obtain the energy difference value of the audio frames, and finally, the drum points in the audio data are identified in real time according to the energy difference value of the audio frames.
S2: according to a preset drum point frequency grade detection period, the number of drum points in the current drum point frequency grade detection period is obtained, and according to the number of drum points, the drum point frequency grade of the current drum point frequency grade detection period is determined.
Specifically, when a preset drum point frequency level detection period is reached, obtaining a drum point with an energy difference value larger than a preset first threshold value in the current drum point frequency level detection period, and obtaining a first drum point; and then determining the drum point frequency grade corresponding to the current drum point frequency grade detection period according to the number of the first drum points.
In this embodiment, the drum frequency level detection period may be 1-2s, specifically may be 1.6s, the number of first drum points with energy difference values greater than a preset first threshold value is obtained every 1.6s, and then the drum frequency level corresponding to the current period is determined according to the number. In this embodiment, four drum frequency levels are set, specifically, if the number of the first drum points is 0 or 1, the drum frequency level corresponding to the current drum frequency level detection period is set to 1; if the number of the first drum points is 2, setting the drum point frequency grade corresponding to the current drum point frequency grade detection period to be 2; if the number of the first drum points is 3 or 4, setting the drum point frequency grade corresponding to the current drum point frequency grade detection period to be 3; if the number of the first drum points is greater than or equal to 5, the drum point frequency level corresponding to the current drum point frequency level detection period is set to be 4.
S3: and obtaining the maximum spectrum energy sum of the drum points in the current drum point energy level detection period according to a preset drum point energy level detection period, and determining the drum point energy level of the current drum point energy level detection period according to the maximum spectrum energy sum.
Specifically, when a preset drum point energy level detection period is reached, a maximum value of a spectrum energy sum of each drum point in the current drum point energy level detection period is obtained, and then the drum point energy level corresponding to the current drum point energy level detection period is determined according to the maximum value.
In this embodiment, the drum point energy level detection period may be 0.2s-0.8s, specifically may be 0.6s, a maximum value of the sum of spectrum energies of each drum point is obtained every 0.6s, and then the drum point energy level corresponding to the current period is determined according to the maximum value. In this embodiment, three drum point energy levels are set, specifically, if no drum point exists in the current drum point energy level detection period, that is, the number of drum points is 0, the drum point energy level corresponding to the current drum point energy level detection period is set to 1; if the maximum value of the sum of the frequency spectrum energy of each drum point in the current drum point energy level detection period is less than or equal to 30, setting the drum point energy level corresponding to the current drum point energy level detection period as 2; if the maximum value is greater than 30, the drum point energy level corresponding to the current drum point energy level detection period is set to 3.
S4: and controlling the interface light of the next drum frequency grade detection period according to the drum frequency grade of the current drum frequency grade detection period.
S5: and controlling the interface light of the next drum point energy level detection period according to the drum point energy level of the current drum point energy level detection period.
Of the above steps, steps S2 and S3 may be performed simultaneously, and steps S4 and S5 may be performed simultaneously.
In this embodiment, the interface light includes shot-light and background light, the shot-light includes left and right sides shot-light and bottom shot-light, the background light includes bottom background light. The left spotlight, the right spotlight and the bottom spotlight are displayed according to the drum point frequency grade, and the bottom background light is displayed according to the drum point energy grade.
For step S4, specifically, in the next drum point frequency level detection period, controlling the display of the left and right spot lights according to the spot light animation effect corresponding to the drum point frequency level of the current drum point energy level detection period; meanwhile, according to the shot-light animation effect corresponding to the drum point frequency grade of the current drum point energy grade detection period, the display of the bottom shot-light is controlled.
Further, in an alternative embodiment, for each drum frequency level, a plurality of spot light animation effects are preset, and when the drum energy level of the current drum energy level detection period is determined, one spot light animation effect is selected from the corresponding plurality of spot light animation effects, and the display of the left and right spot lights is controlled according to the selected spot light animation effect.
And in the same way, one spot lamp animation effect can be selected from a plurality of spot lamp animation effects corresponding to the drum point energy level in the current drum point energy level detection period so as to control the display of the bottom spot lamp.
For step S5, specifically, the transparency of the bottom backlight is determined according to the maximum value of the sum of the spectral energy of each drum point in the current drum point energy level detection period, and then in the next drum point energy level detection period, the display of the bottom backlight is controlled according to the animation effect of the backlight corresponding to the drum point energy level in the current drum point energy level detection period and the transparency.
If the maximum value of the sum of the spectrum energy of each drum point in the current drum point energy level detection period is smaller than or equal to a preset energy threshold value, setting the transparency of the bottom background lamp as the preset transparency; otherwise, setting the transparency of the bottom background lamp according to the maximum value of the sum of the frequency spectrum energy of each drum point in the current drum point energy level detection period. Preferably, the preset energy threshold is 60 and the preset transparency is 50%.
When the maximum value of the sum of the spectrum energy of each drum point in the current drum point energy level detection period is larger than a preset energy threshold value, the transparency of the bottom background lamp is set to be, for example, 95% when the maximum value of the sum of the spectrum energy of each drum point in the current drum point energy level detection period is 90-100; when the maximum value of the sum of the frequency spectrum energy of each drum point in the current drum point energy level detection period is 70-90, the transparency of the bottom background lamp is 85%; when the maximum value of the sum of the spectrum energy of each drum point in the current drum point energy level detection period is 60-70, the transparency of the bottom background light is 60%.
For example, assuming that, for a song, the period of the front note is 00:00.00-00:11.603, the drum point frequency level of each drum point frequency level detection period is 1 in 11 seconds, the drum point energy level of each drum point energy level detection period is also 1, the maximum value of the sum of the frequency spectrum energies of each drum point is 55, during 11 seconds, the left and right spotlight are displayed according to the spotlight animation effect with the display level of 1, the bottom spotlight is displayed according to the spotlight animation effect with the display level of 1, and the bottom spotlight is displayed according to the backlight animation effect with the display level of 1 and the transparency of 50%. Since the drum points in the prelude period are relatively weak, the light visual effect is weak.
In the period of 00:28.169-00:36.877 of the song, the drum point frequency grade of each drum point frequency grade detection period is 4, the drum point energy grade of each drum point energy grade detection period is 3, the maximum value of the spectrum energy sum of each drum point is 82, in the period, the left spotlight and the right spotlight are displayed according to the spotlight animation effect with the display grade of 4, the bottom spotlight is displayed according to the spotlight animation effect with the display grade of 4, and the bottom backlight is displayed according to the backlight animation effect with the display grade of 3 and the transparency of 85%. Since the drum points in this period are relatively strong and dense, the light visual effect is strong.
Further, in order to ensure that the light effect is linked with the drum points in real time, drum point data of a plurality of songs can be collected, the effect is debugged one by one, and parameters such as a detection period, a drum point frequency level, a drum point energy level and the like are optimized to be suitable for light display effects of most songs.
The embodiment can be applied to an Android system, so that the equipment cost for achieving the same effect is greatly reduced; the light effect can be dynamically configured, different light effects are displayed, and the interface light display effect is more abundant; the interaction between songs and display screen light is realized, the display effect of the display screen is enriched, the eyes of users in places can be attracted, and the users can be better fused into the field atmosphere.
Example two
Referring to fig. 3, the present embodiment is a further development of step S1 of the first embodiment. As shown in fig. 3, in this embodiment, step S1 specifically includes the following steps:
s101: and acquiring the audio data in real time, and further, carrying out normalization processing on the audio data after acquiring the audio data.
S102: sequentially acquiring an audio frame from the audio data as a current audio frame, and taking the difference value of the sum of the frequency spectrum energy of the current audio frame and the frequency spectrum energy of the previous audio frame as an energy difference value D of the current audio frame n And preserve the energy difference D n
Specifically, the method comprises the following steps:
s1021: acquiring a first audio frame of the audio data according to a preset frame length; in this embodiment, the frame length is 0.3s, i.e., every 0.3s of audio data is regarded as one audio frame.
S1022: and carrying out Fourier transform on the first audio frame to obtain the frequency spectrum of the first audio frame.
S1023: calculating to obtain the spectrum energy sum of the spectrum of the first audio frame in a preset frequency band; the frequency range can be selected according to the requirement, such as a low frequency part, an intermediate frequency part and a high frequency part, or can be a full frequency range, and the sum of the frequency spectrum energy is obtained in the full frequency range by using S n The subscript n indicates the frame number, counting from 1, i.e. the corresponding sequence number of the audio frame.
S1024: and acquiring the next audio frame of the audio data according to the preset frame length to serve as the current audio frame.
S1025: and carrying out Fourier transform on the current audio frame to obtain the frequency spectrum of the current audio frame.
S1026: and calculating to obtain the spectrum energy sum of the spectrum of the current audio frame in a preset frequency band.
S1027: subtracting the spectrum energy sum of the last audio frame from the spectrum energy sum of the current audio frame to obtain an energy difference value of the current audio frame, and storing the energy difference value. Specifically, according to formula D n =S n -S n-1 An energy difference of the current audio frame relative to the previous audio frame is calculated. The energy difference value of the first audio frame is negligible, and the spectrum energy value of the first audio frame can be directly used as the energy difference value.
S103: determining an energy threshold delta corresponding to a current audio frame n The method comprises the steps of carrying out a first treatment on the surface of the In this embodiment, the energy threshold may be a preset experience value, and at the same time, the energy threshold corresponding to each audio frame in this embodiment is the same and is the preset experience value.
In other alternative embodiments, the energy threshold may not be a fixed value, and the energy threshold may be adaptively adjusted according to the energy difference of the processed audio frames.
S104: and acquiring the current audio frame and more than two continuous audio frames adjacent to the current audio frame, and obtaining energy difference values of more than three audio frames.
S105: and judging whether peaks exist in the energy difference values of more than three audio frames, wherein the peaks are larger than the energy threshold value corresponding to the current audio frame, if yes, executing the step S106, and if not, continuing to acquire the next audio frame, namely executing the step S102. For example, when the energy difference of three audio frames is acquired, it is determined whether the following condition is satisfied: d (D) n-2 <D n-1 And D is n-1 >D n At the same time D n-1n Wherein D is n-1 D is the energy difference between the adjacent previous audio frame of the current audio frame n-2 Is at presentThe energy difference between two adjacent audio frames.
S106: and marking the audio frame corresponding to the peak value as a drum point. And returning to the execution step S102, and further returning to the execution step S1024 until the audio data is processed.
According to the embodiment, the drum points in the audio data are detected according to the energy difference between the audio frames, so that the detection can be performed in real time, and the accuracy is higher; and the model is not required to be built, and the drum point is determined by analyzing and comparing the energy difference values of a plurality of adjacent audio frames, so that the detection efficiency is improved.
Example III
The present embodiment is a computer readable storage medium corresponding to the above embodiment, and a computer program is stored thereon, where the computer program realizes each process in the above embodiment of the interface light control method based on audio data when being executed by a processor, and the same technical effects can be achieved, so that repetition is avoided, and no description is repeated here.
In summary, according to the interface light control method and the computer readable storage medium based on the audio data, the drum point in the audio data is detected according to the energy difference between the audio frames, so that the method and the computer readable storage medium can be performed in real time, and have higher accuracy; and the model is not required to be built, and the drum point is determined by analyzing and comparing the energy difference values of a plurality of adjacent audio frames, so that the detection efficiency is improved; by detecting the drumming points in the audio data and controlling the display of the interface light according to the frequency and the energy of the drumming points, the interface light can be changed according to the audio change, the interaction between songs and the display screen light is realized, the display effect of the display screen is enriched, the eyes of users in places can be attracted, and the users can be better integrated into the field atmosphere.
The foregoing description is only illustrative of the present invention and is not intended to limit the scope of the invention, and all equivalent changes made by the specification and drawings of the present invention, or direct or indirect application in the relevant art, are included in the scope of the present invention.

Claims (10)

1. An interface light control method based on audio data is characterized by comprising the following steps:
acquiring audio data in real time, and identifying drum points in the audio data in real time;
according to a preset drum point frequency grade detection period, obtaining the number of drum points in the current drum point frequency grade detection period, and determining the drum point frequency grade of the current drum point frequency grade detection period according to the number of the drum points;
according to a preset drum point energy level detection period, acquiring the maximum spectrum energy sum of drum points in the current drum point energy level detection period, and determining the drum point energy level of the current drum point energy level detection period according to the maximum spectrum energy sum;
and controlling the interface light of the next drum point frequency level detection period according to the drum point frequency level of the current drum point frequency level detection period, and/or controlling the interface light of the next drum point energy level detection period according to the drum point energy level of the current drum point energy level detection period.
2. The interface light control method based on audio data according to claim 1, wherein the obtaining the number of the drum points in the current drum point frequency level detection period according to the preset drum point frequency level detection period, and determining the drum point frequency level of the current drum point frequency level detection period according to the number of the drum points are specifically as follows:
when a preset drum point frequency level detection period is reached, obtaining a drum point with an energy difference value larger than a preset first threshold value in the current drum point frequency level detection period, and obtaining a first drum point;
and determining the drum point frequency grade corresponding to the current drum point frequency grade detection period according to the number of the first drum points.
3. The interface light control method based on audio data according to claim 2, wherein the determining, according to the number of the first drum points, a drum point frequency level corresponding to a current drum point frequency level detection period specifically includes:
if the number of the first drum points is 0 or 1, setting the drum point frequency grade corresponding to the current drum point frequency grade detection period to be 1;
if the number of the first drum points is 2, setting the drum point frequency grade corresponding to the current drum point frequency grade detection period to be 2;
if the number of the first drum points is 3 or 4, setting the drum point frequency grade corresponding to the current drum point frequency grade detection period to be 3;
and if the number of the first drum points is greater than or equal to 5, setting the drum point frequency grade corresponding to the current drum point frequency grade detection period to be 4.
4. The interface light control method based on audio data according to claim 1, wherein the obtaining the maximum spectrum energy sum of the drum points in the current drum point energy level detection period according to the preset drum point energy level detection period, and determining the drum point energy level of the current drum point energy level detection period according to the maximum spectrum energy sum is specifically as follows:
when a preset drum point energy level detection period is reached, obtaining the maximum value of the sum of the frequency spectrum energy of each drum point in the current drum point energy level detection period, and determining the drum point energy level corresponding to the current drum point energy level detection period according to the maximum value.
5. The interface light control method based on audio data according to claim 4, wherein when a preset drum point energy level detection period is reached, obtaining a maximum value of a sum of spectrum energy of each drum point in the current drum point energy level detection period, and determining, according to the maximum value, a drum point energy level corresponding to the current drum point energy level detection period specifically includes:
when a preset drum point energy level detection period is reached, judging whether a drum point exists in the current drum point energy level detection period;
if the drum energy level does not exist, setting the drum energy level corresponding to the current drum energy level detection period to be 1;
if so, acquiring the maximum value of the sum of the frequency spectrum energy of each drum point in the current drum point energy level detection period;
if the maximum value is in a preset first value range, setting the drum point energy level corresponding to the current drum point energy level detection period to be 2;
and if the maximum value is in the preset second value range, setting the drum point energy level corresponding to the current drum point energy level detection period to be 3.
6. The interface light control method based on audio data according to claim 1, wherein the interface light comprises a spotlight, and the spotlight comprises a left spotlight, a right spotlight and a bottom spotlight;
the interface light for controlling the next drum point frequency grade detection period according to the drum point frequency grade of the current drum point frequency grade detection period specifically comprises the following steps:
in the next drum point frequency grade detection period, controlling the display of left and right spot lights according to the preset spot light animation effect corresponding to the drum point frequency grade;
and in the next drum point frequency grade detection period, controlling the display of the bottom spotlight according to the preset spotlight animation effect corresponding to the drum point frequency grade.
7. The interface light control method based on audio data according to claim 6, wherein in the next drum frequency level detection period, according to a preset animation effect of the spotlight corresponding to the drum frequency level, the control of the display of the left spotlight and the right spotlight is specifically:
obtaining a corresponding spot lamp animation effect according to the drum point frequency grade of the current drum point frequency grade detection period;
and selecting a shot lamp animation effect from the corresponding shot lamp animation effects, and controlling the display of the left shot lamp and the right shot lamp according to the shot lamp animation effect in the next drum frequency grade detection period.
8. The audio data based interface light control method of claim 1, wherein the interface light comprises a bottom backlight;
the interface light for controlling the next drum point energy level detection period according to the drum point energy level of the current drum point energy level detection period specifically comprises the following steps:
and determining the transparency of the bottom background lamp according to the maximum value of the sum of the frequency spectrum energy of each drum point in the current drum point energy level detection period, and controlling the display of the bottom background lamp according to the animation effect and the transparency of the background lamp corresponding to the preset drum point energy level in the next drum point energy level detection period.
9. The interface light control method based on audio data according to claim 8, wherein the determining the transparency of the bottom backlight according to the maximum value of the sum of the spectral energy of each drum point in the current drum point energy level detection period is specifically:
if the maximum value of the sum of the frequency spectrum energy of each drum point in the current drum point energy level detection period is smaller than or equal to a preset energy threshold value, setting the transparency of the bottom background lamp as the preset transparency;
and if the maximum value of the sum of the frequency spectrum energy of each drum point in the current drum point energy level detection period is larger than the preset energy threshold value, setting the transparency of the bottom background lamp according to the maximum value of the sum of the frequency spectrum energy of each drum point in the current drum point energy level detection period.
10. A computer readable storage medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the method according to any one of claims 1-9.
CN202111597818.2A 2021-12-24 2021-12-24 Interface light control method based on audio data and computer readable storage medium Pending CN116343757A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111597818.2A CN116343757A (en) 2021-12-24 2021-12-24 Interface light control method based on audio data and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111597818.2A CN116343757A (en) 2021-12-24 2021-12-24 Interface light control method based on audio data and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN116343757A true CN116343757A (en) 2023-06-27

Family

ID=86879448

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111597818.2A Pending CN116343757A (en) 2021-12-24 2021-12-24 Interface light control method based on audio data and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN116343757A (en)

Similar Documents

Publication Publication Date Title
CN102783173B (en) Content reproduction device, television receiver, content reproduction method, content reproduction program, and recording medium
RU2460248C2 (en) Combined control of surrounding lighting based on video content and audio content
CN112913330B (en) Method for selecting color extraction from video content to produce light effects
JP2020127714A (en) Method and system for generating audio-visual content from video game footage
JP2011510390A (en) Flash detection
CN113573442A (en) Method, apparatus, and computer-readable storage medium for audio control of scenes
JP2015008461A (en) Method and apparatus for inserting virtual object in video and computer readable medium
EP3874911B1 (en) Determining light effects based on video and audio information in dependence on video and audio weights
CN101416562A (en) Combined video and audio based ambient lighting control
US20210098025A1 (en) Method and device of generating cover dynamic pictures of multimedia files
KR20200086064A (en) Signal processing device and image display apparatus including the same
US20150318019A1 (en) Method and apparatus for editing video scenes based on learned user preferences
CN113597061A (en) Method, apparatus and computer readable storage medium for controlling a magic color light strip
CN110381336B (en) Video segment emotion judgment method and device based on 5.1 sound channel and computer equipment
CN111096078B (en) Method and system for creating light script of video
WO2007036890A2 (en) Improving living lights with color coherency
CN113853047A (en) Light control method and device, storage medium and electronic equipment
US20090024666A1 (en) Method and apparatus for generating metadata
CN116343757A (en) Interface light control method based on audio data and computer readable storage medium
KR100653915B1 (en) Illuninator controller and method for control the same
JP2011510391A (en) Color extraction
KR20210056802A (en) Display apparatus and method for controlling thereof
CN115604887A (en) Atmosphere lamp group control method, control console and device
JP7170884B2 (en) Determining light effects based on degree of speech in media content
JP5166794B2 (en) Viewing environment control device and viewing environment control method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination