Audio dynamic effect display method and device, medium and computing equipment

By using the camera area to display audio animations in the terminal device, and combining audio data and camera space information for dynamic adjustment, the problem of audio programs occupying screen space is solved, and audio playback performance and user experience are improved.

CN118869864APending Publication Date: 2024-10-29HANGZHOU NETEASE CLOUD MUSIC TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410927713.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-10
Publication Date
2024-10-29

AI Technical Summary

Technical Problem

Existing audio programs occupy a large screen space in terminal devices, affecting audio playback performance and user experience. Especially when users need to use other applications or folding screen terminals, audio animations cannot be displayed.

Method used

By determining the display area based on the camera area of ​​the terminal device, and combining audio data and camera spatial orientation information to generate audio animations, the animations can follow changes in the camera position, dynamically adjust the display position, save screen space and improve audio playback performance.

Benefits of technology

It effectively saves the screen space of the terminal device, improves the audio playback performance, and provides a better user experience. Especially in the case of folding screen terminals or screen rotation, the display of audio animations can be dynamically adjusted.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118869864A_ABST
    Figure CN118869864A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an audio dynamic effect display method and device, a medium and computing equipment, and relates to the technical field of audio. The audio dynamic effect display method comprises the following steps: determining a display area for displaying an audio dynamic effect according to a camera area of terminal equipment; generating an audio dynamic effect about the audio data according to the audio data of the terminal equipment and the spatial orientation information of the camera; and displaying the audio dynamic effect of the audio data in the display area. According to the method, the display position of the audio dynamic effect is determined by using the camera area, and the audio dynamic effect is generated and displayed in combination with the audio data and the camera spatial orientation information, so that the dynamic effect dynamically changes the position along with the camera of which the position is changed due to screen rotation, the screen space of the terminal is effectively saved, and the user experience is improved. And the audio playing performance of the terminal is improved, and better experience is brought to the user.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present disclosure relate to the field of audio technology, and more specifically, the embodiments of the present disclosure relate to audio dynamic effect display methods, media, devices and computing devices. Background Art

[0002] This section is intended to provide a background or context to the embodiments of the present disclosure. No description herein is admitted to be prior art by virtue of its inclusion in this section.

[0003] Currently, mainstream audio programs can provide users with the display of audio animation effects. The display method is mainly on the screen of the terminal device, which requires a large screen space of the terminal. When the user needs to use other applications, the audio display animation needs to be turned off, which will affect the audio playback performance and reduce the user experience.

[0004] Therefore, there is an urgent need to provide a technical solution that can effectively save the screen space of the terminal and improve the audio playback performance of the terminal. Summary of the invention

[0005] The present disclosure provides an audio dynamic effect display method, medium, device and computing equipment to solve the problem that audio dynamic effects need to occupy a large screen space.

[0006] In a first aspect of an embodiment of the present disclosure, a method for displaying an audio animation is provided, comprising: determining a display area for displaying audio animations based on a camera area of ​​a terminal device; generating audio animations about the audio data based on audio data of the terminal device and spatial orientation information of the camera; and displaying the audio animations of the audio data in the display area.

[0007] In one embodiment of the present disclosure, the generating of audio effects regarding the audio data based on the audio data of the terminal device and the spatial orientation information of the camera includes: determining the screen display information of the audio effects based on the audio data of the terminal device; determining the direction display information of the audio effects based on the spatial orientation information of the camera; and generating the audio effects regarding the audio data based on the screen display information and the direction display information.

[0008] In another embodiment of the present disclosure, the audio animation includes at least one animation block group, and the animation block group includes a plurality of blocks arranged in parallel, and each of the blocks includes at least one of the following properties: color, transparency, width, height, shape, and spacing between other blocks.

[0009] In another embodiment of the present disclosure, determining the screen display information of the audio animation based on the audio data of the terminal device includes: determining the attribute information of each block in the animation block group based on the audio data of the terminal device, so as to determine the screen display information of the audio animation based on the attribute information.

[0010] In another embodiment of the present disclosure, determining the direction display information of the audio motion effect based on the spatial orientation information of the camera includes: determining the direction information of each block in the motion effect block group based on the spatial orientation information of the camera, so as to determine the direction display information of the audio motion effect based on the direction information.

[0011] In another embodiment of the present disclosure, the method also includes: obtaining an attribute information array of each preset attribute, the attribute information array including a drawing attribute value for each block; determining the attribute information of each block in the motion effect block group based on the audio data of the terminal device, including: determining the block to be drawn in the motion effect block group based on the audio data of the terminal device; extracting the corresponding drawing attribute value from the attribute information array, and assigning the drawing attribute value to the block to be drawn to obtain an assignment result; determining the attribute information of each block in the motion effect block group based on the assignment result.

[0012] In another embodiment of the present disclosure, determining the screen display information of the audio animation based on the audio data of the terminal device includes: performing a fast Fourier transform on the audio data according to a fast Fourier transform algorithm at every first preset time interval to determine the decibel value of each frequency domain; acquiring an animation waveform regarding the audio data according to the decibel value of each frequency domain; and determining the screen display information of the audio animation based on the animation waveform.

[0013] In another embodiment of the present disclosure, the method further includes: obtaining predefined animation display stages, the animation display stages including a display stage for transitioning between a last acquired animation waveform and a current animation waveform, and a display stage for transitioning between a current animation waveform and a random animation waveform, each stage having a time difference of a second preset time interval; determining the screen display information of the audio animation based on the animation waveform, includes: determining the screen display information of the audio animation based on the animation display stage and the animation waveform.

[0014] In another embodiment of the present disclosure, the method also includes: obtaining audio cover information of the terminal device, the audio cover information including cover color information of each area in the audio cover; generating audio effects about the audio data based on the audio data of the terminal device and the spatial orientation information of the camera, including: generating audio effects about the audio data based on the audio cover information, the audio data of the terminal device and the spatial orientation information of the camera.

[0015] In another embodiment of the present disclosure, the audio effect about the audio data is generated based on the audio cover information, the audio data of the terminal device and the spatial orientation information of the camera, including: if the spatial orientation information of the camera is a reverse orientation, obtaining the cover color information of the top area of ​​the audio cover; generating the audio effect about the audio data based on the cover color information of the top area and the audio data.

[0016] In another embodiment of the present disclosure, the audio effect about the audio data is generated based on the audio cover information, the audio data of the terminal device and the spatial orientation information of the camera, including: if the spatial orientation information of the camera is a forward orientation, obtaining the cover color information of the bottom area of ​​the audio cover; generating an audio effect about the audio data based on the cover color information of the bottom area and the audio data.

[0017] In yet another embodiment of the present disclosure, the method further includes: acquiring a camera area of ​​the terminal device according to a preset application program interface method.

[0018] In yet another embodiment of the present disclosure, the application programming interface method includes a method for obtaining a screen notch;

[0019] The method of obtaining the camera area of ​​the terminal device according to a preset application programming interface method includes: calling the method of obtaining the right side of safe insertion and / or the method of obtaining the left side of safe insertion in the method of obtaining the screen notch to determine the area position of the camera in the screen of the terminal device; calling the method of obtaining the left side boundary rectangle and / or the method of obtaining the right side boundary rectangle in the method of obtaining the screen notch to determine the area size of the camera in the screen of the terminal device; and obtaining the camera area according to the area position and the area size.

[0020] In another embodiment of the present disclosure, determining the display area for displaying audio motion effects based on the camera area of ​​the terminal device includes: determining a blank area in the camera area of ​​the terminal device except for the area containing the camera; and determining the blank area as the display area for displaying audio motion effects.

[0021] In a second aspect of the embodiments of the present disclosure, a computer-readable storage medium is provided, comprising: the computer-readable storage medium stores computer execution instructions, and the computer execution instructions, when executed by a processor, are used to implement the audio animation display method provided in any one of the first aspects above.

[0022] In a third aspect of the embodiments of the present disclosure, an audio motion effect display device is provided, the device comprising: an area determination module, for determining a display area for displaying audio motion effects according to a camera area of ​​a terminal device; a motion effect generation module, for generating audio motion effects about the audio data according to the audio data of the terminal device and the spatial orientation information of the camera; and a display module, for displaying the audio motion effects of the audio data in the display area.

