Animation special effects generation method, medium, device and computing equipment
By performing Fourier transforms the audio clips, determining the target frequency and amplitude information of the bass part, and determining the size and frame number of animation effects, the problem that the existing technology cannot visualize the bass part, realizing the visualization of the audio bass part, and improving the user experience.
Patent Information
- Application Number
- CN202111223346.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-20
- Publication Date
- 2025-04-08
- Estimated Expiration
- 2041-10-20
AI Technical Summary
The prior art cannot visualize the bass part when the audio includes a bass part, resulting in a degradation of the user experience.
By performing Fourier transform on the audio clip, it is determined that the target frequency information and target amplitude information of the frequency signal belonging to the bass setting range, and the target size and target frame number of animation effects are determined based on these information, so that the corresponding animation effects are displayed when the audio clip is played.
The bass part of the audio is visualized, enhancing the user's sense of rhythm and interaction when listening to the audio, achieving a new experience of hearing and vision.
Smart Images

Figure CN113920225B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and more specifically, to an animation special effect generation method, medium, device and computing equipment. Background Art
[0002] This section is intended to provide background or context for the technical solutions of the present disclosure stated in the claims. The description herein is not admitted to be prior art by inclusion in this section.
[0003] At present, when a terminal device plays audio, a fixed picture is usually displayed on the screen of the terminal device. The picture displayed on the screen cannot move with the played audio, thereby reducing the user's audio experience.
[0004] To solve the above problem, the prior art displays animation effects according to the speed of the audio rhythm. However, when the audio contains a bass part, the bass part cannot be visualized. Summary of the invention
[0005] The present disclosure provides an animation special effect generation method, medium, device and computing equipment to solve the problem that when the audio contains a bass part, the prior art cannot perform audio visualization on the bass part.
[0006] In a first aspect of the present disclosure, a method for generating an animation special effect is provided, comprising: receiving a playback operation for audio data, the audio data comprising at least one audio segment; in response to the playback operation, obtaining a target frame number corresponding to the audio segment, and a target size of a dynamic special effect displayed when the audio segment is played, wherein both the target size and the target frame number are determined based on a portion of the audio segment that belongs to a bass setting range; when playing the audio segment, displaying the animation special effect corresponding to the audio segment according to the target size and the target frame number corresponding to the audio segment.
[0007] In one embodiment of the present disclosure, the method of obtaining a target number of frames corresponding to an audio clip and a target size of a dynamic special effect displayed when playing the audio clip includes: sampling the audio clip to obtain a plurality of sampling points; performing Fourier transform on the plurality of sampling points to obtain a frequency domain signal corresponding to the audio clip, the frequency domain signal including frequency information and amplitude information corresponding to each sampling point; determining target frequency information of a frequency signal belonging to a bass setting range, and target amplitude information corresponding to the target frequency information; and determining a target size and a target number of frames based on the target frequency information and the target amplitude information.
[0008] In another embodiment of the present disclosure, the target size and the target number of frames are determined according to the target frequency information and the target amplitude information, including: determining a loudness value according to the target frequency information and the target amplitude information; obtaining an amplitude coefficient of the audio data according to the loudness value; determining a target size corresponding to the audio segment according to the amplitude coefficient, the loudness value and the initial size; and determining a target number of frames according to the loudness value.
[0009] In another embodiment of the present disclosure, the loudness value is determined according to the target frequency information and the target amplitude information, including: determining a weighting coefficient corresponding to the target frequency information according to a preset equal loudness curve; determining a weighted loudness value of a corresponding sampling point according to the target amplitude information and the weighting coefficient; and determining a loudness value corresponding to the audio clip according to the weighted loudness values of each sampling point.
[0010] In yet another embodiment of the present disclosure, acquiring the amplitude coefficient of the audio data according to the loudness value includes: determining a maximum loudness value among the loudness values corresponding to the audio segments; and determining the amplitude coefficient of the audio data according to the maximum loudness value and a first threshold.
[0011] In another embodiment of the present disclosure, determining the target frame number according to the loudness value includes: obtaining a frame rate coefficient corresponding to the audio data; determining the number of audio frames of the audio segment according to the loudness value and the frame rate coefficient; and determining the target frame number according to the number of audio frames.
[0012] In still another embodiment of the present disclosure, obtaining a frame rate coefficient corresponding to the audio data includes: determining the frame rate coefficient of the audio data according to a maximum loudness value among loudness values corresponding to each audio segment and a preset second threshold.
[0013] In another embodiment of the present disclosure, the target frame number is determined based on the audio frame number, including: obtaining a set frame number corresponding to the audio segment; if the audio frame number is greater than or equal to the set frame number, determining the audio frame number to be the target frame number; if the audio frame number is less than the set frame number, determining the set frame number to be the target frame number.
[0014] In another embodiment of the present disclosure, the animation effects corresponding to the audio clip are displayed according to the target size and target frame number corresponding to the audio clip, including: when playing audio frames of the target frame number, the animation effects gradually expand from the initial size to the target size, or the animation effects gradually shrink from the target size to the initial size.
[0015] In another embodiment of the present disclosure, the animation of the animation special effect includes a first animation element and a second animation element, the second animation element is arranged on the periphery of the first animation element, the second animation element includes a third animation element of a preset number of circles, and the animation special effect generation method also includes: displaying the third animation element of a preset number of circles, wherein the third animation element of the preset number of circles changes with a delay as the first animation element changes, and the delay time of the change of each circle of the third animation element is positively correlated with the distance from the third animation element to the first animation element.
[0016] In a second aspect of the present disclosure, a computer-readable storage medium is provided, in which computer program instructions are stored. When the computer program instructions are executed, the animation special effect generation method as described in any one of the first aspects above is implemented.
[0017] In a third aspect of the present disclosure, there is provided an animation special effect generating device, comprising:
[0018] A receiving module, configured to receive a playback operation for audio data, where the audio data includes at least one audio segment;
[0019] an acquisition module, configured to acquire, in response to a play operation, a target number of frames corresponding to the audio clip and a target size of a dynamic special effect displayed when the audio clip is played, wherein the target size and the target number of frames are determined based on a portion of the audio clip that belongs to a bass setting range;
[0020] The first display module is used to display the animation effect corresponding to the audio clip according to the target size and target frame number corresponding to the audio clip when playing the audio clip.
[0021] In yet another embodiment of the present disclosure, the acquisition module includes:
[0022] A sampling unit, used for sampling the audio segment to obtain a plurality of sampling points;
[0023] A transform unit, configured to perform Fourier transform on the plurality of sampling points to obtain a frequency domain signal corresponding to the audio segment, wherein the frequency domain signal includes frequency information and amplitude information corresponding to each sampling point;
[0024] A first determining unit, used to determine target frequency information that the frequency signal belongs to a bass setting range, and target amplitude information corresponding to the target frequency information;
[0025] The second determination unit is used to determine the target size and the target frame number according to the target frequency information and the target amplitude information.
[0026] In yet another embodiment of the present disclosure, the second determining unit includes:
[0027] A first determination subunit, used to determine a loudness value according to target frequency information and target amplitude information;
[0028] An acquisition subunit, used to acquire an amplitude coefficient of audio data according to a loudness value;
[0029] A second determination subunit, configured to determine a target size corresponding to the audio segment according to the amplitude coefficient, the loudness value and the initial size;
[0030] The third determining subunit is used to determine a target number of frames according to the loudness value.
[0031] In yet another embodiment of the present disclosure, the first determination subunit is specifically configured to: determine a weighting coefficient corresponding to the target frequency information according to a preset equal loudness curve; determine a weighted loudness value of a corresponding sampling point according to the target amplitude information and the weighting coefficient; and determine a loudness value corresponding to the audio segment according to the weighted loudness values of each sampling point.
[0032] In yet another embodiment of the present disclosure, the acquisition subunit is specifically configured to: determine a maximum loudness value among the loudness values corresponding to the audio segments; and determine an amplitude coefficient of the audio data according to the maximum loudness value and a first threshold.
[0033] In yet another embodiment of the present disclosure, the third determination subunit is specifically used to: obtain a frame rate coefficient corresponding to the audio data; determine the number of audio frames of the audio segment according to the loudness value and the frame rate coefficient; and determine the target number of frames according to the number of audio frames.
[0034] In yet another embodiment of the present disclosure, when acquiring the frame rate coefficient corresponding to the audio data, the third determining subunit is specifically configured to: determine the frame rate coefficient of the audio data according to a maximum loudness value among the loudness values corresponding to the audio segments and a preset second threshold.
[0035] In another embodiment of the present disclosure, when the third determination subunit determines the target frame number based on the audio frame number, it is specifically used to: obtain a set frame number corresponding to the audio segment; if the audio frame number is greater than or equal to the set frame number, determine the audio frame number as the target frame number; if the audio frame number is less than the set frame number, determine the set frame number as the target frame number.
[0036] In another embodiment of the present disclosure, the first display module includes: a display unit, which is used to gradually expand the animation effect from an initial size to a target size, or gradually reduce the animation effect from the target size to the initial size when playing audio frames of a target frame number.
[0037] In another embodiment of the present disclosure, the animation of the animation special effect includes a first animation element and a second animation element, the second animation element is arranged on the periphery of the first animation element, the second animation element includes a third animation element of a preset number of circles, and the animation special effect generating device also includes: a second display module, used to display the third animation element of a preset number of circles, wherein the third animation element of the preset number of circles changes with a delay as the first animation element changes, and the delay time of the change of each circle of the third animation element is positively correlated with the distance from the third animation element to the first animation special effect.
[0038] In a fourth aspect of the present disclosure, a computing device is provided, comprising: a memory and a processor; the memory is used to store program instructions; the processor is used to call the program instructions in the memory to execute the animation special effect generation method as described in any one of the above-mentioned first aspects.
[0039] The present invention determines the target size of the dynamic special effect and the corresponding target number of frames when playing the dynamic special effect through the part of the audio clip that belongs to the bass setting range. The dynamic special effect can be enlarged and reduced rhythmically with the bass part of the audio, thereby visualizing the bass part of the audio, so that the user can "see" the music when listening to the audio, achieving a new auditory and visual experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] The above and other objects, features and advantages of the exemplary embodiments of the present disclosure will become readily understood by reading the detailed description below with reference to the accompanying drawings. In the accompanying drawings, several embodiments of the present disclosure are shown in an exemplary and non-limiting manner, in which:
[0041] Figure 1 A schematic diagram of displaying an animation special effect is schematically shown;
[0042] Figure 2 The application scenario diagram according to the embodiment of the present disclosure is schematically shown;
[0043] Figure 3 The following is a flowchart schematically showing a method for generating an animation special effect according to an embodiment of the present disclosure;
[0044] Figure 4 A flowchart schematically shows a method for generating animation special effects according to another embodiment of the present disclosure;
[0045] Figure 5 The flowchart schematically shows the steps of determining the target size and the target frame number according to an embodiment of the present disclosure;
[0046] Figure 6 A schematic diagram schematically shows an animation special effect display effect according to an embodiment of the present disclosure;
[0047] Figure 7 The structure diagram of a storage medium according to an embodiment of the present disclosure is schematically shown;
[0048] Figure 8 The structure block diagram of the animation special effect generating device according to an embodiment of the present disclosure is schematically shown;
[0049] Fig. 9 The structure block diagram of an electronic device according to an embodiment of the present disclosure is schematically shown.
[0050] In the drawings, the same or corresponding reference numerals represent the same or corresponding parts. DETAILED DESCRIPTION
[0051] The principles and spirit of the present disclosure will be described below with reference to several exemplary embodiments. It should be understood that these embodiments are provided only to enable those skilled in the art to better understand and implement the present disclosure, and are not intended to limit the scope of the present disclosure in any way. On the contrary, these embodiments are provided to make the present disclosure more thorough and complete, and to fully convey the scope of the present disclosure to those skilled in the art.
[0052] Those skilled in the art will appreciate that the embodiments of the present disclosure may be implemented as a system, device, apparatus, method or computer program product. Therefore, the present disclosure may be specifically implemented in the following forms, namely: complete hardware, complete software (including firmware, resident software, microcode, etc.), or a combination of hardware and software.
[0053] According to an embodiment of the present disclosure, a method, medium, apparatus and computing device for generating animation special effects are proposed.
[0054] It should be understood herein that any number of elements in the drawings is for illustration rather than limitation, and any naming is only for distinction rather than having any limiting meaning.
[0055] The principle and spirit of the present disclosure are explained in detail below with reference to several representative embodiments of the present disclosure. SUMMARY OF THE INVENTION
[0057] The inventors have discovered that an animation special effect that vibrates with audio (such as music) is to display a music cover that does not change in a circular area, and a circle of animation effects that vibrates with the rhythm of the music is located outside the circular area. Figure 1When the music "My King" sung by "FJ" is played on the electronic device 10, the relevant information of the played music and the corresponding animation effect 12 are displayed on the display interface 11 of the electronic device 10 at the same time. The animation effect includes the unchanged music cover A and the dynamic effect B. Among them, the animation effect 12 has no obvious rhythm for the bass part of the music, so the dynamic effect B is not different from the dynamic effect of the treble part. As a result, the audio visualization effect cannot be achieved for the bass part of the audio.
[0058] Based on the above problems, the present disclosure provides a method for generating animation special effects, which can display corresponding animation special effects when playing bass audio, thereby improving the visualization effect of the bass audio.
[0059] After introducing the basic principles of the present disclosure, various non-limiting embodiments of the present disclosure are described in detail below.
[0060] Application Scenario Overview
[0061] First reference Figure 2 , is an application scenario diagram of the animation special effects generation method provided by the present disclosure, specifically in Figure 2 The electronic device 20 in the figure is playing "My King" sung by "FJ". The total duration of the music "My King" is 3 minutes and 44 seconds. Figure 2 (a) is played to 20 seconds, at which time the corresponding animation effect 22 is the original size R1 (referring to the radius when the animation effect 22 is the smallest size). Figure 2 In (b), the video is played to 24 seconds, at which time the corresponding animation effect 22 is the target size R2.
[0062] In the present disclosure, for example, when the music played by the electronic device 20 is from 22 seconds to 24 seconds, the animation effect 22 is gradually increased from the original size R1 to the target size R2. When the music is from 24 seconds to 26 seconds, the animation effect 22 can be gradually reduced from the target size R2 to the original size R1, so as to realize the visualization of the bass audio.
[0063] Exemplary Methods
[0064] Combine the following Figure 2 For application scenarios, refer to Figure 3 To describe the method for generating animation special effects according to an exemplary embodiment of the present disclosure. It should be noted that the above application scenarios are only shown to facilitate understanding of the spirit and principles of the present disclosure, and the embodiments of the present disclosure are not limited in this regard. On the contrary, the embodiments of the present disclosure can be applied to any applicable scenario.
[0065] Figure 3A flowchart of a method for generating animation special effects provided by the present disclosure is shown, which specifically includes the following steps:
[0066] S301, receiving a play operation for audio data, where the audio data includes at least one audio segment.
[0067] In the present disclosure, the user selects the audio data to be played through the display interface. Figure 2 In the embodiment of the present invention, the user can search for the song "My King" through the display interface, and then click the play button, and the electronic device plays the song "My King".
[0068] In the present disclosure, the audio data may include only one audio segment. When the duration of the audio data is short, for example, less than 5 seconds, the audio data may include only one audio segment, and the audio segment is subsequently processed.
[0069] In addition, if the duration of the audio clip is long, the audio data can be segmented so that the audio data can include multiple audio clips of the same duration, and then each audio clip is processed, so that each audio clip has a corresponding animation effect, further improving the visualization effect of the audio data. Figure 2 , the duration of the audio data "My King" is 3 minutes and 44 seconds. If the duration of an audio segment is 1 second, the audio data "My King" includes: 224 audio segments. In addition, the duration of each audio segment can also be different, such as the first audio segment is 1 second, the second audio segment is 2 seconds, the third audio segment is 3 seconds, etc. In the embodiment of the present disclosure, the audio data can be divided into multiple audio segments as needed, and the duration and number of the audio segments are not limited here.
[0070] S302, in response to the play operation, obtaining a target number of frames corresponding to the audio clip and a target size of a dynamic special effect displayed when the audio clip is played.
[0071] The target size and the target number of frames are both determined according to a portion of the audio clip that belongs to a bass setting range.
[0072] Specifically, the portion of the bass setting range refers to the portion of the audio segment where the audio frequency is greater than the first frequency threshold and less than or equal to the second frequency threshold. The first frequency threshold can be any value from 15 Hz to 40 Hz, and the second frequency threshold can be any value from 150 Hz to 400 Hz.
[0073] Exemplarily, the audio segment is sampled to obtain a plurality of sampling points, which are usually integer powers of 2, such as 8192. Then, the plurality of sampling points of the audio segment are Fourier transformed to convert the time domain signal of the audio segment into a frequency domain signal. Then, in the frequency domain signal, it is determined that the audio frequency less than or equal to 200 Hz and greater than 20 Hz corresponds to the part of the audio segment that belongs to the bass setting range.
[0074] In the present disclosure, the target size of the dynamic special effects displayed when playing the audio clip and the target number of frames corresponding to the audio clip can be determined in advance according to the bass setting range of the audio clip, and then the corresponding relationship between the audio clip and the target size and the target number of frames is stored. Then, when playing the audio clip, the corresponding target size and target number of frames can be directly obtained.
[0075] S303: When playing the audio clip, display the animation effect corresponding to the audio clip according to the target size and target frame number corresponding to the audio clip.
[0076] Among them, the animation effects can be as follows Figure 2 22, wherein the shape of the animation special effect can be a regular or irregular shape such as a circle, a square or a triangle, which is not limited here. A circle is used as an example in the present disclosure.
[0077] In the present disclosure, an animation effect has an original size, a target size refers to the maximum size that can be reached during the change of the animation effect, and a target frame number refers to the number of frames of the audio clip played while the animation effect gradually increases from the original size to the target size, or gradually decreases from the target size to the original size.
[0078] In addition, each audio clip has its own target size and target frame number, and corresponding animation effects can be displayed based on each audio clip.
[0079] For example, if the duration of the audio data is 3 minutes and 44 seconds, it is divided into 224 audio clips of the same duration, each audio clip is 1 second long, and each audio clip includes 60 audio frames, then it takes 1 / 60 seconds to play one audio frame. If the target size corresponding to the first audio clip is R2, and the target number of frames is 6, then when playing the first 6 audio frames of the first audio clip, the animation effect gradually increases from the original size R1 to the target size R2, and the time used is 6 / 60 seconds, and then when playing the 7th to 12th audio frames of the first audio clip, the animation effect gradually decreases from the target size R2 to the original size R1, that is, the animation effect corresponding to the first audio clip gradually increases from the original size R1 to the target size R2, and then gradually decreases from the target size R2 to the original size R1, and after 5 cycles, the first audio clip is also played.
[0080] If the target size corresponding to the second audio clip is R3 and the target number of frames is 10, then when playing the first 10 audio frames of the second audio clip, the animation effect gradually increases from the original size R1 to the target size R3, and the time used is 10 / 60 seconds. Then when playing the 11th to 20th audio frames of the second audio clip, the animation effect gradually decreases from the target size R3 to the original size R1. In other words, the animation effect corresponding to the second audio clip gradually increases from the original size R1 to the target size R3, and then gradually decreases from the target size R3 to the original size R1. After 3 cycles, the second audio clip is also played. Other audio clips are played in the same way, and animation effects are displayed at the same time.
[0081] The present invention determines the target number of frames and the target size through the bass setting range in the audio clip. When displaying the animation special effects, the bass part of the audio clip can be enlarged and reduced to give the user a vibrating visual experience, thereby enhancing the user's sense of rhythm, interactivity and fun when listening to the audio data.
[0082] The disclosed embodiment determines the target size of the dynamic special effect and the corresponding target number of frames when playing the dynamic special effect through the portion of the audio clip that belongs to the bass setting range. The dynamic special effect can be enlarged and reduced rhythmically with the bass portion of the audio, thereby visualizing the bass portion of the audio. This allows the user to "see" the music while listening to the audio, achieving a new auditory and visual experience.
[0083] Figure 4 A flowchart showing another method for generating animation special effects provided by the present disclosure is shown, which specifically includes the following steps:
[0084] S401: Receive a play operation for audio data, where the audio data includes at least one audio segment.
[0085] The specific implementation method of this step refers to S301 and will not be repeated here.
[0086] S402: In response to the play operation, sample the audio segment to obtain a plurality of sampling points.
[0087] The audio clip is sampled to obtain a time domain signal corresponding to the audio clip. In addition, the number of samples can be determined as needed, usually an integer power of 2.
[0088] S403, performing Fourier transform on the multiple sampling points to obtain a frequency domain signal corresponding to the audio segment.
[0089] The frequency domain signal includes frequency information and amplitude information corresponding to each sampling point.
[0090] In the present disclosure, the time domain signal of the audio clip can be converted into a frequency domain signal by invoking the fast Fourier algorithm to perform Fourier transform on the sampling points. The frequency domain signal refers to the frequency domain signal corresponding to multiple sampling points.
[0091] S404, determining target frequency information that the frequency signal belongs to a bass setting range, and target amplitude information corresponding to the target frequency information.
[0092] The frequency information in the frequency domain signal is less than or equal to the second frequency threshold (which can be any value from 150 Hz to 400 Hz) and greater than the first frequency threshold (which can be any value from 15 Hz to 40 Hz) as the target frequency information, including the target frequency information of multiple target sampling points.
[0093] Furthermore, the target sampling point includes the corresponding target frequency information and target amplitude information. Thus, the target amplitude information belonging to the same target sampling point as the target frequency information is determined, and multiple groups of target frequency information and target amplitude information are obtained.
[0094] S405: Determine a target size and a target number of frames according to the target frequency information and the target amplitude information.
[0095] In this disclosure, reference is made to Figure 5 , S405 specifically includes the following steps:
[0096] S4051: Determine a loudness value according to the target frequency information and the target amplitude information.
[0097] Specifically, determining the loudness value according to the target frequency information and the target amplitude information includes: determining a weighting coefficient corresponding to the target frequency information according to a preset equal loudness curve; determining a weighted loudness value of a corresponding sampling point according to the target amplitude information and the weighting coefficient; and determining a loudness value corresponding to the audio clip according to the weighted loudness values of each sampling point.
[0098] In the present disclosure, equal loudness curves refer to a group of curves with equal subjective perception of sound loudness (loudness level) obtained through subjective measurement. When the loudness of a certain sound is the same as the loudness of a standard sound, the sound intensity level of the standard sound is the loudness level of the sound. The theory of loudness and loudness value was established, and the sounds that feel the same loudness were measured by experimental methods. The resulting set of curves is called equal loudness curves, in which each curve marks sounds with the same loudness, that is, sounds equivalent to a certain loudness level.
[0099] In the equal loudness curve, different target frequency information corresponds to different weighting coefficients, and as the target frequency information increases, the weighting coefficient increases. For example, for an equal loudness area of 40 square meters, when the target frequency information is 20HZ, the corresponding weighting coefficient is 1, and when the target frequency information is 50HZ, the corresponding weighting coefficient is 100.
[0100] Specifically, the target amplitude information t and the target frequency information f of each target sampling point are determined. According to the equal loudness curve, the weighting coefficient n corresponding to the target frequency information f is determined. Then, according to the target amplitude information t and the weighting coefficient n, the weighted loudness value D=t×n of the corresponding sampling point is determined.
[0101] Furthermore, the corresponding sampling point refers to the sampling point corresponding to the target frequency information, that is, the target sampling point mentioned above. The loudness value N is the sum of the weighted loudness values D of each target sampling point. For example, the weighted loudness values of each target sampling point are D1, D2, ..., D M , M is a positive integer. Then N=D1+D2+…+D M .
[0102] In the present disclosure, each audio segment corresponds to a loudness value N. Exemplarily, if the audio data includes 224 audio segments, the audio data corresponds to 224 loudness values.
[0103] S4052: Obtain an amplitude coefficient of the audio data according to the loudness value.
[0104] The step of obtaining the amplitude coefficient of the audio data according to the loudness value includes: determining a maximum loudness value among the loudness values corresponding to the audio segments; and determining the amplitude coefficient of the audio data according to the maximum loudness value and a first threshold.
[0105] Specifically, compare the loudness values N corresponding to the audio clips, and select the maximum loudness value N max The first threshold value is a preset value, and the first threshold value x can be set to be less than 1, for example, the first threshold value x is set to be 0.5. The amplitude coefficient m can be set to be less than or equal to x / N as required. max In the embodiment of the present disclosure, m=x / N max Perform an example.
[0106] In the present disclosure, each audio data has a corresponding amplitude coefficient, and the amplitude coefficients corresponding to the audio segments after the audio data is segmented are the same.
[0107] S4053: Determine a target size corresponding to the audio segment according to the amplitude coefficient, the loudness value, and the initial size.
[0108] The target size R2 = R1×(1+N×m), where R1 is the initial size of the animation effect.
[0109] Exemplarily, in the present disclosure, the audio data includes 224 audio clips, each audio clip has its own corresponding loudness value N, and each audio clip of the same audio data corresponds to the same amplitude coefficient m. Then, when the first threshold x is 0.5, the target size R2 corresponding to the audio clip with the largest loudness value N is at most 1.5 times R1. It can be understood that the larger the loudness value of the audio clip, the larger the target size that the animation special effect can be increased to, further improving the rhythm of the animation special effect vibrating with the audio loudness, and enhancing the user experience.
[0110] S4054: Determine a target number of frames according to the loudness value.
[0111] Determining the target frame number according to the loudness value includes: obtaining a frame rate coefficient corresponding to the audio data; determining the number of audio frames of the audio segment according to the loudness value and the frame rate coefficient; and determining the target frame number according to the number of audio frames.
[0112] Further, obtaining the frame rate coefficient corresponding to the audio data includes: according to the maximum loudness value N among the loudness values corresponding to the audio clips max and a preset second threshold y to determine the frame rate coefficient s of the audio data.
[0113] In the present disclosure, each audio data has a corresponding frame rate coefficient, and the frame rate coefficients corresponding to the audio segments after the audio data is segmented are the same.
[0114] The second threshold y is a preset value, such as 10. The frame rate coefficient s is less than or equal to y / N max In this disclosure, s=y / N is used. max An exemplary description is given. Then the number of audio frames corresponding to each audio segment is V1=N×s, where V1 is an integer less than or equal to the second threshold y.
[0115] Specifically, determining the target frame number according to the audio frame number includes: obtaining a set frame number corresponding to the audio segment; if the audio frame number is greater than or equal to the set frame number, determining the audio frame number to be the target frame number; if the audio frame number is less than the set frame number, determining the set frame number to be the target frame number.
[0116] The set frame number V0 can be pre-set to an integer greater than or equal to 1, such as 4. Then the target frame number V=MAX(V0, V1). The target frame number is the larger value of the set frame number and the audio frame number. This ensures that when the loudness value of the audio clip is very small, the animation special effects can still have obvious changes.
[0117] S406, when playing audio frames of the target frame number, the animation special effect gradually expands from the initial size to the target size, or the animation special effect gradually decreases from the target size to the initial size.
[0118] Specifically, the animation effect corresponds to playing the audio frames of the target frame number within a variation range, wherein a variation range means that the animation effect gradually expands from the initial size to the target size or the animation effect gradually shrinks from the target size to the initial size.
[0119] For example, if the target frame number corresponding to the first audio clip is 6 frames, when the first audio clip is played, a range of the animation effect corresponds to playing 6 audio frames. If the target frame number corresponding to the second audio clip is 10 frames, when the second audio clip is played, a range of the animation effect corresponds to playing 10 audio frames. If the target frame number corresponding to the third audio clip is 4 frames, when the third audio clip is played, a range of the animation effect corresponds to playing 4 audio frames.
[0120] Further, see Figure 6 The animation of the animation special effect 22 includes a first animation element 221 and a second animation element 222, the second animation element 222 is arranged on the periphery of the first animation element 221, and the second animation element 222 includes a preset number of third animation elements (C1, C2 and C3). The animation special effect generation method also includes: displaying the third animation element of the preset number of circles, wherein the third animation element of the preset number of circles changes with a delay as the first animation element changes, and the delay time of each circle of the third animation element change is positively correlated with the distance from the third animation element to the first animation element.
[0121] The delay time of each third animation element can be preset to 0 to 1 second. For example, the delay time of the third animation element C1 is 0.05 seconds, and the third animation element C1 starts to follow the change 0.05 seconds after the first animation element starts to expand or shrink. The delay time of the third animation element C2 is 0.1 seconds, and the third animation element C2 starts to follow the change 0.1 seconds after the first animation element starts to expand or shrink. The delay time of the third animation element C3 is 0.15 seconds, and the third animation element C3 starts to follow the change 0.15 seconds after the first animation element starts to expand or shrink.
[0122] In the present disclosure, the first animation element 221 is displayed in the manner of S406. The second animation element 222 expands with a delay as the first animation element 221 expands, or the second animation element 222 shrinks with a delay as the first animation element 221 shrinks, thereby achieving an effect similar to water ripples, enriching the display effect of the animation special effects.
[0123] The disclosed embodiment determines the target size of the dynamic special effect and the corresponding target number of frames when playing the dynamic special effect through the portion of the audio clip that belongs to the bass setting range. The dynamic special effect can be enlarged and reduced rhythmically with the bass portion of the audio, thereby visualizing the bass portion of the audio. This allows the user to "see" the music while listening to the audio, achieving a new auditory and visual experience.
[0124] Exemplary Media
[0125] After introducing the method of the exemplary embodiment of the present disclosure, next, refer to Figure 7 A storage medium according to an exemplary embodiment of the present disclosure is described.
[0126] refer to Figure 7 As shown, a program product 70 for implementing the above method according to an embodiment of the present disclosure is described, which can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the present disclosure is not limited thereto.
[0127] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0128] The readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, wherein the readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The readable signal medium may also be any readable medium other than a readable storage medium.
[0129] Program code for performing the disclosed operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN).
[0130] Exemplary Devices
[0131] After introducing the medium of the exemplary embodiment of the present disclosure, next, reference is made to Figure 8 An animation special effect generating device according to an exemplary embodiment of the present disclosure is described.
[0132] Figure 8 The structure block diagram of an animation special effect generating device 80 provided by the present disclosure is shown, and the animation special effect generating device 80 includes: a receiving module 81, an acquisition module 82 and a first display module 83. Among them:
[0133] A receiving module 81, configured to receive a playback operation for audio data, where the audio data includes at least one audio segment;
[0134] an acquisition module 82, for acquiring, in response to a play operation, a target number of frames corresponding to the audio clip and a target size of a dynamic special effect displayed when the audio clip is played, wherein the target size and the target number of frames are determined according to a portion of the audio clip that belongs to a bass setting range;
[0135] The first display module 83 is used to display the animation effect corresponding to the audio segment according to the target size and target frame number corresponding to the audio segment when playing the audio segment.
[0136] In one embodiment of the present disclosure, the acquisition module 82 includes:
[0137] A sampling unit, used for sampling the audio segment to obtain a plurality of sampling points;
[0138] A transform unit, configured to perform Fourier transform on the plurality of sampling points to obtain a frequency domain signal corresponding to the audio segment, wherein the frequency domain signal includes frequency information and amplitude information corresponding to each sampling point;
[0139] A first determining unit, used to determine target frequency information that the frequency signal belongs to a bass setting range, and target amplitude information corresponding to the target frequency information;
[0140] The second determination unit is used to determine the target size and the target frame number according to the target frequency information and the target amplitude information.
[0141] In one embodiment of the present disclosure, the second determining unit includes:
[0142] A first determination subunit, used to determine a loudness value according to target frequency information and target amplitude information;
[0143] An acquisition subunit, used to acquire an amplitude coefficient of audio data according to a loudness value;
[0144] A second determination subunit, configured to determine a target size corresponding to the audio segment according to the amplitude coefficient, the loudness value and the initial size;
[0145] The third determining subunit is used to determine a target number of frames according to the loudness value.
[0146] In yet another embodiment of the present disclosure, the first determination subunit is specifically configured to: determine a weighting coefficient corresponding to the target frequency information according to a preset equal loudness curve; determine a weighted loudness value of a corresponding sampling point according to the target amplitude information and the weighting coefficient; and determine a loudness value corresponding to the audio segment according to the weighted loudness values of each sampling point.
[0147] In yet another embodiment of the present disclosure, the acquisition subunit is specifically configured to: determine a maximum loudness value among the loudness values corresponding to the audio segments; and determine an amplitude coefficient of the audio data according to the maximum loudness value and a first threshold.
[0148] In yet another embodiment of the present disclosure, the third determination subunit is specifically used to: obtain a frame rate coefficient corresponding to the audio data; determine the number of audio frames of the audio segment according to the loudness value and the frame rate coefficient; and determine the target number of frames according to the number of audio frames.
[0149] In yet another embodiment of the present disclosure, when acquiring the frame rate coefficient corresponding to the audio data, the third determining subunit is specifically configured to: determine the frame rate coefficient of the audio data according to a maximum loudness value among the loudness values corresponding to the audio segments and a preset second threshold.
[0150] In another embodiment of the present disclosure, when the third determination subunit determines the target frame number based on the audio frame number, it is specifically used to: obtain a set frame number corresponding to the audio segment; if the audio frame number is greater than or equal to the set frame number, determine the audio frame number as the target frame number; if the audio frame number is less than the set frame number, determine the set frame number as the target frame number.
[0151] In another embodiment of the present disclosure, the first display module 83 includes: a display unit, which is used to gradually expand the animation effect from an initial size to a target size, or gradually reduce the animation effect from a target size to an initial size when playing audio frames of a target frame number.
[0152] In another embodiment of the present disclosure, the animation of the animation special effect includes a first animation element and a second animation element, the second animation element is arranged on the periphery of the first animation element, the second animation element includes a third animation element of a preset number of circles, and the animation special effect generating device 80 also includes: a second display module (not shown), used to display the third animation element of a preset number of circles, wherein the third animation element of the preset number of circles changes with a delay as the first animation element changes, and the delay time of the change of each circle of the third animation element is positively correlated with the distance from the third animation element to the first animation special effect.
[0153] The multimedia processing device provided by the present disclosure can execute Figure 3 and / or Figure 4 The multimedia processing method shown, for specific content, refer to the description of the above multimedia processing method, which will not be repeated here.
[0154] Exemplary Computing Devices
[0155] After introducing the method, medium and apparatus of the exemplary embodiments of the present disclosure, next, reference is made to Fig. 9 A computing device according to an exemplary embodiment of the present disclosure is described.
[0156] Fig. 9 The computing device 90 shown is only an example and should not bring any limitation to the functionality and scope of use of the embodiments of the present disclosure.
[0157] like Fig. 9 As shown, the computing device 90 is in the form of a general computing device. The components of the computing device 90 may include but are not limited to: at least one processing unit 91, at least one storage unit 92, and a bus 93 connecting different system components (including the processing unit 91 and the storage unit 92).
[0158] The bus 93 includes a data bus, a control bus, and an address bus.
[0159] The storage unit 92 may include a readable medium in the form of a volatile memory, such as a random access memory (RAM) 921 and / or a cache memory 922 , and may further include a readable medium in the form of a non-volatile memory, such as a read-only memory (ROM) 923 .
[0160] The storage unit 92 may also include a program / utility 925 having a set (at least one) of program modules 924, such program modules 924 including but not limited to: an operating system, one or more application programs, other program modules and program data, each of which or some combination may include an implementation of a network environment.
[0161] The computing device 90 may also communicate with one or more external devices 94 (e.g., keyboards, pointing devices, etc.). Such communication may be performed via an input / output (I / O) interface 95. Furthermore, the computing device 90 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 96. Fig. 9 As shown, the network adapter 96 communicates with other modules of the computing device 90 via the bus 93. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with the computing device 90, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0162] It should be noted that although several units / modules or sub-units / modules of the motion effect generation device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more units / modules described above can be concretized in one unit / module. Conversely, the features and functions of one unit / module described above can be further divided to be concretized by multiple units / modules.
[0163] In addition, although the operations of the disclosed method are described in a specific order in the drawings, this does not require or imply that the operations must be performed in this specific order, or that all the operations shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.
[0164] Although the spirit and principle of the present disclosure have been described with reference to several specific embodiments, it should be understood that the present disclosure is not limited to the disclosed specific embodiments, and the division of various aspects does not mean that the features in these aspects cannot be combined to benefit, and such division is only for the convenience of expression. The present disclosure is intended to cover various modifications and equivalent arrangements included in the spirit and scope of the attached claims.
Claims
1. A method for generating animation special effects, comprising: Receiving a play operation for audio data, wherein the audio data includes at least one audio segment; In response to the playing operation, sampling the audio segment to obtain a plurality of sampling points; Performing Fourier transform on the multiple sampling points to obtain a frequency domain signal corresponding to the audio segment, wherein the frequency domain signal includes frequency information and amplitude information corresponding to each sampling point; Determine target frequency information that the frequency information belongs to a bass setting range, and target amplitude information corresponding to the target frequency information; Determining a loudness value according to the target frequency information and the target amplitude information; According to the loudness value, an amplitude coefficient of the audio data is obtained; the amplitude coefficient is less than or equal to the ratio of a preset first threshold value to a maximum loudness value; The maximum loudness value is the maximum loudness value among the loudness values corresponding to the audio clips; Determining a target size corresponding to the audio segment according to the amplitude coefficient, the loudness value and the initial size; Determine a target number of frames according to the loudness value, wherein the target size and the target number of frames are determined according to a portion of the audio clip that belongs to a bass setting range; the target number of frames refers to the number of frames of the audio clip that the animation special effect gradually increases from the original size to the target size, or gradually decreases from the target size to the original size, while playing the audio clip; When playing the audio clip, the animation effect corresponding to the audio clip is displayed according to the target size and target frame number corresponding to the audio clip.
2. The method for generating animation special effects according to claim 1, wherein determining the loudness value according to the target frequency information and the target amplitude information comprises: Determining a weighting coefficient corresponding to the target frequency information according to a preset equal loudness curve; Determining a weighted loudness value of a corresponding sampling point according to the target amplitude information and the weighting coefficient; The loudness value corresponding to the audio segment is determined according to the weighted loudness value of each sampling point.
3. The method for generating animation special effects according to claim 1, wherein determining the target number of frames according to the loudness value comprises: determining a frame rate coefficient of the audio data according to a maximum loudness value among the loudness values corresponding to the audio clips and a preset second threshold; Determining the number of audio frames of the audio segment according to the loudness value and the frame rate coefficient; Obtaining a set number of frames corresponding to the audio clip; If the number of audio frames is greater than or equal to the set number of frames, determining the number of audio frames to be the target number of frames; If the audio frame number is less than the set frame number, the set frame number is determined to be the target frame number.
4. The method for generating an animation special effect according to any one of claims 1 to 3, wherein displaying the animation special effect corresponding to the audio clip according to a target size and a target frame number corresponding to the audio clip comprises: When playing the audio frames of the target frame number, the animation special effect gradually expands from the initial size to the target size, or the animation special effect gradually shrinks from the target size to the initial size.
5. The method for generating an animation special effect according to any one of claims 1 to 3, wherein the animation of the animation special effect comprises a first animation element and a second animation element, wherein the second animation element is arranged at the periphery of the first animation element, and the second animation element comprises a third animation element of a preset number of circles, and the method for generating an animation special effect further comprises: The third animation element of the preset number of circles is displayed, wherein the third animation element of the preset number of circles changes with a delay as the first animation element changes, and the delay time of the change of the third animation element in each circle is positively correlated with the distance from the third animation element to the first animation element.
6. A computer-readable storage medium, wherein computer program instructions are stored in the computer-readable storage medium, and when the computer program instructions are executed, the animation special effect generation method according to any one of claims 1 to 5 is implemented.
7. An animation special effect generating device, comprising: A receiving module, configured to receive a playback operation for audio data, wherein the audio data includes at least one audio segment; an acquisition module, configured to acquire, in response to the playing operation, a target number of frames corresponding to the audio clip and a target size of a dynamic special effect displayed when the audio clip is played, wherein the target size and the target number of frames are determined according to a portion of the audio clip that belongs to a bass setting range; A first display module, configured to display an animation effect corresponding to the audio clip according to a target size and a target frame number corresponding to the audio clip when playing the audio clip; The acquisition module comprises: A sampling unit, used for sampling the audio segment to obtain a plurality of sampling points; a transform unit, configured to perform Fourier transform on the plurality of sampling points to obtain a frequency domain signal corresponding to the audio segment, wherein the frequency domain signal includes frequency information and amplitude information corresponding to each sampling point; A first determining unit, configured to determine target frequency information that the frequency information belongs to the bass setting range, and target amplitude information corresponding to the target frequency information; A second determination unit is used to determine the target size and the target number of frames according to the target frequency information and the target amplitude information; the target number of frames refers to the number of frames of the audio clip played when the animation special effect gradually increases from the original size to the target size, or gradually decreases from the target size to the original size; The second determining unit includes: A first determination subunit, configured to determine a loudness value according to the target frequency information and the target amplitude information; an acquisition subunit, configured to acquire an amplitude coefficient of the audio data according to the loudness value; the amplitude coefficient is less than or equal to a ratio of a preset first threshold value to a maximum loudness value; the maximum loudness value is a maximum loudness value among the loudness values corresponding to the audio segments; A second determining subunit, configured to determine a target size corresponding to the audio segment according to the amplitude coefficient, the loudness value and the initial size; The third determining subunit is configured to determine the target number of frames according to the loudness value.
8. The animation special effect generating device according to claim 7, wherein the first determining subunit is specifically configured to: Determining a weighting coefficient corresponding to the target frequency information according to a preset equal loudness curve; Determining a weighted loudness value of a corresponding sampling point according to the target amplitude information and the weighting coefficient; The loudness value corresponding to the audio segment is determined according to the weighted loudness value of each sampling point.
9. The animation special effect generating device according to claim 7, wherein the third determining subunit is specifically used for: determining a frame rate coefficient of the audio data according to a maximum loudness value among the loudness values corresponding to the audio clips and a preset second threshold; Determining the number of audio frames of the audio segment according to the loudness value and the frame rate coefficient; Obtaining a set number of frames corresponding to the audio clip; If the number of audio frames is greater than or equal to the set number of frames, determining the number of audio frames to be the target number of frames; If the audio frame number is less than the set frame number, the set frame number is determined to be the target frame number.
10. The animation special effect generating device according to any one of claims 7 to 9, wherein the first display module comprises: The display unit is used for gradually expanding the animation effect from an initial size to the target size, or gradually reducing the animation effect from the target size to the initial size when playing the audio frames of the target frame number.
11. The animation special effect generating device according to any one of claims 7 to 9, wherein the animation of the animation special effect comprises a first animation element and a second animation element, the second animation element is arranged at the periphery of the first animation element, the second animation element comprises a third animation element of a preset number of circles, and the animation special effect generating device further comprises: The second display module is used to display the third animation element of the preset number of circles, wherein the third animation element of the preset number of circles changes with a delay as the first animation element changes, and the delay time of the change of the third animation element in each circle is positively correlated with the distance from the third animation element to the first animation special effect.
12. A computing device comprising: Memory and processor; The memory is used to store program instructions; The processor is used to call the program instructions in the memory to execute the animation special effect generation method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Desktop wallpaper presentation method and device, storage medium and equipment
CN112799770A