Audio visualization method, device and storage medium
By determining the audio frame and loudness level in the audio visualization technology, and performing frequency domain data weighting processing according to the loudness level, the problem of inflexible audio visualization methods in the existing technology is solved, and an audio visualization effect that is more in line with the human hearing is achieved. .
Patent Information
- Application Number
- CN202010549588.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-06-16
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2040-06-16
AI Technical Summary
Existing audio visualization technology uses a fixed visualization method, which lacks flexibility and cannot fully meet the human hearing sense.
By determining the target audio frame and loudness level in the audio data, weighting the frequency domain data is performed based on the preset correspondence between the loudness level and the weighting strategy to generate a spectrum image that is more in line with the human hearing sense.
A more flexible and user-friendly audio visualization effect is achieved, enhancing the visual expressiveness of audio data.
Smart Images

Figure CN111782859B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of audio processing, and in particular to an audio visualization method, device and storage medium. Background Art
[0002] With the popularization of the Internet and the rapid popularity of digital audio, users can play various audio data (such as audio novels, songs, etc.) through electronic devices such as mobile phones and tablet computers.
[0003] In order to improve the diversity of information displayed during audio data playback, related technologies extract the features of audio data and visualize the audio features through image rendering, so as to achieve the effect that the picture changes with the changes of audio data, that is, using image language to explain the musical feeling.
[0004] In the process of studying and practicing the prior art, the inventor of the present invention found that the prior art often adopts a fixed visualization method during audio visualization processing, which is not flexible enough. Summary of the invention
[0005] The embodiments of the present invention provide an audio visualization method, device and storage medium, which can realize audio visualization more flexibly, and the visualization effect is more in line with the hearing sense of human ears.
[0006] The audio visualization method provided by the embodiment of the present invention includes:
[0007] determining a target audio frame in the audio data;
[0008] Obtaining a target loudness level of the target audio frame;
[0009] Determining a target weighting strategy corresponding to the target loudness level according to a preset correspondence between the loudness level and the weighting strategy;
[0010] Performing weighted processing on the frequency domain data of the target audio frame according to the target weighting strategy to obtain weighted frequency domain data;
[0011] A frequency spectrum image of the target audio frame is generated according to the weighted frequency domain data, and the frequency spectrum image is displayed.
[0012] The embodiment of the present invention further provides an audio visualization device, comprising:
[0013] A target determination module, used to determine a target audio frame in the audio data;
[0014] A loudness acquisition module, used to acquire a target loudness level of the target audio frame;
[0015] A strategy determination module, configured to determine a target weighting strategy corresponding to the target loudness level according to a preset correspondence between the loudness level and the weighting strategy;
[0016] A data weighting module, used for performing weighted processing on the frequency domain data of the target audio frame according to the target weighting strategy to obtain weighted frequency domain data;
[0017] An image generation module is used to generate a spectrum image of the target audio frame according to the weighted frequency domain data, and display the spectrum image.
[0018] In addition, an embodiment of the present invention further provides a storage medium, wherein the storage medium stores a computer program, and the computer program is suitable for being loaded by a processor to execute the audio visualization method provided by the embodiment of the present invention.
[0019] The present invention determines the target audio frame in the audio data, obtains the target loudness level of the target audio frame, and determines the target weighting strategy corresponding to the target loudness level according to the preset correspondence between the loudness level and the weighting strategy. Then, the frequency domain data of the target audio frame is weighted according to the target weighting strategy to obtain the weighted frequency domain data. Finally, the spectrum image of the target audio frame is generated according to the weighted frequency domain data, and the spectrum image is displayed. By using different weighting strategies to weight the frequency domain data of the audio according to the loudness of the audio acting on the human ear and then visualizing it, the visualization effect can be made more flexible and more in line with the human ear's hearing. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0021] Figure 1 is a flow chart of an audio visualization method provided by an embodiment of the present invention;
[0022] Figure 2 is a schematic diagram of dividing audio data into m audio frames in an embodiment of the present invention;
[0023] Figure 3 is an example diagram showing a generated spectrum image in an embodiment of the present invention;
[0024] Figure 4 is a schematic diagram of equal loudness curves involved in an embodiment of the present invention;
[0025] Figure 5is another flowchart of the audio visualization method provided by an embodiment of the present invention;
[0026] Figure 6 is a schematic diagram of the structure of an audio visualization device provided by an embodiment of the present invention;
[0027] Figure 7 It is a schematic diagram of the structure of a network device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0028] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0029] The embodiment of the present invention provides an audio visualization method, device and storage medium. The audio visualization method can be performed by an audio visualization device, which can be integrated in network devices such as user terminals (e.g., mobile phones, tablet computers, etc.) and desktop hosts, so that the network device determines a target audio frame in the audio data, obtains a target loudness level of the target audio frame, and determines a target weighting strategy corresponding to the target loudness level according to a preset correspondence between the loudness level and the weighting strategy, then performs weighted processing on the frequency domain data of the target audio frame according to the target weighting strategy to obtain weighted frequency domain data, and finally generates a spectrum image of the target audio frame according to the weighted frequency domain data, and displays the spectrum image.
[0030] The embodiment of the present invention provides an audio visualization method. In the embodiment of the present invention, the method will be described from the perspective of an audio visualization device. Figure 1 As shown, the process of the audio visualization method can be as follows:
[0031] In 101 , a target audio frame in audio data is determined.
[0032] The audio data includes but is not limited to music, voice programs, audio novels, etc.
[0033] It should be noted that although the audio data is not stable at the macro level, it is stable at the micro level and has short-term stability. It is generally believed that the audio data is stable in the time period of 10 milliseconds to 30 milliseconds. Based on this, in the embodiment of the present invention, the audio data is visualized in units of frames. For example, please refer to Figure 2 , the audio data can be divided into m (a positive integer) audio frames without overlap according to the frame length of 25 milliseconds.
[0034] In an embodiment of the present invention, a target audio frame in audio data that needs to be visualized is first determined, for example, a target audio frame in currently played audio data that needs to be visualized is determined, and the target audio frame is acquired for visualization.
[0035] Exemplarily, all audio frames in the audio data may be determined as target audio frames that need to be visualized for visualization processing, or some audio frames in the audio data may be determined as target audio frames that need to be visualized for visualization processing.
[0036] For example, when playback starts, the first audio frame of the audio data is obtained for visualization processing, and then as the audio data is played, the second audio frame, the third audio frame, ..., the mth audio frame of the audio data are successively obtained for visualization processing.
[0037] In 102, a target loudness level of a target audio frame is obtained.
[0038] It should be noted that, considering that under different loudness conditions, the human ear perceives the loudness of different frequencies completely differently, therefore, if the visualization can be performed based on the real-time loudness of the audio data, the final visualization effect can be more consistent with the human ear's hearing perception.
[0039] Optionally, in one embodiment, obtaining the loudness level of the target audio frame includes:
[0040] The loudness level of the target audio frame is estimated according to a preset loudness estimation strategy.
[0041] It should be noted that loudness, also known as volume, is the strength of sound perceived by the human ear. It is a subjective feeling of the size of the sound. The size of the loudness is determined by the amplitude of the sound receiving point. For the same sound source, the farther the amplitude propagates, the smaller the loudness; when the propagation distance is constant, the larger the amplitude of the sound source, the greater the loudness. The size of the loudness is closely related to the sound intensity, but the change of loudness with sound intensity is not a simple linear relationship, but close to a logarithmic relationship. When the frequency of the sound and the waveform of the sound wave change, people's perception of the size of the loudness will also change.
[0042] Loudness level is a relative quantity of loudness. Loudness level often refers to the comparison of a certain loudness with the reference loudness (1KHz pure tone). The unit is PHON (square). The sound pressure level of 1KHz pure tone is 0dB, so the loudness level is defined as 0PHON (square). The sound pressure level of 40dB is defined as 40PHON. If the loudness of sounds of other frequencies is the same as that of 1KHz pure tone, then the loudness level of 1KHz should be regarded as the loudness level of that frequency.
[0043] Based on the above description, those skilled in the art can understand that the loudness level is a subjective quantity and cannot be directly measured. Therefore, the embodiment of the present invention predefines a loudness estimation strategy for estimating the loudness level, which is referred to as a preset loudness estimation strategy.
[0044] Accordingly, when the loudness level of the target audio frame is acquired, the loudness level of the target audio frame may be estimated according to a preset loudness estimation strategy, thereby obtaining the target loudness level of the target audio frame.
[0045] Exemplarily, the embodiment of the present invention defines two types of loudness estimation strategies, which estimate the loudness level in the time domain and the frequency domain respectively.
[0046] 1. Loudness estimation strategy in the time domain, denoted as preset loudness estimation strategy 1:
[0047] The sound pressure level of the target audio frame is calculated in the time domain, and the sound pressure level is equivalent to its loudness level.
[0048] Assuming that the frame length of the target audio frame is N, and the time domain data value of each sampling point of the target audio frame is recorded as x(n), the effective value of the sound pressure of the target audio frame can be expressed as:
[0049]
[0050] Then the sound pressure level of the target audio frame can be expressed as:
[0051]
[0052] Among them, ε r is the reference sound pressure, which can be determined by an ordinary technician in the field according to actual needs. For example, in the embodiment of the present invention, ε r It is 2*10E-5 Pa.
[0053] 2. Loudness estimation strategy in frequency domain:
[0054] (1) Preset Loudness Estimation Strategy 2
[0055] According to Parseval's theorem, the calculation of the effective value of sound pressure can also be achieved in the frequency domain:
[0056]
[0057] Wherein, X(k) is the frequency domain representation of x(n), such as obtained by Fourier transform.
[0058] In addition, frequency domain weighting is performed on X(k) (the weighting method can be selected by a person skilled in the art according to actual needs). For example, the embodiment of the present invention can adopt A weighting. In this case, A weighting processing needs to be performed on each frequency point of X(k) to obtain new frequency domain data Xa(k). Then, the sound pressure level (equivalent to the loudness level) of the target audio frame can be expressed as:
[0059]
[0060] (2) Preset Loudness Estimation Strategy 3
[0061] Based on the concept of loudness, the energy value of the target audio frame at 1KHz is calculated as the sound pressure level of the target audio frame, which is equivalent to its loudness level:
[0062] SPL3=20log 10 (|X(k)| 1000Hz ).
[0063] In the embodiment of the present invention, any of the above preset loudness estimation strategies may be selected to estimate the loudness level of the target audio frame.
[0064] Optionally, in one embodiment, obtaining a target loudness level of a target audio frame includes:
[0065] (1) estimating the loudness level of the target audio frame according to a plurality of different preset loudness estimation strategies to obtain a plurality of candidate loudness levels;
[0066] (2) A weighted sum is performed on multiple candidate loudness levels according to the weight corresponding to each preset loudness estimation strategy to obtain a target loudness level of the target audio frame.
[0067] In the embodiment of the present invention, a plurality of different preset loudness estimation strategies are defined. In order to estimate the loudness level of the target audio frame more accurately, the estimation results of the plurality of different preset loudness estimation strategies may be integrated to obtain a final estimation result.
[0068] The embodiment of the present invention pre-assigns a corresponding weight to each preset loudness estimation strategy, with the sum of the weights being constrained to be 1. A person skilled in the art may assign weights to different preset loudness estimation strategies according to actual needs.
[0069] Exemplarily, taking the three preset loudness estimation strategies mentioned above as an example, the loudness level of the target audio frame is estimated according to preset loudness estimation strategy 1 to obtain a candidate loudness level of the corresponding target audio frame, which is recorded as SPL1; the loudness level of the target audio frame is estimated according to preset loudness estimation strategy 2 to obtain a corresponding candidate loudness level, which is recorded as SPL2; the loudness level of the target audio frame is estimated according to preset loudness estimation strategy 3 to obtain a corresponding candidate loudness level, which is recorded as SPL3.
[0070] Then, a weighted sum is performed according to the weights corresponding to the preset loudness estimation strategies 1, 2, and 3, which is expressed as:
[0071] SPL=a1*SPL1+a2*SPL2+a3*SPL3;
[0072] Among them, SPL represents the loudness level obtained by weighted summation, a1 (for example, a value of 0.2) represents the weight corresponding to the preset loudness estimation strategy 1, a2 (for example, a value of 0.3) represents the weight corresponding to the preset loudness estimation strategy 2, and a3 (for example, a value of 0.5) represents the weight corresponding to the preset loudness estimation strategy 3.
[0073] After weighted summing is performed on the above candidate loudness levels and a corresponding weighted sum value is obtained, the weighted sum value may be used as the target loudness level of the target audio frame.
[0074] In 103, a target weighting strategy corresponding to the target loudness level is determined according to a preset correspondence between the loudness level and the weighting strategy.
[0075] Correspondingly, in the embodiment of the present invention, a plurality of weighting strategies for modifying the target audio frame are pre-set, and the weighting strategies are associated with the loudness levels to obtain a preset corresponding relationship between the loudness levels and the weighting strategies, which is used to describe how to select the corresponding weighting strategies according to different loudness levels.
[0076] In the embodiment of the present invention, after the target loudness level of the target audio frame is acquired, a weighting strategy corresponding to the target loudness level is further determined according to a preset correspondence between the loudness level and the weighting strategy as the target weighting strategy for weighting the target audio frame.
[0077] Optionally, in one embodiment, determining a target weighting strategy corresponding to the target loudness level according to a preset correspondence between the loudness level and the weighting strategy includes:
[0078] (1) when the target loudness level is within the first preset loudness level interval, determining the target weighting strategy to be A weighting; or,
[0079] (2) when the target loudness level is within the second preset loudness level interval, determining the target weighting strategy to be B weighting; or,
[0080] (3) when the target loudness level is within a third preset loudness level interval, determining that the target weighting strategy is C weighting;
[0081] The first preset loudness level interval is smaller than the second preset loudness level interval, and the second preset loudness level interval is smaller than the third preset loudness level interval. The comparison of intervals here is a comparison of value sizes, not a comparison of the sizes of the included ranges. One interval being smaller than another interval means that the values included in the interval are smaller than the values included in the other interval as a whole.
[0082] It should be noted that A-weighted is a standard weight curve used for audio measurement, which is used to reflect the response characteristics of the human ear. Since the human ear is not sensitive to sound changes in different frequency bands, the higher or lower the sound is, the less sensitive it is, just like the letter A, so it is called A-weighted. The standard for A-weighted was established by the American Standards Association in the 1940s to describe the sensitivity of the human ear to sound changes in different frequency bands. In addition, there are B-weighted and C-weighted, among which A-weighted is based on the 40phon equal loudness curve design, B-weighted is based on the 70phon equal loudness curve design, and C-weighted is based on the 100phon equal loudness curve design. The main difference between the three is the degree of attenuation of the low-frequency components of noise. A-weighted attenuation is the most, B-weighted is the second, and C-weighted is the least. It should be noted that different preset loudness level intervals correspond to different weighting strategies, and different weighting strategies have different processing effects on audio frames of different loudness levels. For example, the A weighting strategy is suitable for audio frames with a relatively small loudness level; the B weighting strategy is suitable for audio frames with a medium loudness level; and the C weighting strategy is suitable for audio frames with a relatively large loudness level.
[0083] In the embodiment of the present invention, the loudness level is pre-divided into three intervals, namely, a first preset loudness level interval, a second preset loudness level interval and a third preset loudness level interval, which correspond to A-weighting, B-weighting and C-weighting respectively.
[0084] The endpoints of the first preset loudness level interval, the second preset loudness level interval, and the third preset loudness level interval may be set by a person skilled in the art according to actual needs, and are not specifically limited in the embodiments of the present invention.
[0085] For example, the first preset loudness level interval is (-∞, 55], the second preset loudness level interval is (55, 85], and the third preset loudness level interval is (85, +∞]. Accordingly, when the loudness level of the target audio frame is within (-∞, 55], the A weighting is used as the target weighting strategy to weight the frequency domain data of the target audio frame; when the loudness level of the target audio frame is within (55, 85], the B weighting is used as the target weighting strategy to weight the frequency domain data of the target audio frame; when the loudness level of the target audio frame is within (85, +∞], the C weighting is used as the target weighting strategy to weight the frequency domain data of the target audio frame.
[0086] Optionally, in one embodiment, determining a target weighting strategy corresponding to the target loudness level according to a preset correspondence between the loudness level and the weighting strategy includes:
[0087] (1) obtaining an equal loudness curve corresponding to a target loudness level of a target audio frame, and determining an inverse function curve corresponding to the equal loudness curve;
[0088] (2) Finding the response level corresponding to the target audio frame in the inverse function curve;
[0089] (3) The found response levels are normalized and determined as the weighted weights of the target weighting strategy.
[0090] Please refer to Figure 4 , which is a schematic diagram of the international standard ISO226 equal loudness curve, is a curve of the relationship between the sound pressure level and frequency of pure tones with the same loudness perceived by typical listeners, where the horizontal axis is frequency, the vertical axis is sound pressure level, and the value on the curve represents the loudness level.
[0091] In the embodiment of the present invention, the frequency domain data of the target audio frame is also weighted according to the equal loudness curve.
[0092] When determining a target weighting strategy for weighting frequency domain data of a target audio frame, an equal loudness curve corresponding to a target loudness level may be first obtained, and the target weighting strategy may be determined to perform weighting according to an inverse function of the equal loudness curve.
[0093] Exemplarily, the specific manner of performing weighted processing according to the inverse function of the equal loudness curve is that the inverse function of the equal loudness curve can also be expressed as an inverse function curve, whose abscissa is frequency and ordinate is loudness level. The frequency of the target audio frame is determined, and the loudness level corresponding to the frequency of the target audio frame is determined according to the inverse function curve, and the loudness level is normalized and used as the weighted weight of the frequency domain amplitude value.
[0094] In 104, the frequency domain data of the target audio frame is weighted according to the target weighting strategy to obtain weighted frequency domain data.
[0095] After determining the target weighting strategy, the target audio frame is further converted from the time domain to the frequency domain. For example, the target audio frame can be converted from the time domain to the frequency domain by using Fourier transform, thereby obtaining the frequency domain data of the target audio frame.
[0096] Among them, the Fourier transform method used to achieve the conversion of the target audio frame from the time domain to the frequency domain can be configured by ordinary technicians in this field according to actual needs. For example, in an embodiment of the present invention, a short-time Fourier transform method is used to convert the target audio frame from the time domain to the frequency domain, thereby obtaining the frequency domain data of the target audio frame.
[0097] After determining the target weighting strategy for weighting the frequency domain data, the frequency domain data can be weighted according to the determined target weighting strategy to obtain weighted frequency domain data.
[0098] For example, taking the equal loudness curve of 40phon as an example, the corresponding value of the equal loudness curve is recorded as SPL(40). The inverse function of the curve is used as the weighted weight, that is,
[0099] Weight(k)=40-SPL(40); Specifically, SPL(40) represents the loudness level of the target audio frame determined according to the equal loudness curve of 40phon;
[0100] Among them, the weighted weight Weight (k) unit is dB, and the weighted frequency domain data can be expressed as:
[0101] X_w(k)=Weight(k)*X(k) wherein X(k) represents the amplitude value of the frequency domain data obtained after Fourier transform of the time domain data of the target audio frame.
[0102] In 105 , a spectrum image of the target audio frame is generated according to the weighted frequency domain data, and the spectrum image is displayed.
[0103] After completing the weighted processing of the frequency domain data to obtain weighted frequency domain data, the weighted frequency domain data is used as supporting data for audio visualization display. According to the preset spectrum graph generation strategy, a spectrum image corresponding to the target audio frame is generated based on the weighted frequency domain data, and the spectrum image is displayed.
[0104] It should be noted that the embodiment of the present invention does not limit the frequency spectrum generation strategy adopted, and can be set by ordinary technicians in the field according to actual needs. For example, the embodiment of the present invention adopts a columnar frequency spectrum generation strategy to generate a columnar frequency spectrum image, and directly displays the columnar frequency spectrum image on the audio data playback interface, such as Figure 3 It should be noted that the spectrum image of each audio frame of the audio data can be generated and stored in advance, and displayed along with the playing process when the audio data is played; or the spectrum image can be generated in real time during the playing of the audio data and displayed along with the playing process.
[0105] In practical applications, one audio visualization processing scheme is full processing, that is, according to a preset frame division algorithm, the audio data is divided to obtain multiple audio frames arranged in chronological order. The target audio frame can be any audio frame among the multiple audio frames. For example, each audio frame is sequentially used as the target audio frame in chronological order, and the visualization operation in the above embodiment is performed on each audio frame to display the spectrum image of each audio frame. However, since the energy variation of the audio frame is small, the spectrum image variation of each audio frame is not particularly obvious, and the method of visualizing each frame is relatively wasteful of computing resources. Therefore, in order to save computing resources of the device, the visualization processing of some audio frames is skipped, that is, some audio frames are selected as target audio frames for visualization processing.
[0106] Optionally, in one embodiment, generating a frequency spectrum image of a target audio frame according to the weighted frequency domain data includes:
[0107] (1) determining a preset number of target audio frames before a target audio frame from among a plurality of audio frames arranged in time sequence in the audio data;
[0108] (2) respectively determining a weight corresponding to each target audio frame and weighted frequency domain data of each target audio frame;
[0109] (3) performing weighted calculation on the weighted frequency domain data of each target audio frame according to the weight of each target audio frame to obtain target frequency domain data;
[0110] (4) Generate a spectrum image of the target audio frame based on the target frequency domain data.
[0111] In the embodiment of the present invention, in order to achieve smoothing processing, when generating the spectrum image of each target audio frame, the conditions of the previous frames can be comprehensively considered, and the spectrum image of the current target audio frame can be obtained after weighted operation is performed on the previous target audio frames and the current target audio frame.
[0112] Among them, a preset number of target audio frames before the target audio frame are determined in the multiple audio frames arranged in time sequence in the audio data. It should be noted that the value of the preset number is not specifically limited in the embodiment of the present application, and can be taken by ordinary technicians in this field according to actual needs. For example, in the embodiment of the present invention, the preset number is configured as 4.
[0113] Then, the weight corresponding to each target audio frame is determined respectively. Among them, the weight can be assigned according to actual needs by ordinary technicians in this field, and there is no specific limitation in the embodiment of the present invention. For example, in the embodiment of the present invention, the longer the previous target audio frame is from the current target audio frame, the smaller the weight assigned, that is, the closer the previous target audio frame is to the current target audio frame, the larger the corresponding weight. In addition, the frequency domain data of each target audio frame after weighting according to its corresponding target weighting strategy is also determined.
[0114] Then, the weighted frequency domain data of each target audio frame is weighted according to the weight of each target audio frame, the weighted frequency domain data is recorded as the target frequency domain data of the target audio frame, and the spectrum image of the target audio frame is generated according to the target frequency domain data.
[0115] Optionally, in one embodiment, determining a target audio frame in the audio data includes:
[0116] (1) sequentially obtaining audio frames arranged in time sequence in the audio data;
[0117] (2) If the currently acquired audio frame is the first audio frame in the audio data, the first audio frame is determined as the target audio frame;
[0118] (3) If the currently acquired audio frame is not the first audio frame in the audio data, determine the energy change trend information of the audio frame and the previous target audio frame; when the energy change trend information meets the preset conditions, determine the acquired audio frame as the target audio frame; when the energy change trend information does not meet the preset conditions, determine the acquired audio frame as a skipped audio frame, and return to the step of sequentially acquiring the next audio frame arranged in time sequence in the audio data.
[0119] Considering that the duration of each audio frame is very short, even if some audio frames are skipped and not visualized, there will not be a big visual difference from visually processing all audio frames. The embodiment of the present invention visualizes some audio frames in the audio data.
[0120] The audio frames arranged in time sequence in the audio data may be acquired in sequence. If the currently acquired audio frame is the first audio frame in the audio data, the first audio frame is determined as the target audio frame.
[0121] In addition, if the currently acquired audio frame is not the first audio frame in the audio data, the energy change trend information of the audio frame and the previous target audio frame is determined; if the energy change trend information meets the preset conditions, the acquired audio frame is determined as the target audio frame; if the energy change trend information does not meet the preset conditions, the acquired audio frame is determined as a skipped audio frame, and the step of sequentially acquiring the next audio frame in the audio data in time sequence is returned. The energy change trend information is used to describe the direction (such as increase or decrease) and degree of energy change.
[0122] It should be noted that the present invention does not impose any specific restrictions on the configuration of the above preset conditions, and can be configured by ordinary technicians in this field according to actual needs. For example, in the embodiment of the present application, the preset conditions are configured as follows: the direction of energy change is increasing and the degree of increase reaches a preset degree, or the direction of energy change is decreasing and the degree of decrease reaches a preset degree. Among them, the situation where the energy change trend information meets the preset conditions is used to indicate that the energy change of the previous and next audio frames is large, so that the next audio frame is still visualized as the target audio frame; otherwise, it indicates that the energy change of the previous and next audio frames is small, and the next audio frame is not visualized as the target audio frame.
[0123] Optionally, in one embodiment, after determining the target audio frame in the audio data, the method further includes:
[0124] (1) Obtaining energy change trend information of the target audio frame and the historical audio frame in a preset frequency band, where the historical audio frame is the audio frame that was last visualized;
[0125] (2) determining the skipped audio frames for skipping visualization processing according to the energy change trend information;
[0126] (3) Determine the next audio frame that needs to be visualized based on the skipped audio frame.
[0127] Among them, after determining the target audio frame that needs to be visualized in the target audio frame, in addition to visualizing the target audio frame, energy change trend information of the target audio frame and the historical audio frame in a preset frequency band is obtained, and the energy change trend information is used to describe the direction (such as increase or decrease) and degree of energy change. Among them, the historical audio frame is the audio frame that was visualized last time.
[0128] It should be noted that the value of the preset frequency band can be set by ordinary technicians in this field according to actual needs. For example, the value in the embodiment of the present invention is 1KHz.
[0129] In addition, the embodiment of the present invention also pre-defines the correspondence between the energy change trend information and the number of audio frames skipped for visualization processing, with the number of skipped audio frames and the degree of change in the energy change trend information being inversely correlated as a constraint. The correspondence between the energy change trend information and the number of audio frames skipped for visualization processing can be set by ordinary technicians in this field according to actual needs.
[0130] Correspondingly, based on the correspondence between the preset energy change trend information and the number of audio frames that skip visualization processing, after obtaining the energy change trend information of the corresponding target audio frame, the number of audio frames that need to skip visualization processing can be determined, and then the skipped audio frames that skip visualization processing can be determined based on the number of audio frames, so as to determine the audio frame that needs to be visualized next time based on the skipped audio frame, and perform visualization processing on it.
[0131] For example, when visualization is performed for the first time, the first audio frame of the audio data is taken as the target audio frame for visualization by default. Since there is no audio frame that was visualized last time, the second audio frame in the audio data is determined as a skipped audio frame according to the default number of audio frames that are skipped for visualization, "1". Accordingly, the audio frame that needs to be visualized next time is the third audio frame in the audio data. When visualization is performed for the second time, the third audio frame of the audio data is taken as the target audio frame for visualization. At this time, the historical audio frame is the first audio frame. If the number of audio frames that are skipped for visualization determined according to the energy change trend information of the preset frequency bands of the third audio frame and the first audio frame is 2, the skipped audio frames are the fourth and fifth audio frames in the audio data. Accordingly, the audio frame that needs to be visualized next time is the sixth audio frame in the audio data, and so on.
[0132] Optionally, in one embodiment, the audio visualization method provided by the present invention further includes:
[0133] The spectrum image is updated according to the energy change trend information to obtain an updated spectrum image;
[0134] Shows updated spectrum graph when playback skips audio frames.
[0135] In the embodiment of the present invention, although the skipped audio frame is not visualized as in the above embodiment, the spectrum image of the skipped audio frame is still updated and displayed according to the spectrum image of the corresponding target audio frame.
[0136] After determining the skipped audio frame for skipping visualization processing according to the energy change trend information, the spectrum image is also updated according to the energy change trend information to obtain an updated spectrum image.
[0137] Exemplarily, taking a spectrum image in columnar form as an example, when the spectrum image is updated according to the energy change trend information, the update direction of the column in the spectrum image can be determined according to the change direction described by the energy change trend information. For example, if the change direction described by the change trend information is increasing, then the update direction is increasing. Correspondingly, if the change direction described by the change trend information is decreasing, then the update direction is decreasing.
[0138] In addition, the degree of adjustment of the columns in the spectrum image is determined according to the degree of change described by the energy change trend information, wherein the positive correlation between the two is constrained and the corresponding relationship between the two can be set by ordinary technicians in this field according to actual needs, and the embodiment of the present invention does not limit this.
[0139] Optionally, in one embodiment, before determining the target audio frame in the audio data, the method further includes:
[0140] (1) Identify whether there is a preset user within the visual range of the screen;
[0141] (2) When present, determine the target audio frame in the audio data.
[0142] It should be noted that the present invention takes into account that the purpose of audio visualization is to present the audio visualization to the user. If the user cannot see the visualization effect, there is no need to perform visualization processing.
[0143] Therefore, in the embodiments of this aspect, before determining the target audio frame in the audio data, it is first identified whether there is a preset user (for example, the owner of the network device, or other users authorized by the owner to use the network device) within the visible range of the screen. If so, the target audio frame in the audio data is determined and visualized accordingly. For details, please refer to the relevant description in the above embodiments, which will not be repeated here.
[0144] In addition, when there is no preset user within the visible range of the screen, it is determined that no visualization processing is required, and the visualization processing is performed only when the preset user is recognized to exist within the visible range of the screen.
[0145] It should be noted that the embodiments of the present invention do not limit the method used to identify whether there is a preset user within the visible range of the screen, and ordinary technicians in this field can configure the identification method according to actual needs.
[0146] For example, in an embodiment of the present invention, the front camera of the network device can be used to shoot and obtain a corresponding shot image, and then portrait recognition technology can be used to identify whether there is a preset user in the shot image. If so, it can be determined that the preset user exists within the visible range of the network device screen.
[0147] As can be seen from the above, the present invention determines the target audio frame in the audio data, obtains the target loudness level of the target audio frame, and determines the target weighting strategy corresponding to the target loudness level according to the preset correspondence between the loudness level and the weighting strategy, and then performs weighted processing on the frequency domain data of the target audio frame according to the target weighting strategy to obtain weighted frequency domain data, and finally generates a spectrum image of the target audio frame according to the weighted frequency domain data, and displays the spectrum image. By using different weighting strategies to perform weighted processing on the frequency domain data of the audio according to the loudness of the audio acting on the human ear and then visualizing it, the visualization effect can be made more flexible and more in line with the human ear's hearing.
[0148] The following uses the audio data as a song audio as an example to further illustrate the audio visualization method provided by the present invention. Figure 5 The process of the audio visualization method provided by the present invention can also be as follows:
[0149] In 201, the network device obtains a target audio frame that needs to be visualized in the audio of the currently playing song.
[0150] It should be noted that although the song audio is not stable at the macro level, it is stable at the micro level and has short-term stability. It is generally believed that the song audio is stable in the time period of 10 milliseconds to 30 milliseconds. Based on this, in the embodiment of the present invention, the song audio is visualized in units of frames. For example, please refer to Figure 2 , the song audio can be divided into m audio frames without overlap according to the frame length of 25 milliseconds.
[0151] In the embodiment of the present invention, the network device first determines the target audio frame that needs to be visualized in the currently playing song audio, and obtains the target audio frame for visualization.
[0152] Exemplarily, the network device may determine all audio frames in the song audio as target audio frames that need to be visualized for visualization processing, or may determine some audio frames in the song audio as target audio frames that need to be visualized for visualization processing.
[0153] For example, when a song audio starts playing, the network device obtains the first audio frame of the song audio for visualization processing, and then as the song audio plays, it successively obtains the second audio frame, the third audio frame, and so on, the mth audio frame of the song audio for visualization processing.
[0154] In 202, the network device transforms the target audio frame from the time domain to the frequency domain using Fourier transform to obtain frequency domain data of the target audio frame.
[0155] After obtaining the target audio frame that needs to be visualized, the network device further uses Fourier transform to convert the target audio frame from the time domain to the frequency domain. Among them, the Fourier transform method used to achieve the conversion of the target audio frame from the time domain to the frequency domain can be configured by ordinary technicians in this field according to actual needs. For example, in the embodiment of the present invention, the network device uses short-time Fourier transform to convert the target audio frame from the time domain to the frequency domain, thereby obtaining the frequency domain data of the target audio frame.
[0156] In 203, the network device estimates the loudness level of the target audio frame according to a plurality of different preset loudness estimation strategies to obtain a plurality of candidate loudness levels.
[0157] Exemplarily, the embodiment of the present invention defines two types of loudness estimation strategies, which estimate the loudness level in the time domain and the frequency domain respectively.
[0158] 1. Loudness estimation strategy in the time domain, denoted as preset loudness estimation strategy 1:
[0159] The sound pressure level of the target audio frame is calculated in the time domain, which is equivalent to its loudness level.
[0160] Assuming that the frame length of the target audio frame is N, recorded as x(n), the effective value of the sound pressure of the target audio frame can be expressed as:
[0161]
[0162] Then the sound pressure level of the target audio frame can be expressed as:
[0163]
[0164] Among them, ε r is the reference sound pressure, which can be determined by an ordinary technician in the field according to actual needs. For example, in the embodiment of the present invention, ε r It is 2*10E-5 Pa.
[0165] For example, assuming that the estimated sound pressure level of the target audio frame is 40 dB, it can be equivalent to a loudness level of 40phon.
[0166] 2. Loudness estimation strategy in frequency domain:
[0167] (1) Preset Loudness Estimation Strategy 2
[0168] According to Parseval's theorem, the calculation of the effective value of sound pressure can also be achieved in the frequency domain:
[0169]
[0170] Wherein, X(k) is the frequency domain representation of x(n), such as obtained by Fourier transform.
[0171] In addition, frequency domain weighting is performed on X(k) (the weighting method can be selected by a person skilled in the art according to actual needs). For example, A weighting is adopted by default in the present invention. In this case, A weighting processing needs to be performed on each frequency point of X(k) to obtain new frequency domain data Xa(k). Then, the sound pressure level (equivalent to loudness level) of the target audio frame can be expressed as:
[0172]
[0173] (2) Preset Loudness Estimation Strategy 3
[0174] Based on the concept of loudness, the energy value of the target audio frame at 1KHz is calculated as the sound pressure level of the target audio frame, which is equivalent to its loudness level:
[0175] SPL3=20log 10 (|X(k)| 1000Hz ).
[0176] Taking the three preset loudness estimation strategies mentioned above as examples, the loudness level of the target audio frame is estimated according to preset loudness estimation strategy 1 to obtain a candidate loudness level of the corresponding target audio frame, which is recorded as SPL1; the loudness level of the target audio frame is estimated according to preset loudness estimation strategy 2 to obtain a corresponding candidate loudness level, which is recorded as SPL2; the loudness level of the target audio frame is estimated according to preset loudness estimation strategy 3 to obtain a corresponding candidate loudness level, which is recorded as SPL3.
[0177] In 204, the network device performs weighted summation on the multiple candidate loudness levels according to the weights corresponding to each preset loudness weighting strategy, and uses the obtained weighted sum value as the target loudness level of the target audio frame.
[0178] The embodiment of the present invention pre-assigns a corresponding weight to each preset loudness estimation strategy, with the sum of the weights being constrained to be 1. A person skilled in the art may assign weights to different preset loudness estimation strategies according to actual needs.
[0179] According to the preset loudness estimation strategies 1, 2, and 3, the weighted sum is performed, which is expressed as:
[0180] SPL=a1*SPL1+a2*SPL2+a3*SPL3;
[0181] Among them, SPL represents the weighted sum value obtained by weighted summation, a1 (for example, the value is 0.2) represents the weight corresponding to the preset loudness estimation strategy 1, a2 (for example, the value is 0.3) represents the weight corresponding to the preset loudness estimation strategy, and a3 (for example, the value is 0.5) represents the weight corresponding to the preset loudness estimation strategy.
[0182] After weighted summing is performed on the above candidate loudness levels and a corresponding weighted sum value is obtained, the weighted sum value may be used as the target loudness level of the target audio frame.
[0183] In 205, the network device identifies the currently enabled visualization mode, if the first visualization mode is currently enabled, then the process proceeds to 206, if the second visualization mode is currently enabled, then the process proceeds to 207;
[0184] It should be noted that the embodiment of the present invention provides two visualization modes, namely a first visualization mode and a second visualization mode, and a person skilled in the art may pre-configure the visualization mode enabled by the network device.
[0185] In 206 , the network device determines A-weighting, B-weighting, or C-weighting as a target weighting strategy for weighting the frequency domain data according to the loudness level interval in which the target loudness level is located, and then proceeds to 208 .
[0186] It should be noted that A-weighted is a standard weight curve used for audio measurement, which is used to reflect the response characteristics of the human ear. Since the human ear is not sensitive to sound changes in different frequency bands, the higher or lower the sound is, the less sensitive it is, just like the letter A, so it is called A-weighted. The A-weighted standard was established by the American Standards Association in the 1940s to describe the sensitivity of the human ear to sound changes in different frequency bands. In addition, there are B-weighted and C-weighted. Among them, A-weighted is designed based on the 40phon equal loudness curve, B-weighted is designed based on the 70phon equal loudness curve, and C-weighted is designed based on the 100phon equal loudness curve. The main difference between the three is the degree of attenuation of the low-frequency components of noise. A-weighted has the most attenuation, B-weighted is the second, and C-weighted is the least.
[0187] In the embodiment of the present invention, the loudness level is pre-divided into three intervals, namely, a first preset loudness level interval, a second preset loudness level interval, and a third preset loudness level interval, which correspond to A-weighting, B-weighting, and C-weighting, respectively. When the first visualization mode is enabled, the network device determines A-weighting, B-weighting, or C-weighting as the target weighting strategy for weighting the aforementioned frequency domain data according to the loudness level interval in which the target loudness level is located.
[0188] The endpoints of the first preset loudness level interval, the second preset loudness level interval, and the third preset loudness level interval may be set by a person skilled in the art according to actual needs, and are not specifically limited in the embodiments of the present invention.
[0189] For example, the first preset loudness level interval is (-∞, 55], the second preset loudness level interval is (55, 85], and the third preset loudness level interval is (85, +∞]. Accordingly, when the target loudness level is within (-∞, 55], the A weighting is used as the target weighting strategy to weight the frequency domain data of the target audio frame; when the target loudness level is within (55, 85], the B weighting is used as the target weighting strategy to weight the frequency domain data of the target audio frame; when the target loudness level is within (85, +∞], the C weighting is used as the target weighting strategy to weight the frequency domain data of the target audio frame.
[0190] In 207, the network device obtains an equal loudness curve corresponding to the target loudness level, and determines that the target weighting strategy for weighting the frequency domain data is to perform weighting processing according to an inverse function of the equal loudness curve.
[0191] Please refer to Figure 4 , which is a schematic diagram of the international standard ISO226 equal loudness curve, is a curve of the relationship between the sound pressure level and frequency of pure tones with the same loudness perceived by typical listeners, where the horizontal axis is frequency, the vertical axis is sound pressure level, and the value on the curve represents the loudness level.
[0192] When the second visualization mode is enabled, the network device performs weighted processing on the frequency domain data of the target audio frame according to the equal loudness curve.
[0193] The network device may first obtain an equal loudness curve corresponding to the target loudness level, and correspondingly determine a target weighting strategy to perform weighted processing according to an inverse function of the equal loudness curve.
[0194] For example, taking the equal loudness curve of 40phon as an example, the corresponding value of the equal loudness curve is recorded as SPL(40). The inverse function of the curve is used as the weighted weight, that is,
[0195] Weight(k)=40–SPL(40);
[0196] Among them, the weighted weight Weight (k) unit is dB, and the weighted frequency domain data can be expressed as:
[0197] X_w(k)=Weight(k)*X(k).
[0198] In 208, the network device performs weighted processing on the frequency domain data according to the target weighting strategy to obtain weighted frequency domain data.
[0199] After determining the target weighting strategy for weighted processing of the frequency domain data, the network device can perform weighted processing on the frequency domain data according to the determined target weighting strategy to obtain weighted frequency domain data.
[0200] In 209 , the network device generates a frequency spectrum image corresponding to the target audio frame according to the weighted frequency domain data, and displays the frequency spectrum image.
[0201] After completing the weighted processing of the frequency domain data to obtain weighted frequency domain data, the network device uses the weighted frequency domain data as supporting data for audio visualization display, generates a spectrum image corresponding to the target audio frame according to the weighted frequency domain data according to a preset spectrum graph generation strategy, and displays the spectrum image.
[0202] It should be noted that the present invention does not limit the frequency spectrum generation strategy to be adopted, and can be set by ordinary technicians in the field according to actual needs. For example, the present invention adopts a columnar frequency spectrum generation strategy to generate a columnar frequency spectrum image, and directly displays the columnar frequency spectrum image on the song audio playback interface, such as Figure 3 shown.
[0203] In order to better implement the above audio visualization method, the embodiment of the present invention also provides an audio visualization device. Figure 6 , the audio visualization device includes a target determination module 301, a loudness acquisition module 302, a strategy determination module 303, a data weighting module 304 and a visualization module 305, as follows:
[0204] A target determination module 301 is used to determine a target audio frame in the audio data;
[0205] A loudness acquisition module 302 is used to acquire a target loudness level of a target audio frame;
[0206] A strategy determination module 303, configured to determine a target weighting strategy corresponding to a target loudness level according to a preset correspondence between loudness levels and weighting strategies;
[0207] The data weighting module 304 is used to perform weighted processing on the frequency domain data of the target audio frame according to the target weighting strategy to obtain weighted frequency domain data;
[0208] The visualization module 305 is used to generate a spectrum image of the target audio frame according to the weighted frequency domain data, and display the spectrum image.
[0209] Optionally, in one embodiment, when acquiring the target loudness level of the target audio frame, the loudness acquisition module 302 is configured to:
[0210] The target loudness level of the target audio frame is estimated according to a preset loudness estimation strategy.
[0211] Optionally, in one embodiment, when acquiring the target loudness level of the target audio frame, the loudness acquisition module 302 is configured to:
[0212] The loudness level of the target audio frame is estimated according to a plurality of different preset loudness estimation strategies to obtain a plurality of candidate loudness levels;
[0213] A weighted sum is performed on a plurality of candidate loudness levels according to a weight corresponding to each preset loudness estimation strategy to obtain a target loudness level of the target audio frame.
[0214] Optionally, in one embodiment, when determining a target weighting strategy corresponding to a target loudness level according to a preset correspondence between loudness levels and weighting strategies, the strategy determination module 303 is used to:
[0215] When the target loudness level is within the first preset loudness level interval, determining the target weighting strategy to be A weighting; or,
[0216] When the target loudness level is within the second preset loudness level interval, determining the target weighting strategy to be B weighting; or,
[0217] When the target loudness level is within the third preset loudness level interval, determining the target weighting strategy to be C weighting;
[0218] The first preset loudness level interval is smaller than the second preset loudness level interval, and the second preset loudness level interval is smaller than the third preset loudness level interval.
[0219] Optionally, in one embodiment, when determining a target weighting strategy corresponding to a target loudness level according to a preset correspondence between loudness levels and weighting strategies, the strategy determination module 303 is used to:
[0220] Obtaining an equal loudness curve corresponding to a target loudness level of a target audio frame, and determining an inverse function curve corresponding to the equal loudness curve;
[0221] Find the response level corresponding to the target audio frame in the inverse function curve;
[0222] The found response levels are normalized and then determined as the weighted weights of the target weighting strategy.
[0223] Optionally, in one embodiment, when determining a target audio frame in audio data, the target determination module 301 is used to:
[0224] Sequentially obtain each audio frame in the audio data arranged in time sequence;
[0225] If the currently acquired audio frame is the first audio frame in the audio data, the first audio frame is determined as the target audio frame;
[0226] If the currently acquired audio frame is not the first audio frame in the audio data, the energy change trend information of the audio frame and the previous target audio frame is determined; when the energy change trend information meets the preset conditions, the audio frame is determined as the target audio frame; when the energy change trend information does not meet the preset conditions, the audio frame is determined as a skipped audio frame, and the next audio frame arranged in time sequence in the audio data is returned to be acquired in sequence.
[0227] Optionally, in one embodiment, after determining the audio frame as a skipped audio frame, the target determination module 301 is further configured to:
[0228] Obtain energy change trend information of the target audio frame and the historical audio frame in a preset frequency band, where the historical audio frame is the audio frame that was last visualized;
[0229] Determine the skipped audio frame for skipping visualization processing according to the energy change trend information;
[0230] An audio frame that needs to be visualized next is determined according to the skipped audio frame.
[0231] Optionally, in one embodiment, after determining the audio frame as a skipped audio frame, the visualization module 305 is further configured to:
[0232] The spectrum image is updated according to the energy change trend information to obtain an updated spectrum image;
[0233] Shows updated spectrum graph when playback skips audio frames.
[0234] Optionally, in one embodiment, before determining the target audio frame in the audio data, the target determination module 301 is further configured to:
[0235] Identify whether there is a preset user within the visible range of the screen;
[0236] When present, a target audio frame in the audio data is determined.
[0237] It should be noted that the audio visualization device provided in the embodiment of the present invention and the audio visualization method in the above embodiment belong to the same concept, and any method provided in the audio visualization method embodiment can be run on the audio visualization device. The specific implementation process is detailed in the audio visualization method embodiment, which will not be repeated here.
[0238] The embodiment of the present invention also provides a network device, such as Figure 7 As shown, it shows a schematic diagram of the structure of the network device involved in the embodiment of the present invention, specifically:
[0239] The network device may include one or more processing core processors 401, one or more computer-readable storage media memories 402, a power supply 403, an input unit 404 and other components. A person skilled in the art will understand that Figure 7 The network device structure shown in the figure does not constitute a limitation on the network device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0240] The processor 401 is the control center of the network device. It uses various interfaces and lines to connect various parts of the entire network device. By running or executing software programs and / or modules stored in the memory 402 and calling data stored in the memory 402, it executes various functions of the network device and processes data, thereby monitoring the network device as a whole. Optionally, the processor 401 may include one or more processing cores; preferably, the processor 401 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 401.
[0241] The memory 402 can be used to store software programs and modules. The processor 401 executes various functional applications and data processing by running the software programs and modules stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image display function, etc.), etc.; the data storage area may store data created according to the use of the network device, etc. In addition, the memory 402 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 402 may also include a memory controller to provide the processor 401 with access to the memory 402.
[0242] The network device also includes a power supply 403 for supplying power to each component. Preferably, the power supply 403 can be logically connected to the processor 401 through a power management system, so as to manage charging, discharging, and power consumption through the power management system. The power supply 403 can also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators, and other arbitrary components.
[0243] The network device may further include an input unit 404, which may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.
[0244] Although not shown, the network device may further include a display unit, etc., which will not be described in detail herein. Specifically in this embodiment, the processor 401 in the network device will load the executable file corresponding to the process of one or more application programs into the memory 402 according to the following instructions, and the processor 401 will run the application program stored in the memory 402, thereby executing the audio visualization method provided by the embodiment of the present invention, for example:
[0245] determining a target audio frame in the audio data;
[0246] Get the target loudness level of the target audio frame;
[0247] Determining a target weighting strategy corresponding to the target loudness level according to a preset correspondence between the loudness level and the weighting strategy;
[0248] Performing weighted processing on the frequency domain data of the target audio frame according to the target weighting strategy to obtain weighted frequency domain data;
[0249] Generate a spectrum image of the target audio frame based on the weighted frequency domain data and display the spectrum image.
[0250] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.
[0251] To this end, an embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored. The computer program includes multiple instructions that can be loaded by a processor of a network device to execute the audio visualization method provided by an embodiment of the present invention, for example:
[0252] determining a target audio frame in the audio data;
[0253] Get the target loudness level of the target audio frame;
[0254] Determining a target weighting strategy corresponding to the target loudness level according to a preset correspondence between the loudness level and the weighting strategy;
[0255] Performing weighted processing on the frequency domain data of the target audio frame according to the target weighting strategy to obtain weighted frequency domain data;
[0256] Generate a spectrum image of the target audio frame based on the weighted frequency domain data and display the spectrum image.
[0257] The storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0258] Since the computer program stored in the storage medium can execute the steps in any audio visualization method provided in the embodiments of the present invention, the beneficial effects that can be achieved by any audio visualization method provided in the embodiments of the present invention can be achieved. Please refer to the previous embodiments for details, which will not be repeated here.
[0259] The above is a detailed introduction to an audio visualization method, device and storage medium provided by an embodiment of the present invention. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for ordinary technicians in this field, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as limiting the present invention.
Claims
1. An audio visualization method, characterized in that: include: determining a target audio frame in the audio data; estimating the loudness level of the target audio frame according to a preset loudness estimation strategy to obtain a target loudness level of the target audio frame; Acquire an equal loudness curve corresponding to a target loudness level of the target audio frame, and determine an inverse function curve corresponding to the equal loudness curve; Finding a response level corresponding to the target audio frame in the inverse function curve; The found response levels are normalized and then determined as weighted weights of the target weighting strategy; Performing weighted processing on the frequency domain data of the target audio frame according to the weighted weight of the target weighted strategy to obtain weighted frequency domain data; A frequency spectrum image of the target audio frame is generated according to the weighted frequency domain data, and the frequency spectrum image is displayed.
2. The audio visualization method according to claim 1, characterized in that: The loudness level of the target audio frame is estimated according to a preset loudness estimation strategy to obtain a target loudness level of the target audio frame, including: estimating the loudness level of the target audio frame according to a plurality of different preset loudness estimation strategies respectively to obtain a plurality of candidate loudness levels; The multiple candidate loudness levels are weighted and summed according to the weight corresponding to each preset loudness estimation strategy to obtain the target loudness level of the target audio frame.
3. The audio visualization method according to claim 1, characterized in that: Determine a target audio frame in the audio data, including: Sequentially acquiring audio frames in the audio data that are arranged in time sequence; If the currently acquired audio frame is the first audio frame in the audio data, determining the first audio frame as the target audio frame; If the currently acquired audio frame is not the first audio frame in the audio data, determine the energy change trend information of the audio frame and the previous target audio frame; if the energy change trend information meets the preset conditions, determine the audio frame as the target audio frame; if the energy change trend information does not meet the preset conditions, determine the audio frame as a skipped audio frame, and return to the step of sequentially acquiring the next audio frame arranged in time sequence in the audio data.
4. The audio visualization method according to claim 3, characterized in that: After determining the audio frame as a skipped audio frame, the method further includes: Updating the spectrum image according to the energy change trend information to obtain an updated spectrum image; The updated spectrum image is displayed while playing the skipped audio frame.
5. The audio visualization method according to any one of claims 1 to 4, characterized in that: Generating a frequency spectrum image of the target audio frame according to the weighted frequency domain data includes: Determine a preset number of target audio frames before the target audio frame from among a plurality of audio frames arranged in time sequence in the audio data; Determine the weight corresponding to each target audio frame and the weighted frequency domain data of each target audio frame respectively; Performing weighted calculation on the weighted frequency domain data of each target audio frame according to the weight of each target audio frame to obtain target frequency domain data; A frequency spectrum image of the target audio frame is generated according to the target frequency domain data.
6. The audio visualization method according to claim 5, characterized in that: Before determining the target audio frame in the audio data, the method further includes: Identify whether there is a preset user within the visible range of the screen; When present, a target audio frame in the audio data is determined.
7. An audio visualization device, characterized in that: The audio visualization device comprises: A target determination module, used to determine a target audio frame in the audio data; A loudness acquisition module, configured to estimate the loudness level of the target audio frame according to a preset loudness estimation strategy to obtain a target loudness level of the target audio frame; a strategy determination module, configured to obtain an equal loudness curve corresponding to a target loudness level of the target audio frame, and determine an inverse function curve corresponding to the equal loudness curve; search for a response level corresponding to the target audio frame in the inverse function curve; and determine the found response level as a weighted weight of the target weighting strategy after normalization processing; A data weighting module, used for performing weighted processing on the frequency domain data of the target audio frame according to the target weighting strategy to obtain weighted frequency domain data; An image generation module is used to generate a spectrum image of the target audio frame according to the weighted frequency domain data, and display the spectrum image.
8. A storage medium, characterized in that: The storage medium stores a computer program, and the computer program is loaded by a processor to execute the audio visualization method according to any one of claims 1 to 6.
9. A network device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program in the memory to implement the steps in the audio visualization method according to any one of claims 1 to 6.