[0023] In one embodiment of the present disclosure, the motion effect generation module includes: a picture determination unit, used to determine the picture display information of the audio motion effect according to the audio data of the terminal device; a direction determination unit, used to determine the direction display information of the audio motion effect according to the spatial orientation information of the camera; a first generation unit, used to generate an audio motion effect about the audio data according to the picture display information and the direction display information.

[0024] In another embodiment of the present disclosure, the audio animation includes at least one animation block group, and the animation block group includes a plurality of blocks arranged in parallel, and each of the blocks includes at least one of the following properties: color, transparency, width, height, shape, and spacing between other blocks.

[0025] In another embodiment of the present disclosure, the picture determination unit is specifically used to determine the attribute information of each block in the motion effect block group according to the audio data of the terminal device, so as to determine the picture display information of the audio motion effect according to the attribute information.

[0026] In another embodiment of the present disclosure, the direction determination unit is specifically used to determine the direction information of each of the blocks in the motion effect block group according to the spatial orientation information of the camera, so as to determine the direction display information of the audio motion effect according to the direction information.

[0027] In another embodiment of the present disclosure, the device also includes: an array acquisition module, used to obtain an attribute information array of each preset attribute, the attribute information array including a drawing attribute value for each block; determining the attribute information of each block in the motion effect block group according to the audio data of the terminal device, including: determining the block to be drawn in the motion effect block group according to the audio data of the terminal device; extracting the corresponding drawing attribute value from the attribute information array, and assigning the drawing attribute value to the block to be drawn to obtain an assignment result; determining the attribute information of each block in the motion effect block group according to the assignment result.

[0028] In another embodiment of the present disclosure, the picture determination unit is specifically used to: perform fast Fourier transform on the audio data according to a fast Fourier transform algorithm at every first preset time interval to determine the decibel value of each frequency domain; obtain a motion effect waveform about the audio data according to the decibel value of each frequency domain; and determine the picture display information of the audio motion effect according to the motion effect waveform.

[0029] In another embodiment of the present disclosure, the device also includes: a stage acquisition module, used to acquire predefined animation display stages, the animation display stages include a display stage for transitioning between a last acquired animation waveform and a current animation waveform, and a display stage for transitioning between a current animation waveform and a random animation waveform, each stage having a time difference of a second preset time interval; determining the screen display information of the audio animation based on the animation waveform includes: determining the screen display information of the audio animation based on the animation display stage and the animation waveform.

[0030] In another embodiment of the present disclosure, the device also includes: a cover acquisition module, used to acquire audio cover information of the terminal device, the audio cover information including cover color information of each area in the audio cover; the motion effect generation module includes: a second generation unit, used to generate audio motion effects about the audio data based on the audio cover information, the audio data of the terminal device and the spatial orientation information of the camera.

[0031] In another embodiment of the present disclosure, the second generating unit is specifically used to obtain the cover color information located in the top area of ​​the audio cover when the spatial orientation information of the camera is a reverse orientation; and generate an audio animation about the audio data based on the cover color information of the top area and the audio data.

[0032] In another embodiment of the present disclosure, the second generating unit is specifically used to obtain the cover color information located in the bottom area of ​​the audio cover when the spatial orientation information of the camera is in the forward orientation; and generate an audio animation about the audio data based on the cover color information of the bottom area and the audio data.

[0033] In yet another embodiment of the present disclosure, the apparatus further includes: an area acquisition module, configured to acquire a camera area of ​​the terminal device according to a preset application program interface method.

[0034] In another embodiment of the present disclosure, the application programming interface method includes a method for obtaining a screen recess; the area acquisition module includes: an area position determination unit, used to call the method for obtaining a safe insertion right side and / or the method for obtaining a safe insertion left side in the method for obtaining a screen recess, to determine the area position of the camera in the screen of the terminal device; an area size determination unit, used to call the method for obtaining a left boundary rectangle and / or the method for obtaining a right boundary rectangle in the method for obtaining a screen recess, to determine the area size of the camera in the screen of the terminal device; and acquiring the camera area according to the area position and the area size.

[0035] In another embodiment of the present disclosure, the area determination module is specifically used to: determine a blank area in the camera area of ​​the terminal device except for the area including the camera; and determine the blank area as a display area for displaying audio effects.

[0036] In a fourth aspect of an embodiment of the present disclosure, a computing device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the computing device executes the audio animation display method provided in any one of the first aspects above.

[0037] According to the audio dynamic effect display method, medium, device and computing device of the embodiment of the present disclosure, the display area for displaying the audio dynamic effect is determined according to the camera area of ​​the terminal device, and the audio dynamic effect about the audio data is generated according to the audio data of the terminal device and the spatial orientation information of the camera, and the audio dynamic effect of the audio data is displayed in the display area. In this process, the display position of the audio dynamic effect is determined by the camera area, and the audio dynamic effect is generated and displayed in combination with the audio data and the spatial orientation information of the camera, so that the dynamic effect can dynamically change its position following the camera whose position changes due to screen rotation, effectively saving the screen space of the terminal, and improving the audio playback performance of the terminal, bringing a better experience to the user. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] 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:

[0039] Figure 1 One of the application scenario diagrams according to the embodiment of the present disclosure is schematically shown;

[0040] Figure 2 One of the application scenario diagrams according to the embodiment of the present disclosure is schematically shown;

[0041] Figure 3 One of the flowcharts of an audio display method provided according to an embodiment of the present disclosure is schematically shown;

[0042] Figure 4 Schematically shows Figure 3 Schematic diagram of the process of step S302;

[0043] Figure 5 One of the example diagrams of audio animation is schematically shown;

[0044] Figure 6 The second example diagram of the audio animation effect is schematically shown;

[0045] Figure 7a The third example diagram schematically shows an audio animation effect;

[0046] Figure 7b The fourth example diagram schematically shows an audio motion effect;

[0047] Figure 7c The fifth example diagram schematically shows an audio animation effect;

[0048] Figure 7d The sixth example diagram schematically shows an audio motion effect;

[0049] Figure 7e The seventh example diagram schematically shows an audio motion effect;

[0050] Figure 8 A schematic diagram of a flow chart of another audio display method provided by an embodiment of the present disclosure is shown;

[0051] Fig. 9 The structure diagram of a computer-readable storage medium provided by an embodiment of the present disclosure is schematically shown;

[0052] Fig.10 The structure diagram of an audio display device provided by an embodiment of the present disclosure is schematically shown;

[0053] Fig.11 The structure diagram of a computing device according to an embodiment of the present disclosure is schematically shown;

[0054] In the drawings, the same or corresponding reference numerals represent the same or corresponding parts. DETAILED DESCRIPTION

[0055] 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.

[0056] 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.

[0057] According to an embodiment of the present disclosure, an audio dynamic effect display method, medium, apparatus and computing device are proposed.

[0058] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0059] In addition, any number of elements in the drawings is for illustration and not limitation, and any naming is only for distinction and does not have any limiting meaning.

[0060] 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

[0062] The inventors have found that the current display mode of audio effects is mainly displayed on the screen of the terminal device, which takes up a large screen space of the terminal. When the user needs to use other applications, the audio effects display needs to be turned off to provide the user with operational convenience. In addition, in the scenario where the user needs to turn off the terminal screen (the terminal device is low on power), or for some folding screen terminals (such as folding screen mobile phones), when the user folds the folding screen terminal, the terminal screen temporarily does not provide a display function. In these cases, the audio effects cannot be displayed, thereby affecting the audio playback performance and reducing the user experience.

[0063] To this end, the embodiments of the present disclosure provide an audio dynamic effect display method, medium, device and computing device, which determines the display area for displaying audio dynamic effects according to the camera area of ​​the terminal device, and generates audio dynamic effects about the audio data according to the audio data of the terminal device and the spatial orientation information of the camera, and displays the audio dynamic effects of the audio data in the display area. In this process, the display position of the audio dynamic effect is determined by the camera area, and the audio dynamic effect is generated and displayed in combination with the audio data and the spatial orientation information of the camera, so that the dynamic effect can dynamically change its position following the camera whose position changes due to screen rotation, effectively saving the screen space of the terminal and improving the audio playback performance of the terminal.

[0064] After introducing the basic principles of the present disclosure, various non-limiting embodiments of the present disclosure are described in detail below.

[0065] Application Scenario Overview

[0066] First reference Figure 1 and Figure 2 The application scenarios of the solution provided by the present disclosure are illustrated by examples. Take the application in a mobile phone (in other application scenarios, it can also be other terminal devices, such as tablet computers, folding screen computers, smart watches, etc.) as an example, where Figure 1 This is an example diagram for foldable screen mobile phones. Figure 2 This is an example diagram applied to a flat-screen mobile phone.

[0067] like Figure 1 As shown, a foldable screen mobile phone 10 is included. Optionally, the foldable screen mobile phone includes an inner screen and an outer screen. The camera area can be located on the outer screen of the foldable screen mobile phone 10, that is, the audio dynamic effect is displayed using the external camera area (in some application scenarios, the audio dynamic effect can also be displayed using the built-in camera area of ​​the inner screen). When the user folds the mobile phone, the audio dynamic effect is displayed in the external camera area to enhance the user's audio playback experience, such as Figure 2As shown, a tablet screen mobile phone 20 is included, and the tablet screen mobile phone also includes an inner screen and an outer screen. The camera area can be located on the inner screen of the tablet screen mobile phone 20, that is, the external camera area is used to display audio effects (in some application scenarios, the external camera area of ​​the external screen can also be used to display audio effects). When the user turns off the mobile phone screen or operates other applications on the mobile phone screen, the built-in camera area is used to display audio effects to enhance the user's audio playback experience. Optionally, the camera in the camera area can include one or more cameras. The embodiment of the present disclosure takes two cameras as an example.

[0068] It should be noted that the above Figure 1 and Figure 2 This is only a schematic diagram of possible application scenarios provided by the embodiments of the present disclosure. Figure 1 and Figure 2 The devices included in the embodiment of the present disclosure are specifically limited, and the solution provided by the embodiment of the present disclosure can be applied to the above Figure 1 or Figure 2 In addition to devices, the present invention can also be applied to any terminal product that includes a camera area, such as computers, Moving Picture experts group audiolayer III (MP3) players, Moving Picture experts group audio layer IV (MP4) players, portable computers, car computers, wearable devices, desktop computers, smart TVs, etc. The embodiments of the present invention are only exemplified based on the above-mentioned folding screen mobile phones and flat screen mobile phones.

[0069] Exemplary Methods

[0070] The following describes the audio dynamic effect display method according to the exemplary embodiment of the present disclosure in combination with the above application scenarios. 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.

[0071] Figure 3 is a flowchart of an audio dynamic effect display method provided by an embodiment of the present disclosure. The execution subject of the method may be a terminal device (such as Figure 1 Folding Screen Phone 101 or Figure 2 The tablet screen mobile phone 102 in the figure may also be a server electrically connected to the terminal device. This embodiment is described by taking the terminal device as an example.

[0072] Please refer to the following Figure 3The method provided in this embodiment may include steps S301-S303:

[0073] Step S301: Determine a display area for displaying audio effects according to a camera area of ​​a terminal device.

[0074] Exemplarily, the camera area of ​​the terminal device can be determined as the display area for displaying audio motion effects. In other words, the camera area is used as the display area for audio motion effects to display the audio motion effects.

[0075] By way of further example, in order to reduce the impact on the camera function, the blank area in the camera area except for the camera can also be used as the display area. Specifically, the above step S301 determines the display area for displaying audio motion effects according to the camera area of ​​the terminal device, and can include the following steps: determining the blank area in the camera area of ​​the terminal device except for the area containing the camera; determining the blank area as the display area for displaying audio motion effects.

[0076] In this example, the factory parameters of the terminal device can be used to determine the position of the camera in the camera area of ​​the terminal device, and the blank area of ​​the terminal device can be determined based on the factory parameter information. Alternatively, the camera area can be obtained through an application program interface (API) method, and the position that does not contain a camera in the camera area can be determined as a blank area. For example, the gap between two cameras in the camera area is used as the display area of ​​the audio dynamic effect. The gap is used as a certain display area for the audio dynamic effect, and the area can be dynamically adjusted as needed.

[0077] In this way, the camera and display areas in the camera area are separated, and the camera (blank) area is effectively utilized as the display area for audio effects, while reducing the impact on the camera's shooting or recording functions.

[0078] In another embodiment of the present disclosure, the method may further include the following steps: acquiring the camera area of ​​the terminal device according to a preset application program interface method.

[0079] Taking the external screen camera area as an example, the external screen camera area can be obtained by the native application programming interface (API) of the terminal device operating system (such as Android), such as getDisplayCutout(). When the life cycle of the Activity reaches onAttachedToWindow(), and the screen rotation triggers the onConfigurationChanged() method, the latest displayCutout can be obtained through the window object to determine the location of the camera area.

[0080] In some embodiments, the camera area of ​​the terminal device can also be obtained according to other application interface methods. This embodiment does not limit the specific acquisition method. For example, it can be obtained by detecting with a camera detector, or it can be obtained through the screen configuration of the device. The camera may be located at the top of the screen (such as a notch screen, a water drop screen) or the bottom (such as some tablet computers or some special mobile phone designs), etc.

[0081] Next, the process of obtaining the camera area is illustrated by taking the getDisplayCutout() method as an example. Specifically, the application programming interface method includes a method for obtaining the screen notch getDisplayCutout(); in the above steps, obtaining the camera area of ​​the terminal device according to the preset application programming interface method may include the following steps: calling the get safe insertion right method and / or the get safe insertion left method in the method for obtaining the screen notch to determine the area position of the camera in the screen of the terminal device; calling the get left boundary rectangle and / or the get right boundary rectangle method in the method for obtaining the screen notch to determine the area size of the camera in the screen of the terminal device; obtaining the camera area according to the area position and the area size.

[0082] In this example, taking the folding screen as an example, by calling the displayCutout's getSafeInsetLeft() method to get the safe inset left side and getSafeInsetRight() method to get the safe inset right side, when the getSafeInsetLeft() return value is greater than 0, it means that the camera area is located on the left side of the screen (that is, the camera area position is obtained). Further, by calling its getBoundingRectLeft() method to get the left bounding rectangle, you can get a rectangle (Rect) occupied by the camera area. By reading its width and height, you can know the size of the space occupied by the camera area (that is, get the camera area size, that is, the width), which makes it easier to place audio effects. Similarly, when getSafeInsetRight() is greater than 0, it means that the camera area is located on the right side of the screen. By getting the right bounding rectangle getBoundingRectRight(), you can get the space occupied by the camera on the right side. Optionally, after determining the camera area, you only need to place the custom view (View) corresponding to the audio effect in the frame layout ( FrameLayout ), by monitoring the changes in the camera area in real time and dynamically modifying the gravity property of the View, the dynamic position adaptation can be achieved.

[0083] In this way, even if the terminal device is in a changing state, the camera area of ​​the terminal device can be accurately obtained to facilitate dynamic effect display.

[0084] Continue to refer to Figure 2 , step S302, generating an audio animation about the audio data according to the audio data of the terminal device and the spatial orientation information of the camera.

[0085] In this embodiment, the spatial orientation information of the camera refers to the information of the spatial distribution characteristics of the camera, including the position and shape of the camera, and the spatial relationship and relative position between the camera and the external environment. Specifically, taking a mobile phone as an example, when the mobile phone is placed forward, the camera is located in the top area of ​​the mobile phone, that is, the spatial orientation information of the camera is the forward orientation; when the mobile phone is placed reversely, the camera is located in the bottom area of ​​the mobile phone, that is, the spatial orientation information of the camera is the reverse orientation. Correspondingly, forward placement can also include forward placement in the vertical direction and forward placement in the horizontal direction, and the principle is the same.

[0086] Since the terminal device is not always in a fixed position during use, the spatial position information of the camera will also change as the terminal device changes. If the spatial position information of the camera is not considered when displaying audio effects, the audio effects may be out of sync with the audio, thereby affecting the user experience. To this end, this embodiment combines the spatial position information of the camera to generate audio effects, so that the audio effects can change dynamically with the relative position of the camera, thereby improving the user experience.

[0087] In one example, if Figure 4 As shown, the above step S302 generates an audio animation about the audio data according to the audio data of the terminal device and the spatial orientation information of the camera, and may include the following steps S3021-S3023:

[0088] Step S3021: Determine the screen display information of the audio animation according to the audio data of the terminal device.

[0089] Exemplarily, the screen display information of the audio effect can be determined by extracting audio features from the audio data and detecting the dynamic changes of the audio data. Specifically, key features such as volume, frequency, timbre, etc. can be extracted from the audio data, and the dynamic characteristics of the audio effect can be determined by detecting the dynamic changes of the audio data (such as volume rise and fall, pitch change, etc.), and the screen display information can be generated according to the features and dynamic changes.

[0090] Step S3022: Determine the direction display information of the audio effect according to the spatial orientation information of the camera.

[0091] Exemplarily, the direction display information of the audio animation can be synchronized with the spatial orientation information of the camera.

[0092] Step S3023: Generate an audio animation about the audio data according to the screen display information and the direction display information.

[0093] Specifically, audio dynamic effects design can be carried out based on the above information. For example, waveform display can convert the volume changes of audio data into a waveform graph, and adjust the display position or direction of the waveform according to the camera orientation information. Color mapping can also be performed to map different characteristics of audio data (such as volume, frequency) to different colors or brightness, and display the dynamic characteristics of audio through color changes. Animation effects can also be designed according to the dynamic changes of audio data, such as audio dynamic effects becoming louder and flashing when the sound is enhanced, and so on.

[0094] The picture display information determined according to the audio data and the direction display information determined according to the camera spatial orientation information are integrated, that is, the integrated audio motion effect is displayed in real time in the camera area of ​​the terminal device.

[0095] In another embodiment of the present disclosure, in order to further optimize the display effect of the audio animation, the audio animation may include at least one animation block group, and the animation block group may include a plurality of blocks arranged in parallel, each of the blocks including at least one of the following properties: color, transparency, width, height, shape, and spacing between other blocks.

[0096] The directions (attributes) of the blocks arranged in parallel are consistent, so as to facilitate the processing and display of the audio dynamic effect. The blocks can be rounded rectangles, and this embodiment is described by taking rounded rectangles as an example. In some embodiments, the blocks can also be other shapes, such as non-rounded rectangles.

[0097] It can be understood that in addition to the above-mentioned attributes, other attributes may also be included, such as the distance of the block from the vertex (camera); in addition, in addition to the form of animation block groups, audio animations can also adopt other animation forms, such as the waveform form mentioned above. The embodiments of the present disclosure do not specifically limit the form of audio animations.

[0098] Exemplarily, the above steps of determining the screen display information of the audio animation according to the audio data of the terminal device may include the following steps: determining the attribute information of each block in the animation block group according to the audio data of the terminal device, so as to determine the screen display information of the audio animation according to the attribute information.

[0099] In this example, the frequency, loudness, rhythm and other characteristics of the audio data can be analyzed, and the attribute information of each block in the dynamic block group, such as size, color, brightness, shape, speed, etc., can be determined based on the audio characteristics, and these attribute information can be used to intuitively reflect the changes in the audio. For example, when the audio frequency is higher, the block can become brighter, smaller, and move faster; when the audio loudness increases, the block can become larger or more blocks can be generated. In this embodiment, changing the range of the highlighted block (i.e., the block to be drawn) is used as an example for explanation, and details can be found below.

[0100] By assigning values ​​to each block (which may include parameters such as the position, size, color, and shape of the block) based on the attribute information obtained through analysis, the corresponding screen display information is generated. The graphics rendering engine can be used to render these parameters onto the interface of the camera area to form a screen representation of the audio dynamic effect.

[0101] In addition, each block can correspond to different audio features or audio feature combinations to achieve diversified motion effects.

[0102] By way of further example, the above steps of determining the direction display information of the audio animation according to the spatial orientation information of the camera may include the following steps: determining the direction information of each block in the animation block group according to the spatial orientation information of the camera, so as to determine the direction display information of the audio animation according to the direction information.

[0103] In this example, the spatial orientation information of the camera can be captured from a sensor such as a gyroscope built into the terminal device, or the spatial orientation information of the camera can be captured using a camera and corresponding image processing technology. The spatial access information may include information such as the rotation angle, tilt angle, and position of the camera.

[0104] After obtaining the spatial orientation information of the camera, the direction information of each block in the dynamic block group can be determined according to the spatial orientation information of the camera. The direction information may include the direction of the block relative to the camera or screen, such as front and back, left and right, up and down, etc. And according to the direction information, the display direction or rotation angle of the block is adjusted to be consistent with the direction of the camera or screen. In practical applications, 3D graphics rendering technology can be used to achieve the direction change of the block.

[0105] In some embodiments, considering the form of random assignment, it is easy to generate a large number of temporary objects during animation drawing, thereby causing memory jitter, resulting in memory fragmentation and frequent operation of the memory reclaimer, thereby affecting the performance of the terminal. The method may also include the following steps: obtaining a preset attribute information array of each attribute, the attribute information array including a drawing attribute value for each block;

[0106] In the above steps, the attribute information of each block in the motion effect block group is determined according to the audio data of the terminal device, which may include the following steps: determining the block to be drawn in the motion effect block group according to the audio data of the terminal device; extracting the corresponding drawing attribute value from the attribute information array, and assigning the drawing attribute value to the block to be drawn to obtain an assignment result; determining the attribute information of each block in the motion effect block group according to the assignment result.

[0107] In this embodiment, the attribute information array can be adaptively set by those skilled in the art according to different types of audio data. The array can be adjusted according to actual needs without limiting the specific values. The following data is only used as one possible example.

[0108] Optionally, the dynamic effect block group takes 25 rounded rectangles (blocks) as an example. These 25 rounded rectangles can form an axisymmetry. When generating dynamic effects, only 13 of the rectangles can be processed for attribute information, such as color, transparency, and height. A possible example of a dynamic effect block group is as follows: Figure 5 and Figure 6 As shown, Figure 5 and Figure 6 The circle in the middle represents the camera (the example in the figure shows that the camera area contains two cameras), and the rounded rectangular part is the audio effect. Figure 5 An example of the display of audio effects in a camera area is shown (without adding color attributes, transparency, etc.). Figure 6 It is shown in Figure 5 Based on the above, a set of examples of displaying audio effects that change over time are shown. It should be further explained here that in addition to the display of the effects of the effect block group, in some embodiments, the audio effects can also be displayed in other waveform forms, such as Figure 7a The rhythmic waveform shown in Figure 7b The simulated speaker waveform shown, or Figure 7c The progress bar shown in the figure can be in the form of a progress bar, where the color of the progress bar can change with the audio data to display the audio animation effect. The audio animation effect includes the playback progress of the audio (the corresponding progress features, such as the playback time, etc., can be extracted from the audio data), or as Figure 7d The progress bar and audio effects shown in the figure are displayed separately. In addition, you can also use Figure 7e The internal waveform shown in the blank area between the cameras dynamically displays the colors of various positions in the area according to the audio data to achieve audio visualization, where: Figure 7e Compared with the implementation of Figure 5, which can be understood as the spacing between the dynamic effect blocks is 0. In these examples, the principle of the above-mentioned dynamic effect block group can be used to adjust its attribute value and display the dynamic effect, which will not be repeated here. In some embodiments, it is also possible to achieve flexible switching between multiple audio dynamic effect forms by receiving user instructions or automatically triggering according to audio data to further enhance the user experience.

[0109] Combine the following Figure 5 As shown, taking transparency, height, and the distance of the rounded corners from the vertex (ie, the camera) as examples, three floating-point arrays are illustrated:

[0110] alphaArray=intArrayOf(38,51,77,102,128,153,166,179,191,...)

[0111] alphaArray is the transparency array. This array can be the transparency of each rectangle extending from the center rounded rectangle to both sides when drawing (such as highlighting), which can be 38, 51, 77, 102, 128, 153, 166, 179, 191..., and can be adaptively adjusted according to the number of blocks.

[0112] heightArray=floatArrayOf(6f,6f,7f,9f,10f,13f,16f...)

[0113] alphaArray is the height array. This array can be the height of each rectangle extending from the rounded rectangle in the center to both sides, which can be 6f, 6f, 7f, 9f, 10f, 13f, 16f..., and can be adaptively adjusted according to the number of blocks.

[0114] topDistanceArray=floatArrayOf(0,6,11,15,19,...)

[0115] topDistanceArray is the vertex distance array. This array can be the distance from each rounded rectangle to the vertex starting from the leftmost rounded rectangle to the right, with the distance from the first rounded rectangle to the vertex being 0 as the benchmark.

[0116] Assuming that the target rectangle range to be drawn is [-tempStage, tempStage], the corresponding value can be taken out from the array and set to Paint for drawing, so that the corresponding rounded rectangle (to be drawn) has the corresponding attribute value.

[0117] In this example, the blocks to be drawn in the dynamic effect block group are determined based on the audio data of the terminal device. These blocks to be drawn are equivalent to the blocks to be highlighted compared to the blocks not to be drawn, that is, the rounded rectangular range for the highlighted display. It can be understood that the audio data is real-time and dynamic. In other words, the rounded rectangular range for the highlighted display can be different at each moment, thereby realizing the dynamic display of the dynamic effect block group.

[0118] Compared with the above example, based on the random assignment method of audio data, this embodiment pre-sets the attribute information array and assigns values ​​based on the attribute information array. There is no need to temporarily select random value values, which can effectively avoid the problem of memory jitter caused by generating a large number of temporary objects during animation drawing.

[0119] In some embodiments, taking into account that during the process of generating audio motion effects, if the FFT data callback is too fast, it is easy to cause the motion effects to change too frequently, thereby causing the animation to twitch, the above steps determine the screen display information of the audio motion effects based on the audio data of the terminal device, which may include the following steps: at every first preset time interval, performing a fast Fourier transform on the audio data according to a fast Fourier transform algorithm to determine the decibel value of each frequency domain; according to the decibel value of each frequency domain, obtaining the motion effect waveform of the audio data; according to the motion effect waveform, determining the screen display information of the audio motion effect.

[0120] In this embodiment, the first preset time interval can be adaptively set according to the actual application, for example, 320ms, that is, the player calls back the Fast Fourier Transformation (FFT) FFT data of the audio, and the callback interval is selected to be 320ms. It can be understood that the FFT algorithm is a method of quickly calculating the Discrete Fourier Transform (DFT) or its inverse transformation of a sequence, which can be used to calculate the decibel value of the audio.

[0121] Specifically, the audio player of the terminal device regularly calls back the audio data every 320ms (i.e., pulse code modulation PCM data, which is a raw stream of uncompressed audio sampling data, which is converted from analog signals through sampling, quantization, and encoding into standard digital audio data), and converts it into FFT data through fast Fourier transform, which is used to calculate the decibel value, and thus mapped to the waveform of the animation, that is, the highlighted part of the rounded rectangle. In order to prevent the FFT data from being called back too quickly, causing the animation to change too frequently and causing the animation to twitch, the data callback interval is selected to be 320ms, and the value of the data sequence of a callback is converted into decibels and the maximum value is taken as the peak value of a callback, which is normalized to between rectangles 0-12 and can be calculated using the following formula:

[0122] stage=Math.abs((Math.max(Math.min(db / maxDb,1.0),-1.0)*12))

[0123] Among them, stage is the range of the rounded rectangle to be drawn (highlighted), db is the decibel value converted by the callback FFT data, and maxDb is the preset maximum decibel value. In other words, the stage calculated by the above formula is the target waveform range used for animation in a data callback (that is, the range of the rounded rectangle to be highlighted). After calculating the stage, the audio animation can be generated in combination with the direction display information, and the corresponding animation can be drawn by using the animation View to realize the display of the audio animation.

[0124] Furthermore, in order to make the audio animation display smoother, the method may also include the following steps: obtaining predefined animation display stages, the animation display stages including a display stage (stage one) for transitioning between the last acquired animation waveform and the current animation waveform, and a display stage (stage two) for transitioning between the current animation waveform and a random animation waveform, each stage having a time difference of a second preset time interval; determining the screen display information of the audio animation based on the animation waveform, including: determining the screen display information of the audio animation based on the animation display stage and the animation waveform.

[0125] It should be noted that those skilled in the art can adaptively set the number of animation display stages according to actual applications. In one possible example, it can be set to two display stages for transitioning between the current animation waveform and the previous animation waveform, and between the current animation waveform and the random animation waveform. It is understandable that the previous animation waveform is the waveform corresponding to the last callback FFT data. There may be a large difference between the two waveforms. In order to make the audio animation display smoother, the waveform is smoothed using this display stage, and the waveform is processed accordingly in the next display stage and reaches a random value to improve the animation display effect.

[0126] Exemplarily, the audio animation is divided into two stages, stage one is the peak position extending from the original position, and stage two is falling back from the peak position to a random position, wherein the second preset time interval can be determined based on the first time interval, for example, the interval of the player data callback is 320ms, and the duration of the animation in each stage can be set to 160ms.

[0127] For stage one, a variable lastStage is set to save the position where the last complete animation finally falls back as the initial position for this time. If there is no such position, it is set to 0. In this stage, you can use attribute animation (ValueAnimator), set the int range to [lastStage, stage], assign the attribute value to tempStage each time it is updated, trigger invalidate() to refresh, and trigger stage two at the end of the animation. At the same time, in order to enhance the dynamism of the animation, you can also use the AnticipateOvershootInterpolator as the interpolator of the stage one animation, so that it has a flickering effect at the boundary and there is no sense of pause when the animation is connected.

[0128] For stage 2, you can set a random integer random value randomStage in the range [0, stage], and use the property animation ValueAnimator, set the int range to [stage, randomStage], assign the property value to tempStage each time it is updated, trigger invalidate() to refresh, and assign the value of randomStage to lastStage used in stage 1 at the end of the animation. At the same time, use DecelerateInterpolator as the interpolator of the stage 2 animation to achieve a deceleration effect and make the animation smoother.

[0129] In this process, the first stage expands from the position where the last animation ended to the new peak position, using the AnticipateOvershootInterpolator interpolator, and in the second stage, it falls back from the peak position to a random position, using the DecelerateInterpolator interpolator. In this way, the view can dynamically adjust the highlight area and color of the rectangle according to the audio data to achieve smooth dynamic display. In other words, using the dynamic waveform, the previous dynamic waveform and other information, after the above multiple stages of processing, a smoother dynamic display effect can be achieved.

[0130] Continue to refer to Figure 2 , step S303, displaying the audio effects of the audio data in the display area.

[0131] Through the above technical solution, the linkage effect between the software UI interface and the hardware display area can be achieved, so that the audio animation can dynamically change position as the camera position changes due to screen rotation. In addition, with the help of the preset array of various drawing attributes, it is possible to avoid generating a large number of temporary objects during animation drawing, thereby causing memory jitter. In addition, the visual waveform animation generated according to the decibel data of the audio can make the animation smoother and more dynamic by selecting the appropriate animation interval, interpolator, and generating random points.

[0132] Figure 8 It is a flow chart of another audio motion effect display method provided by an embodiment of the present disclosure. On the basis of the above embodiment, the harmony problem between the audio motion effect and the audio cover color caused by the change of the spatial orientation of the camera is taken into consideration. In addition to the above steps S301-S303, the method provided in this embodiment can also include the following step S801, and the above step S302 can be further divided into step S3024.

[0133] Step S801: Acquire audio cover information of the terminal device, where the audio cover information includes cover color information of each area in the audio cover.

[0134] Exemplarily, the audio cover information of the terminal device can be obtained by obtaining the path of the audio file currently playing the audio on the terminal device and parsing the metadata of the audio file. Specifically, the path of the audio file for which cover information is to be obtained can be obtained through file system operations or media library queries; the metadata of the audio file can be parsed, for example, using MediaMetadataRetriever (a new class for extracting metadata from media files) to obtain the metadata of the audio file to obtain the title, artist, album, cover and other information of the audio file. Specifically, the getEmbeddedPicture() method of MediaMetadataRetriever can be used to obtain the cover image data embedded in the audio file, thereby obtaining the audio cover information of the terminal device.

[0135] In some examples, audio files are usually scanned by the system's media scanner and stored in a media database. The audio cover information of the audio can also be obtained by querying the media database, thereby improving the efficiency of obtaining the audio cover information.

[0136] Step S3024: Generate an audio animation about the audio data based on the audio cover information, the audio data of the terminal device, and the spatial orientation information of the camera.

[0137] For example, in combination with the example of the dynamic effect block group in the above embodiment, the audio cover information is assigned to the color attribute of each dynamic effect block, thereby realizing the generation of audio dynamic effect. Alternatively, when the audio dynamic effect adopts other waveform forms, it can be assigned to the color attribute of the waveform.

[0138] Compared with the process of generating audio effects using audio data and spatial orientation information in the above-mentioned embodiment, the present embodiment further considers the audio cover information, mainly the audio cover color (in some embodiments, other audio cover information, such as layout, softness and other information, can also be combined to generate audio effects), providing users with a more harmonious visual effect.

[0139] In another embodiment of the present disclosure, the above steps of generating audio effects about the audio data based on the audio cover information, the audio data of the terminal device and the spatial orientation information of the camera may include the following steps: if the spatial orientation information of the camera is a reverse orientation, obtaining the cover color information of the top area of ​​the audio cover; generating audio effects about the audio data based on the cover color information of the top area and the audio data.

[0140] It can be understood that in the reverse orientation of this embodiment, when the terminal screen is in the forward orientation, the camera is located above the screen. If it is detected that the camera is below the screen, that is, the reverse orientation of the camera, its orientation information can be obtained through sensors such as the built-in gyroscope of the terminal device.

[0141] Exemplarily, when the camera is in the reverse direction (such as the bottom of the screen), the main color of the top 20% (or other proportion) of the song cover is taken as the color of the audio effect (i.e., the color of the block to be drawn). Specifically, when the camera is at the bottom, the top 20% area of ​​the song cover can be intercepted. This can be done by creating a new bitmap whose height is 20% of the original cover height, and drawing the corresponding part of the original cover image onto this new bitmap, and performing color analysis on this intercepted area to find the main color, and using pixel scanning or color clustering algorithms to identify the most prominent color, thereby assigning the cover color to the corresponding block, thereby generating the corresponding audio effect.

[0142] Correspondingly, the above steps of generating audio effects about the audio data based on the audio cover information, the audio data of the terminal device and the spatial orientation information of the camera may include the following steps: if the spatial orientation information of the camera is a forward orientation, obtaining the cover color information of the bottom area of ​​the audio cover; generating audio effects about the audio data based on the cover color information of the bottom area and the audio data.

[0143] It can be understood that the positive orientation in this embodiment, such as when the terminal screen is in the positive orientation, the camera is located above the screen. If it is detected that the camera is above the screen, that is, the positive orientation of the camera, its orientation information can be obtained through sensors such as the built-in gyroscope of the terminal device.

[0144] Exemplarily, when the camera is in the forward direction (such as the top of the terminal screen), the bottom 20% area of ​​the song cover is captured. Similarly, similar to the above-mentioned capture of the top 20% area of ​​the song cover, the captured area is subjected to color analysis to find the dominant color.

[0145] After determining the main color, the cover color information can be passed to a custom View component. This View can generate an animation block group (or other graphic elements, such as a waveform) to display the song's audio animation or other related information on the screen. That is, by drawing a colored waveform in a custom View, specifically, using the obtained cover color information, audio animation is generated in the custom View, which can be achieved by setting the corresponding color and stroke style in the drawing method.

[0146] In some embodiments, according to the actual needs of the user, the cover color information of the audio cover located in the corresponding fishing area can be obtained according to the spatial orientation information of the camera to generate audio dynamic effects. For example, when the spatial orientation information of the camera is in the forward orientation, the cover information located in the top area of ​​the audio cover is obtained, and so on.

[0147] Through the above solution, the sound wave effect can be changed with the color of the song cover, and the main cover color with better visual effect and harmony can be selected according to the direction of the screen, which enhances the beauty and readability of the interface and makes the entire interface look more harmonious and unified.

[0148] To facilitate understanding of the embodiments of the present disclosure, an exemplary embodiment is provided below. In the process of displaying audio dynamic effects, it mainly includes two parts, one is the determination of the dynamic effect position (corresponding to the determination of the display area of ​​the audio dynamic effect), and the other is the drawing of the dynamic effect View, the interaction between the dynamic effect View and the cover color and the audio data (corresponding to the generation and display of the audio dynamic effect), as follows:

[0149] The process of determining the position of the dynamic effect:

[0150] The camera area of ​​the external screen can be obtained by the system's native API, getDisplayCutout(). When the Activity life cycle reaches onAttachedToWindow(), and when the screen is rotated to trigger the onConfigurationChanged() method, the latest displayCutout can be obtained through the window object to determine the location of the camera area.

[0151] Call the getSafeInsetLeft() and getSafeInsetRight() methods of displayCutout. When the return value of getSafeInsetLeft() is greater than 0, it means that the camera area is on the left side of the screen. Further, call its getBoundingRectLeft() method to get the Rect occupied by the camera area. By reading its width and height, you can know the size of the space occupied by the camera area, which is convenient for placing animation effects. Similarly, when getSafeInsetRight() is greater than 0, it means that the camera area is on the right side of the screen, and getBoundingRectRight() can get the space occupied by the camera on the right side.

[0152] This process obtains camera information through the system's DisplayCutout API, uses getSafeInsetLeft / Right to obtain the camera position on the screen, and getBoundingRectLeft / Right to obtain the camera area size, so as to efficiently and accurately locate the camera area.

[0153] In the subsequent View drawing process, you only need to place the custom View of the animation effect in the frame layout (FrameLayout), and dynamically modify the Gravity of the View by monitoring the changes in the camera area in real time, so that the animation position can be adapted.

[0154] The drawing process of dynamic view:

[0155] The process of drawing the dynamic view is also the process of audio visualization. Audio visualization refers to drawing the audio frequency on the screen to achieve a visual effect, making the playback or recording process more vivid. The operating system of the terminal device (such as Android) has a method to call back audio data. Usually, the audio data called back by the player can be used to draw animations in the form of custom views to achieve the effect of audio visualization.

[0156] In this embodiment, View can be a combination of multiple rounded rectangles, which can be divided into two areas, one of which is a highlight area, namely Figure 5 The colored part in the middle of the animation block group shown is a non-highlight area, that is, Figure 5 The transparent rounded rectangle part in the highlight area may be formed by superimposing a pure white rectangle and a colored rectangle with transparency.

[0157] In this custom View, you can prepare two Paints (a class used to draw graphics and text, which defines the color, style, and other properties of the drawing object). One has a color set to pure white (for example, you can use the setColor method of the Paint object to set the color) and is used to draw a white rectangle (the color to be drawn). The other has no color set (the default color) and is used to dynamically set the color when drawing. Figure 5 For example, in this camera area, 25 rounded rectangles can be drawn to form axisymmetry. Therefore, only 13 of them need to be preset in color, transparency, and height. For example, three floating-point arrays are prepared: transparency array alphaArray, rectangle height array heightArray, and top distance array topDistanceArray. These three floating-point arrays have been described above and will not be repeated here. In addition, some member variables for calculation can be prepared, as shown in Table 1 below:

[0158] Table 1

[0159] Variable Name meaning defaultColor Default color for non-highlighted rectangles defaultAlpha Default transparency of non-highlighted rectangles columnRadius Rectangle rounded corners columnWidth Rectangle Width columnDistance Spacing between rectangles

[0160] Furthermore, taking 25 rectangles as an example, in a View drawing method, assuming that the highlighted rectangular area to be drawn is [-tempStage, tempStage], and the highlight color is color, the following algorithm can be executed (for loop drawing of each block):

[0161] I. Initialize the variable columnCount to 0.

[0162] II. For each integer index from -12 to 12, perform the following loop operation:

[0163] i. Calculate the actual index realIndex as the absolute value of index.

[0164] ii. If realIndex is less than or equal to the value of the variable tempStage, set the color of the brush paint to the variable color, otherwise set it to the variable defaultColor.

[0165] iii. If realIndex is less than or equal to the value of the variable tempStage, the transparency of the brush paint is set to the value of the array alphaArray with the index realIndex, otherwise it is set to the variable defaultAlpha.

[0166] iv. Calculate the variable left as columnCount*columnWidth+columnDistance.

[0167] v. Calculate the variable top to be the value of the array topDistanceArray[columnCount].

[0168] vi. Calculate the variable right as left + columnWidth.

[0169] vii. Calculate the value of the variable bottom as top + heightArray[realIndex].

[0170] viii. If realIndex is less than or equal to the value of the variable tempStage, a rounded rectangle is drawn on the canvas. The coordinates of the upper left corner are (left, top), the coordinates of the lower right corner are (right, bottom), the radius of the rounded corner is the variable columnRadius, and the brush is the white brush whitePaint.

[0171] ix. Draw a rounded rectangle on the canvas. The coordinates of the upper left corner are (left, top), the coordinates of the lower right corner are (right, bottom), the radius of the rounded corner is the variable columnRadius, and the brush is the variable paint.

[0172] x. Increase the variable columnCount by 1 and continue the loop.

[0173] It can be understood that the purpose of the above algorithm is to draw 25 rectangles in the onDraw method of a view, and dynamically adjust the highlight area and color of these rectangles according to external data. The specific steps are as follows: define a variable columnCount by initialization, and the initial value is 0, which is used to record the number of rectangle columns currently drawn. And draw the rectangle (that is, determine the attribute information of the block), and draw from index -12 to 12 (a total of 25 rectangles) by using a loop. In each loop: by calculating the absolute value of the current index (realIndex), if realIndex is less than or equal to tempStage, set the color of the brush paint to color, otherwise to defaultColor. Similarly, if realIndex is less than or equal to tempStage, set the transparency of the brush paint to alphaArray[realIndex], otherwise to defaultAlpha. And, calculate the left boundary left, top boundary top, right boundary right and bottom boundary bottom of the rectangle, if realIndex is less than or equal to tempStage, use the white brush whitePaint to draw a rounded rectangle. Use the paint brush to draw a rounded rectangle, add 1 to columnCount, and continue the next loop until all rounded rectangles are drawn.

[0174] In the above process, the sound wave effect is realized through a custom View, and the position of the camera is monitored to set its gravity, so that it can change its position dynamically with the change of the camera position. At the same time, the custom View will be divided into multiple rounded rectangles of different heights according to the width and height of the camera area, and divided into highlight areas and non-highlight areas. Different Paints are prepared for drawing respectively, and when drawing, according to the preset floating-point array and the current target rectangle range to be drawn, the corresponding value is taken from the array and set to the Paint for drawing. The linkage effect between the software interface and the hardware display area can be achieved, so that the sound wave effect can dynamically change its position as the position of the camera changes due to the rotation of the screen. At the same time, with the help of the preset Paint and arrays of various drawing attributes, a large number of temporary objects can be avoided during animation drawing, thereby causing memory jitter.

[0175] The dynamic view interacts with the cover color and sound wave data:

[0176] Combined with the above algorithm example, in an onDraw, two core variables can be included, tempStage and color, where tempStage represents the range of the highlight rectangle in a drawing, and color represents the color of the highlight rectangle. These two core variables can depend on external data. Specifically, for color, after the song cover is loaded, the top 20% area and the bottom 20% area can be taken as the main color respectively, and then the color can be dynamically set according to the position of the camera. When the camera is at the top, the bottom 20% of the main color is used, and when the camera is at the bottom, the top 20% of the main color is used to achieve a harmonious visual effect; for tempStage, the goal of the solution is to adjust the waveform size according to the audio data of the music, that is, to adjust the size of tempStage. The player periodically calls back the PCM data of the audio and converts it into FFT data through fast Fourier transform to calculate the decibel value, which is mapped to the waveform of the dynamic effect, that is, the highlight part of the rectangle. The specific calculation method (i.e. stage) has been described in detail above and will not be repeated here.

[0177] In this process, according to the position of the screen camera, the main color of the song cover is taken and passed to the custom View to draw the colored waveform. When the camera is at the bottom, the top 20% of the main color of the song cover is taken. When the camera is at the top, the bottom 20% of the main color of the song cover is taken. The sound wave effect can change with the color of the song cover, and the main color of the cover with better visual effect and harmony is selected according to the direction of the screen. The audio FFT data is called back by the player, and the callback interval is selected as 320ms. The maximum value of the callback sequence is calculated as the peak value, and the stage is normalized using a formula and mapped to the range of the drawable waveform, that is, the range of the highlight rectangle to be drawn. At the same time, each callback data triggers an animation drawing. The animation is divided into two stages, each stage is 160ms, to draw a visual waveform animation according to the decibel data of the audio, and the animation is made smoother and more dynamic by selecting a suitable animation interval, interpolator, and generating random points.

[0178] In summary, the technical solution provided by the embodiments of the present disclosure performs audio visualization operations by reasonably utilizing the camera area on the terminal device and the PCM data produced by the player on the interface of the audio software, thereby drawing sound wave effects in the camera area. The motion effects can dynamically change position following the camera whose position changes due to screen rotation. At the same time, the color can be changed according to the cover of the song, and the waveform can be changed according to the decibel value of the audio data, thereby optimizing the terminal screen space and improving the user experience.

[0179] Exemplary Media

[0180] After introducing the method of the exemplary embodiment of the present disclosure, next, refer to Fig. 9A storage medium according to an exemplary embodiment of the present disclosure is described.

[0181] refer to Fig. 9 As shown, the storage medium 90 stores a program product for implementing the above method according to an embodiment of the present disclosure, which can be a portable compact disk read-only memory (CD-ROM) and includes 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.

[0182] 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 (non-exhaustive list) of readable storage media 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.

[0183] 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 of the above. The readable signal medium may also be any readable medium other than a readable storage medium.

[0184] 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).

[0185] Exemplary Devices

[0186] After introducing the medium of the exemplary embodiment of the present disclosure, next, the audio motion effect display device of the exemplary embodiment of the present disclosure is explained with reference to the figure, which is used to implement the method in any of the above-mentioned method embodiments. The implementation principle and technical effect are similar and will not be repeated here.

[0187] Fig.10 is a structural diagram of an audio dynamic effect display device provided by an embodiment of the present disclosure, such as Fig.10 As shown, the device includes an area determination module 110, a motion effect generation module 120 and a display module 130, wherein the area determination module 110 is used to determine a display area for displaying audio motion effects according to a camera area of ​​a terminal device; the motion effect generation module 120 is used to generate audio motion effects about the audio data according to the audio data of the terminal device and the spatial orientation information of the camera; and the display module 130 is used to display the audio motion effects of the audio data in the display area.

[0188] In one embodiment of the present disclosure, the animation generation module 120 includes: a picture determination unit, used to determine the picture display information of the audio animation according to the audio data of the terminal device; a direction determination unit, used to determine the direction display information of the audio animation according to the spatial orientation information of the camera; a first generation unit, used to generate an audio animation about the audio data according to the picture display information and the direction display information.

[0189] In another embodiment of the present disclosure, the audio animation includes at least one animation block group, and the animation block group includes a plurality of blocks arranged in parallel, and each of the blocks includes at least one of the following properties: color, transparency, width, height, shape, and spacing between other blocks.

[0190] In another embodiment of the present disclosure, the screen determination unit is specifically used to determine the attribute information of each block in the dynamic effect block group according to the audio data of the terminal device, so as to determine the screen display information of the audio dynamic effect according to the attribute information;

[0191] In another embodiment of the present disclosure, the direction determination unit is specifically used to determine the direction information of each of the blocks in the motion effect block group according to the spatial orientation information of the camera, so as to determine the direction display information of the audio motion effect according to the direction information.

[0192] In another embodiment of the present disclosure, the device also includes: an array acquisition module, used to obtain an attribute information array of each preset attribute, the attribute information array including a drawing attribute value for each block; determining the attribute information of each block in the motion effect block group according to the audio data of the terminal device, including: determining the block to be drawn in the motion effect block group according to the audio data of the terminal device; extracting the corresponding drawing attribute value from the attribute information array, and assigning the drawing attribute value to the block to be drawn to obtain an assignment result; determining the attribute information of each block in the motion effect block group according to the assignment result.

[0193] In another embodiment of the present disclosure, the picture determination unit is specifically used to: perform fast Fourier transform on the audio data according to a fast Fourier transform algorithm at every first preset time interval to determine the decibel value of each frequency domain; obtain a motion effect waveform about the audio data according to the decibel value of each frequency domain; and determine the picture display information of the audio motion effect according to the motion effect waveform.

[0194] In another embodiment of the present disclosure, the device also includes: a stage acquisition module, used to acquire predefined animation display stages, the animation display stages include a display stage for transitioning between a last acquired animation waveform and a current animation waveform, and a display stage for transitioning between a current animation waveform and a random animation waveform, each stage having a time difference of a second preset time interval; determining the screen display information of the audio animation based on the animation waveform includes: determining the screen display information of the audio animation based on the animation display stage and the animation waveform.

[0195] In another embodiment of the present disclosure, the device also includes: a cover acquisition module, used to obtain audio cover information of the terminal device, the audio cover information including cover color information of each area in the audio cover; the motion effect generation module 120 includes: a second generation unit, used to generate audio motion effects about the audio data based on the audio cover information, the audio data of the terminal device and the spatial orientation information of the camera.

[0196] In another embodiment of the present disclosure, the second generating unit is specifically used to obtain the cover color information located in the top area of ​​the audio cover when the spatial orientation information of the camera is a reverse orientation; and generate an audio animation about the audio data based on the cover color information of the top area and the audio data.

[0197] In another embodiment of the present disclosure, the second generating unit is specifically used to obtain the cover color information located in the bottom area of ​​the audio cover when the spatial orientation information of the camera is in the forward orientation; and generate an audio animation about the audio data based on the cover color information of the bottom area and the audio data.

[0198] In yet another embodiment of the present disclosure, the apparatus further includes: an area acquisition module, configured to acquire a camera area of ​​the terminal device according to a preset application program interface method.

[0199] In another embodiment of the present disclosure, the application programming interface method includes a method for obtaining a screen recess; the area acquisition module includes: an area position determination unit, used to call the method for obtaining a safe insertion right side and / or the method for obtaining a safe insertion left side in the method for obtaining a screen recess, to determine the area position of the camera in the screen of the terminal device; an area size determination unit, used to call the method for obtaining a left boundary rectangle and / or the method for obtaining a right boundary rectangle in the method for obtaining a screen recess, to determine the area size of the camera in the screen of the terminal device; and acquiring the camera area according to the area position and the area size.

[0200] In another embodiment of the present disclosure, the area determination module 110 is specifically used to: determine a blank area in the camera area of ​​the terminal device except the area including the camera; and determine the blank area as a display area for displaying audio effects.

[0201] Exemplary Computing Devices

[0202] After introducing the method, medium and apparatus of the exemplary embodiments of the present disclosure, next, reference is made to Fig.11 A computing device according to an exemplary embodiment of the present disclosure is described.

[0203] Fig.11 The computing device 40 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.

[0204] like Fig.11 As shown, the computing device 40 is in the form of a general computing device. The components of the computing device 40 may include, but are not limited to: at least one processing unit 401, at least one storage unit 402, and a bus 403 connecting different system components (including the processing unit 401 and the storage unit 402). Among them, at least one storage unit 402 stores computer-executable instructions; at least one processing unit 401 includes a processor, and the processor executes the computer-executable instructions to implement the method described above.

[0205] The bus 403 includes a data bus, a control bus, and an address bus.

[0206] The storage unit 402 may include a readable medium in the form of a volatile memory, such as a random access memory (RAM) 4021 and / or a cache memory 4022 , and may further include a readable medium in the form of a non-volatile memory, such as a read-only memory (ROM) 4023 .

[0207] The storage unit 402 may also include a program / utility 4025 having a set (at least one) of program modules 4024, such program modules 4024 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.

[0208] The computing device 40 may also communicate with one or more external devices 404 (e.g., a keyboard, a pointing device, etc.). Such communication may be performed via an input / output (I / O) interface 405. Furthermore, the computing device 40 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 406. Fig.10 As shown, network adapter 406 communicates with other modules of computing device 40 via bus 403. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with computing device 40, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0209] It should be noted that although several units / modules or sub-units / modules of the audio dynamic effect display device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to an embodiment 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.

[0210] 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.

[0211] 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 displaying audio dynamic effects, characterized in that: include: Determine a display area for displaying audio animations according to a camera area of ​​the terminal device; Generate an audio effect related to the audio data according to the audio data of the terminal device and the spatial orientation information of the camera; The audio animation of the audio data is displayed in the display area.

2. The method according to claim 1, characterized in that Generating an audio animation about the audio data according to the audio data of the terminal device and the spatial orientation information of the camera includes: Determining screen display information of the audio animation according to the audio data of the terminal device; Determining direction display information of the audio dynamic effect according to the spatial orientation information of the camera; An audio animation about the audio data is generated according to the screen display information and the direction display information.

3. The method according to claim 2, characterized in that The audio motion effect includes at least one motion effect block group, and the motion effect block group includes a plurality of blocks arranged in parallel, and each of the blocks includes at least one of the following properties: color, transparency, width, height, shape, and spacing between other blocks.

4. The method according to claim 3, characterized in that The step of determining the screen display information of the audio dynamic effect according to the audio data of the terminal device includes: According to the audio data of the terminal device, the attribute information of each block in the motion effect block group is determined, so as to determine the screen display information of the audio motion effect according to the attribute information.

5. The method according to claim 3, characterized in that: The step of determining the direction display information of the audio dynamic effect according to the spatial orientation information of the camera includes: According to the spatial orientation information of the camera, the direction information of each block in the motion effect block group is determined, so as to determine the direction display information of the audio motion effect according to the direction information.

6. The method according to claim 4, characterized in that Also includes: Obtaining a preset attribute information array of each attribute, wherein the attribute information array includes a drawing attribute value for each block; The step of determining the attribute information of each block in the motion effect block group according to the audio data of the terminal device includes: Determining a block to be drawn in the animation block group according to the audio data of the terminal device; Extracting corresponding drawing attribute values ​​from the attribute information array, and assigning the drawing attribute values ​​to the block to be drawn to obtain an assignment result; According to the assignment result, the attribute information of each block in the dynamic effect block group is determined.

7. The method according to claim 2, characterized in that The step of determining the screen display information of the audio dynamic effect according to the audio data of the terminal device includes: At every first preset time interval, performing a fast Fourier transform on the audio data according to a fast Fourier transform algorithm to determine a decibel value in each frequency domain; Obtaining a dynamic effect waveform of the audio data according to the decibel value of each frequency domain; The screen display information of the audio motion effect is determined according to the motion effect waveform.

8. A computer-readable storage medium, comprising: The computer-readable storage medium stores computer execution instructions, which, when executed by a processor, are used to implement the audio motion effect display method as described in any one of claims 1 to 7.

9. An audio dynamic effect display device, characterized in that: The device comprises: An area determination module, used to determine a display area for displaying audio animation according to a camera area of ​​a terminal device; A motion effect generation module, used to generate an audio motion effect about the audio data according to the audio data of the terminal device and the spatial orientation information of the camera; A display module is used to display the audio animation of the audio data in the display area.

10. A computing device comprising: at least one processor; and a memory communicatively coupled to the at least one processor; Wherein, the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the computing device to execute the audio animation display method as described in any one of claims 1 to 7.