CN111782866A - Drawing method, drawing device, terminal equipment and computer storage medium - Google Patents
Drawing method, drawing device, terminal equipment and computer storage medium Download PDFInfo
- Publication number
- CN111782866A CN111782866A CN201910272239.7A CN201910272239A CN111782866A CN 111782866 A CN111782866 A CN 111782866A CN 201910272239 A CN201910272239 A CN 201910272239A CN 111782866 A CN111782866 A CN 111782866A
- Authority
- CN
- China
- Prior art keywords
- data
- audio
- sampling
- playing progress
- preset
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 40
- 238000005070 sampling Methods 0.000 claims abstract description 117
- 230000000007 visual effect Effects 0.000 claims abstract description 70
- 238000009877 rendering Methods 0.000 claims description 25
- 238000004364 calculation method Methods 0.000 claims description 23
- 238000004891 communication Methods 0.000 claims description 20
- 238000010586 diagram Methods 0.000 claims description 10
- 238000004590 computer program Methods 0.000 claims description 2
- 238000006467 substitution reaction Methods 0.000 abstract description 9
- 239000003973 paint Substances 0.000 description 5
- 230000006870 function Effects 0.000 description 4
- 230000000452 restraining effect Effects 0.000 description 4
- 238000012545 processing Methods 0.000 description 3
- 239000003086 colorant Substances 0.000 description 2
- 230000001960 triggered effect Effects 0.000 description 2
- 238000012800 visualization Methods 0.000 description 2
- 238000013461 design Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 238000011022 operating instruction Methods 0.000 description 1
- 239000011800 void material Substances 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/60—Information retrieval; Database structures therefor; File system structures therefor of audio data
- G06F16/68—Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
- G06F16/683—Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/60—Information retrieval; Database structures therefor; File system structures therefor of audio data
- G06F16/64—Browsing; Visualisation therefor
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Multimedia (AREA)
- Library & Information Science (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Processing Or Creating Images (AREA)
Abstract
The embodiment of the invention provides a drawing method, a drawing device, terminal equipment and a computer storage medium, wherein the drawing method comprises the following steps: sampling audio track information by calling an audio data interface to obtain sampling data, wherein the sampling data is matched with the playing progress of audio; and drawing a visual graph matched with the playing progress of the audio according to a preset drawing style and the sampling data. The scheme that this application embodiment provided can show through visual figure that audio frequency presses down the yangtong and frustrates the sense, and then makes the user have better substitution sense.
Description
Technical Field
The embodiment of the invention relates to the technical field of data processing, in particular to a drawing method, a drawing device, terminal equipment and a computer storage medium.
Background
There is sound presented to the user in existing video or audio. In order to increase the sense of substitution by the user or to obtain a more cool effect, when displaying video or audio, the sound thereof may be displayed to the user more intuitively, for example, an image corresponding to the sound may be displayed to the user.
However, when displaying an image corresponding to a sound to a user, the displayed image is often generated randomly, and such randomly generated image cannot embody a sense of frustration of the sound when displayed, so that when the user listens to the sound and views the displayed image, a good sense of substitution cannot be obtained by the displayed image.
Disclosure of Invention
In view of the above, embodiments of the present invention provide a drawing method, an apparatus, a terminal device, and a computer storage medium to solve the above problems.
According to a first aspect of embodiments of the present invention, there is provided a rendering method including: sampling audio track information by calling an audio data interface to obtain sampling data, wherein the sampling data is matched with the playing progress of audio; and drawing a visual graph matched with the playing progress of the audio according to a preset drawing style and the sampling data.
According to a second aspect of embodiments of the present invention, there is provided a drawing apparatus including: the sampling module is used for sampling the audio track information by calling an audio data interface to obtain sampling data, and the sampling data is matched with the playing progress of the audio; and the drawing module is used for drawing a visual graph matched with the playing progress of the audio according to a preset drawing style and the sampling data.
According to a third aspect of the embodiments of the present invention, there is provided a terminal device, including: the system comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete mutual communication through the communication bus; the memory is used for storing at least one executable instruction, and the executable instruction causes the processor to execute the operation corresponding to the drawing method.
According to a fourth aspect of embodiments of the present invention, there is provided a computer storage medium having stored thereon a computer program which, when executed by a processor, implements the rendering method as described above.
According to the scheme provided by the embodiment of the invention, the audio data interface is called to sample the audio track information to obtain the sampling data, and the sampling data is matched with the playing progress of the audio; according to the preset drawing style and the sampling data, the visual graph matched with the playing progress of the audio is drawn, when the playing progress of the audio changes, the visual graph changes accordingly, so that the feeling of restraining and stopping the audio can be shown through the visual graph, and a user can have better substitution feeling.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments described in the embodiments of the present invention, and it is also possible for a person skilled in the art to obtain other drawings based on the drawings.
FIG. 1 is a flowchart illustrating steps of a rendering method according to a first embodiment of the present invention;
FIG. 2 is a flowchart illustrating a rendering method according to a second embodiment of the present invention;
FIG. 3 is a flowchart illustrating a step of calculating coordinate data according to a second embodiment of the present invention;
fig. 4 is a data flow diagram of a drawing method according to a second embodiment of the present invention;
fig. 5 is a block diagram of a rendering apparatus according to a third embodiment of the present invention;
fig. 6 is a schematic structural diagram of a terminal device according to a fourth embodiment of the present invention.
Detailed Description
In order to make those skilled in the art better understand the technical solutions in the embodiments of the present invention, the technical solutions in the embodiments of the present invention will be described clearly and completely with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all embodiments. All other embodiments obtained by a person skilled in the art based on the embodiments of the present invention shall fall within the scope of the protection of the embodiments of the present invention.
The following further describes specific implementation of the embodiments of the present invention with reference to the drawings.
Example one
Referring to fig. 1, a flowchart illustrating steps of a rendering method according to a first embodiment of the present invention is shown.
The drawing method of the embodiment comprises the following steps:
s102, sampling the audio track information by calling an audio data interface to obtain sampling data, wherein the sampling data is matched with the playing progress of the audio.
The scheme provided by the embodiment can be applied to any terminal with the functions of playing audio and displaying, such as a mobile phone. In use, a system for operation, for example, an Android system or an IOS system in a mobile phone is often installed in a terminal.
In this embodiment, the audio data interface is an interface included in a system for playing audio, and may be used to output audio track information of the audio, and in different systems, the called audio data interface is different, and the calling manner is also different. When sampling is carried out through the audio data interface, the audio data interface can be called at a preset sampling frequency to obtain the audio track information, so that stable sampling of the audio track information can be realized, and effective sampling data can be obtained.
In this embodiment, since the audio track information corresponding to the audio data interface changes with the change of the playing progress of the audio, the sampling data is also matched with the playing progress of the audio.
In addition, the audio in this embodiment may be simple audio data, such as an mp3 file, or may be audio data in an audio/video file, such as audio integrated into an mp4 file, and this embodiment is not limited thereto.
And S104, drawing a visual graph matched with the playing progress of the audio according to a preset drawing style and the sampling data.
In this embodiment, the preset drawing style refers to a style used when the visual graph is drawn, and the preset drawing style may include a drawing style corresponding to a column shape, a flame shape, a waveform shape, and the like. When the system is actually used, a plurality of preset drawing styles can be stored in a database, and one of the preset drawing styles can be selected for use through selection of a user, so that diversified display can be realized.
Specifically, the preset drawing style can be realized by defining a drawing model, the sampling data can be used as the input of the drawing model, and the drawn visual graph is the output of the drawing model.
According to the rendering scheme provided by the embodiment, the audio data interface is called to sample audio track information to obtain sampling data, and the sampling data is matched with the playing progress of audio; according to the preset drawing style and the sampling data, the visual graph matched with the playing progress of the audio is drawn, when the playing progress of the audio changes, the visual graph changes accordingly, so that the feeling of restraining and stopping the audio can be shown through the visual graph, and a user can have better substitution feeling.
Example two
Referring to fig. 2, a flowchart illustrating steps of a rendering method according to a second embodiment of the present invention is shown.
The drawing method of the embodiment comprises the following steps:
s202, calling an audio data interface in real time through the monitor, and sampling the audio track information in real time to obtain sampling data, so that the sampling data is updated when the playing progress of the audio changes.
The following is an example of executing the scheme in the embodiment in the Android system, and a person skilled in the art can directly determine, according to the following description, a specific implementation scheme for applying the scheme to other systems, which is also within the protection scope of the present application.
In this embodiment, in a specific implementation, the audio data may be collected by the monitor Visualizer during playing of the audio/video file.
A media layer can be created in the Android system, and an audio/video file can be played through the media layer; when the audio and video starts playing, the creation of the monitor visualizer is triggered by the start playing event. After the audio track information is created, an audio data interface of an Android system can be called through a monitor visualizer, the audio track information is sampled, and therefore sampled data is obtained and updated along with the change of the playing progress of the audio.
Specifically, when the media player plays the audio/video file, the player may be made equal to mediaplayer. The audio/video file address is only illustrative, and when the audio/video file address is used specifically, the storage address of the audio/video file can be used for replacing the characters; in addition, the start () represents that the playing of the audio/video file of the corresponding address is started.
Specifically, when creating the monitor Visualizer, the audio data may be acquired through session, for example, a visual new Visualizer (player. getAudioSessionId ()) may be set, where getAudioSessionId () functions to acquire track information of the audio data in the audio/video file being played, and after the acquisition, the monitor Visualizer may be created through the acquired track information.
After the monitor Visualizer is created, parameters of the monitor are set, for example, the size of data grabbed by the monitor can be set through visual. And after the parameters are set, the audio data interface can be called in real time through the monitor Visualizer, and the audio track information is sampled in real time.
In sampling, on WaveFormDataCapture interface can be monitored by monitor Visualizer, so as to sample the audio track information, and the sampled data is returned by the monitoring function. Specifically, the sampling data bytes can be obtained by performing snooping in the following manner.
visual.setDataCaptureListener(
new Visualizer.OnDataCaptureListener()
{
@Override
public void onWaveFormDataCapture(Visualizer visualizer,byte[]bytes,int samplingRate)
{
}
},
Visualizer.getMaxCaptureRate()/2,true,false);
visual.setEnabled(true);
The obtained sample data bytes may be a byte array, that is, the sample data bytes may include a plurality of data values obtained by sampling the audio track information at a preset frequency, and a larger data value indicates a stronger vibration of the audio track.
Additionally, the above visualizer may represent a preset frequency, such as 10ms once, and the higher the preset frequency is, the more times the track data is captured in a unit time is, and the faster the update speed of the sampling data is.
It should be noted that, since the sampling data is updated along with the change of the playing progress when the sampling data is acquired in step S202, after the sampling data is updated, step S204 may be executed again, that is, the visual graph matching the playing progress of the audio is rendered again according to the preset rendering style and the updated sampling data.
Specifically, sample data bytes can be monitored, and when data change exists in the sample data bytes, the call of an onDraw method is triggered through view. Because the sampled data bytes are matched with the playing progress of the audio, the visual graph is redrawn according to the updated sampled data bytes, so that the visual graph can be matched with the playing progress of the audio, the visual graph which changes along with the change of the playing progress of the audio is displayed to a user, and the substitution feeling of the user is further improved.
And S204, drawing a visual graph matched with the playing progress of the audio according to a preset drawing style and the sampling data.
In this embodiment, as can be seen from the step S202, the sampling data may include a plurality of data values obtained by sampling the audio track information at a preset frequency; correspondingly, as shown in fig. 3, step S204 includes:
s2042, calculating a plurality of coordinate data according to the plurality of data values in the sampling data and a preset coordinate point calculation model.
In this embodiment, the coordinate point calculation model is taken as an example of a coordinate point calculation model corresponding to a histogram, where one data value may correspond to a pillar in the histogram.
When the visualization graph is a bar graph, a graph drawing parameter may be preset in the coordinate point calculation model, and step S2042 may specifically include: and calculating to obtain coordinate data of a plurality of columns in the column diagram according to the plurality of data values and preset graph drawing parameters.
Specifically, the width of the pillar and the bottom coordinates of the pillar may be preset in the coordinate point calculation model, and during calculation, the height of one pillar may be calculated according to one data value in the sampling data, and the abscissa of the pillar may be calculated according to the number of the pillar, so as to obtain the width, height, bottom coordinates, and abscissa of a single pillar. The coordinate data may include the width, height, bottom coordinate, and abscissa of all the pillars determined from the data values.
In the setting, the width of all the pillars can be set to be 2 in advance; setting the bottom coordinates y of all the columns to be 0; and determines height (index) of the column of the first index as bytes [ index ], and determines the abscissa x of the left boundary of the column of the first index according to the set column width and the distance between the columns. Where index is used to indicate the number of the column, in this embodiment, the number of the leftmost column is 0, and the number of the column is incremented by 1 from left to right.
In this embodiment, after the coordinate data corresponding to the pillar is determined, the corresponding pillar can be drawn through step S2044.
And S2044, drawing a visual graph matched with the playing progress of the audio according to the coordinate data.
In this embodiment, since the sampled data is matched with the playing progress of the audio, the visual graph drawn according to the sampled data is also matched with the playing progress of the audio.
In this embodiment, through a plurality of data values and the predetermined coordinate point calculation model in according to the sampling data, can directly calculate the coordinate point that is applicable to drawing visual figure, consequently, as long as change coordinate point calculation model can change the visual figure that draws and obtain for visual figure's switching is more nimble.
Further, step S2044 may include: the visualization graph is rendered in a view component.
Correspondingly, the coordinate data are used for representing the positions of points in the visual graph to be drawn in the view component. Specifically, when drawing, a view component may be customized, and the ondraw method is used to rewrite the view component, so as to draw the visual graph in the view component according to the coordinate data.
In another implementation manner of this embodiment, the preset drawing style includes a drawing scheme, and correspondingly, step S204 may include: and drawing a visual graph matched with the playing progress of the audio according to the graph drawing scheme and the sampling data.
Specifically, the graphic drawing scheme may specifically include a scheme of how to draw a line from the sample data, fill in color, and the like. And a visual graph corresponding to the sampling data can be accurately drawn according to the graph drawing scheme.
Further, in this embodiment, the graph drawing scheme may be used together with the coordinate point calculation model, as shown in fig. 4, a monitor Visualizer may first sample audio track data in an audio/video file to obtain sample data bytes, then calculate a plurality of coordinate data according to a plurality of data values in the sample data bytes and a preset coordinate point calculation model, and then draw a visual graph matching the audio playing progress according to the graph drawing scheme and the coordinate data. At this time, the graphic drawing scheme may include a scheme of drawing a line according to the coordinate points and filling colors according to the coordinate points.
For example, taking the above histogram drawing as an example, the graph drawing scheme may include: and drawing a cylindrical frame in the view component according to the coordinate data, and filling colors in a graph enclosed by the frame to obtain a histogram, wherein the drawing result can be specifically referred to fig. 4. Specifically, the rendering may be performed by a canvas, that is, a rendering function is called by canvas, that is, a left coordinate of a current pillar, that is, an abscissa of a left side frame of the pillar, a right coordinate of an x + width (pillar width), that is, an abscissa of a right side frame of the pillar, a top coordinate (pillar height), that is, an ordinate of an upper side frame of the pillar, a bottom coordinate, that is, an ordinate of a lower side frame of the pillar, and a paint for rendering, where the paint is used to render graphics on the canvas, and since a larger data value indicates a stronger vibration of the track and a value of the height is equal to the data value, the stronger vibration of the pillar is, so that the pillar obtained by rendering corresponds to a vibration waveform of the audio and corresponds to the audio, and x, y, width, height may be determined with reference to the above description, and the description is omitted here. In addition, the thickness of the paintbrush paint can be set through the paint. A brush color, etc. is set by paint.
In practical use, a plurality of coordinate data can be obtained by calculation according to a plurality of data values in the sampling data, then drawing is carried out according to a graph drawing scheme and a plurality of coordinate data, for example, the point coordinates of the top of a column can be calculated according to all current data values, and then each point coordinate is connected to obtain a straight line waveform diagram; or calculating to obtain coordinate data corresponding to one data value in the sampled data according to the data value, then drawing a graph corresponding to the data value according to a graph drawing scheme and the coordinate data, and after the drawing is completed, calculating coordinate data according to the next data value until all data values in the sampled data are traversed and drawn to obtain a final visual graph, which is not limited in this embodiment.
The scheme that this embodiment provided can pass through the audio data interface is called in real time to the monitor, and is right the audio track information carries out real-time sampling and obtains the sampling data, makes the sampling data updates when the broadcast progress of audio frequency changes, and then can redraw visual figure according to the sampling data who updates for along with the change of the broadcast progress of audio frequency, can redraw visual figure in real time, and then can make the visual figure of show and the wave form and the frequency of audio frequency match more, obtain visual effect better, make the user have better substitution and feel.
The rendering method of the present embodiment may be performed by any suitable terminal device having data processing capabilities, including but not limited to: mobile terminals (such as tablet computers, mobile phones and the like) and PCs.
EXAMPLE III
Referring to fig. 5, a block diagram of a rendering apparatus according to a third embodiment of the present invention is shown.
The drawing device shown in fig. 5 includes: a sampling module 302 and a rendering module 304.
The sampling module 302 is configured to sample audio track information by calling an audio data interface to obtain sampling data, where the sampling data is matched with a playing progress of audio.
And the drawing module 304 is configured to draw a visual graph matched with the playing progress of the audio according to a preset drawing style and the sampling data.
In an optional embodiment, the sampling data includes a plurality of data values obtained by sampling the audio track information at a preset frequency; correspondingly, the drawing module comprises: the coordinate calculation module is used for calculating a plurality of coordinate data according to a plurality of data values in the sampling data and a preset coordinate point calculation model; and the coordinate drawing module is used for drawing a visual graph matched with the playing progress of the audio according to the coordinate data.
In an optional implementation, the coordinate drawing module is specifically configured to: drawing the visual graph in a view component, wherein correspondingly, the coordinate data are used for representing the positions of points in the visual graph to be drawn in the view component.
In an optional embodiment, the visualized graph is a bar graph, and the coordinate point calculation model is preset with graph drawing parameters, and the coordinate calculation module is specifically configured to: and calculating coordinate data of a plurality of columns in the column diagram according to the plurality of data values and the graph drawing parameters.
In an optional implementation manner, the preset drawing style includes a drawing scheme, and correspondingly, the drawing module is specifically configured to: and drawing a visual graph matched with the playing progress of the audio according to the graph drawing scheme and the sampling data.
In an optional implementation manner, the sampling module is specifically configured to: and calling an audio data interface in real time through the monitor, and sampling the audio track information in real time to obtain sampling data, so that the sampling data is updated when the playing progress of the audio changes.
In an optional embodiment, after the sample data is updated, the rendering module 304 renders the visual graph matching the playing progress of the audio according to a preset rendering style and the updated sample data.
According to the scheme provided by the embodiment of the invention, the audio data interface is called to sample the audio track information to obtain the sampling data, and the sampling data is matched with the playing progress of the audio; according to the preset drawing style and the sampling data, the visual graph matched with the playing progress of the audio is drawn, when the playing progress of the audio changes, the visual graph changes accordingly, so that the feeling of restraining and stopping the audio can be shown through the visual graph, and a user can have better substitution feeling.
Example four
A terminal device, comprising: the system comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete mutual communication through the communication bus; the memory is used for storing at least one executable instruction, and the executable instruction causes the processor to execute the operation corresponding to the drawing method.
Specifically, referring to fig. 6, a schematic structural diagram of a terminal device according to a fifth embodiment of the present invention is shown, and the specific embodiment of the present invention does not limit the specific implementation of the terminal device.
As shown in fig. 6, the terminal device may include: a processor (processor)402, a Communications Interface 404, a memory 406, and a Communications bus 408.
Wherein:
the processor 402, communication interface 404, and memory 406 communicate with each other via a communication bus 408.
A communication interface 404 for communicating with other terminal devices or servers.
The processor 402 is configured to execute the program 410, and may specifically perform relevant steps in the above-described drawing method embodiment.
In particular, program 410 may include program code comprising computer operating instructions.
The processor 402 may be a central processing unit CPU, or an application specific Integrated circuit asic, or one or more Integrated circuits configured to implement an embodiment of the present invention. The terminal device comprises one or more processors, which can be the same type of processor, such as one or more CPUs; or may be different types of processors such as one or more CPUs and one or more ASICs.
And a memory 406 for storing a program 410. Memory 406 may comprise high-speed RAM memory, and may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
The program 410 may specifically be configured to cause the processor 402 to perform the following operations: sampling audio track information by calling an audio data interface to obtain sampling data, wherein the sampling data is matched with the playing progress of audio; and drawing a visual graph matched with the playing progress of the audio according to a preset drawing style and the sampling data.
In an optional embodiment, the sampling data includes a plurality of data values obtained by sampling the audio track information at a preset frequency; correspondingly, the step of drawing the visual graph matched with the playing progress of the audio according to the preset drawing style and the sampling data comprises the following steps: calculating a plurality of coordinate data according to a plurality of data values in the sampling data and a preset coordinate point calculation model; and drawing a visual graph matched with the playing progress of the audio according to the coordinate data.
In an optional embodiment, the drawing a visual graph matching with the playing progress of the audio according to the coordinate data includes: drawing the visual graph in a view component, wherein correspondingly, the coordinate data are used for representing the positions of points in the visual graph to be drawn in the view component.
In an optional embodiment, the visualized graph is a bar graph, and the coordinate point calculation model is preset with graph drawing parameters, and the calculating a plurality of coordinate data according to the plurality of data values in the sampling data and the preset coordinate point calculation model includes: and calculating coordinate data of a plurality of columns in the column diagram according to the plurality of data values and preset graph drawing parameters.
In an optional implementation manner, the preset drawing style includes a drawing scheme of a graphic, and correspondingly, the drawing, according to the preset drawing style and the sampling data, a visual graphic matched with the playing progress of the audio includes: and drawing a visual graph matched with the playing progress of the audio according to the graph drawing scheme and the sampling data.
In an optional embodiment, the sampling the audio track information by calling an audio data interface to obtain sampling data includes: and calling an audio data interface in real time through the monitor, and sampling the audio track information in real time to obtain sampling data, so that the sampling data is updated when the playing progress of the audio changes.
In an optional implementation manner, after the sampling data is updated, the visual graph matched with the playing progress of the audio is drawn again according to a preset drawing style and the updated sampling data.
For specific implementation of each step in the program 410, reference may be made to corresponding steps and corresponding descriptions in units in the foregoing drawing method embodiments, which are not described herein again. It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described devices and modules may refer to the corresponding process descriptions in the foregoing method embodiments, and are not described herein again.
The terminal device of the embodiment samples the audio track information by calling the audio data interface to obtain the sampling data, and the sampling data is matched with the playing progress of the audio; according to the preset drawing style and the sampling data, the visual graph matched with the playing progress of the audio is drawn, when the playing progress of the audio changes, the visual graph changes accordingly, so that the feeling of restraining and stopping the audio can be shown through the visual graph, and a user can have better substitution feeling.
It should be noted that, according to the implementation requirement, each component/step described in the embodiment of the present invention may be divided into more components/steps, and two or more components/steps or partial operations of the components/steps may also be combined into a new component/step to achieve the purpose of the embodiment of the present invention.
The above-described method according to an embodiment of the present invention may be implemented in hardware, firmware, or as software or computer code storable in a recording medium such as a CD ROM, a RAM, a floppy disk, a hard disk, or a magneto-optical disk, or as computer code originally stored in a remote recording medium or a non-transitory machine-readable medium downloaded through a network and to be stored in a local recording medium, so that the method described herein may be stored in such software processing on a recording medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware such as an ASIC or FPGA. It will be appreciated that the computer, processor, microprocessor controller or programmable hardware includes memory components (e.g., RAM, ROM, flash memory, etc.) that can store or receive software or computer code that, when accessed and executed by the computer, processor or hardware, implements the rendering methods described herein. Further, when a general-purpose computer accesses code for implementing the rendering method shown herein, execution of the code converts the general-purpose computer into a special-purpose computer for executing the rendering method shown herein.
Those of ordinary skill in the art will appreciate that the various illustrative elements and method steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present embodiments.
The above embodiments are only for illustrating the embodiments of the present invention and not for limiting the embodiments of the present invention, and those skilled in the art can make various changes and modifications without departing from the spirit and scope of the embodiments of the present invention, so that all equivalent technical solutions also belong to the scope of the embodiments of the present invention, and the scope of patent protection of the embodiments of the present invention should be defined by the claims.
Claims (13)
1. A method of rendering, comprising:
sampling audio track information by calling an audio data interface to obtain sampling data, wherein the sampling data is matched with the playing progress of audio;
and drawing a visual graph matched with the playing progress of the audio according to a preset drawing style and the sampling data.
2. The method according to claim 1, wherein the sampling data comprises a plurality of data values obtained by sampling the audio track information at a preset frequency; correspondingly, the step of drawing the visual graph matched with the playing progress of the audio according to the preset drawing style and the sampling data comprises the following steps:
calculating a plurality of coordinate data according to a plurality of data values in the sampling data and a preset coordinate point calculation model;
and drawing a visual graph matched with the playing progress of the audio according to the coordinate data.
3. The method of claim 2, wherein the drawing a visual graph matching the playing progress of the audio according to the coordinate data comprises: drawing the visual graph in a view component, wherein correspondingly, the coordinate data are used for representing the positions of points in the visual graph to be drawn in the view component.
4. The method according to claim 2, wherein the visualized graph is a bar graph, and the coordinate point calculation model is preset with graph drawing parameters, and the calculating a plurality of coordinate data according to the plurality of data values in the sampled data and the preset coordinate point calculation model comprises:
and calculating coordinate data of a plurality of columns in the column diagram according to the plurality of data values and preset graph drawing parameters.
5. The method according to claim 1, wherein the preset drawing style comprises a drawing scheme of a graph, and correspondingly, the drawing of the visual graph matched with the playing progress of the audio according to the preset drawing style and the sampling data comprises:
and drawing a visual graph matched with the playing progress of the audio according to the graph drawing scheme and the sampling data.
6. The method of claim 1, wherein sampling audio track information into sample data by invoking an audio data interface comprises:
and calling an audio data interface in real time through the monitor, and sampling the audio track information in real time to obtain sampling data, so that the sampling data is updated when the playing progress of the audio changes.
7. The method according to claim 6, wherein after the sample data is updated, the visual graphics matching with the playing progress of the audio are rendered again according to a preset rendering style and the updated sample data.
8. A rendering apparatus, comprising:
the sampling module is used for sampling the audio track information by calling an audio data interface to obtain sampling data, and the sampling data is matched with the playing progress of the audio;
and the drawing module is used for drawing a visual graph matched with the playing progress of the audio according to a preset drawing style and the sampling data.
9. The apparatus according to claim 8, wherein the sampling data comprises a plurality of data values obtained by sampling the audio track information at a preset frequency; correspondingly, the drawing module comprises:
the coordinate calculation module is used for calculating a plurality of coordinate data according to a plurality of data values in the sampling data and a preset coordinate point calculation model;
and the coordinate drawing module is used for drawing a visual graph matched with the playing progress of the audio according to the coordinate data.
10. The apparatus according to claim 8, wherein the preset drawing style includes a drawing scheme, and correspondingly, the drawing module is specifically configured to: and drawing a visual graph matched with the playing progress of the audio according to the graph drawing scheme and the sampling data.
11. The apparatus of claim 8, wherein the sampling module is specifically configured to: and calling an audio data interface in real time through the monitor, and sampling the audio track information in real time to obtain sampling data, so that the sampling data is updated when the playing progress of the audio changes.
12. A terminal device, comprising: the system comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete mutual communication through the communication bus;
the memory is used for storing at least one executable instruction, and the executable instruction causes the processor to execute the operation corresponding to the drawing method according to any one of claims 1-7.
13. A computer storage medium having stored thereon a computer program which, when executed by a processor, implements the rendering method of any one of claims 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910272239.7A CN111782866A (en) | 2019-04-04 | 2019-04-04 | Drawing method, drawing device, terminal equipment and computer storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910272239.7A CN111782866A (en) | 2019-04-04 | 2019-04-04 | Drawing method, drawing device, terminal equipment and computer storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN111782866A true CN111782866A (en) | 2020-10-16 |
Family
ID=72755169
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910272239.7A Pending CN111782866A (en) | 2019-04-04 | 2019-04-04 | Drawing method, drawing device, terminal equipment and computer storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111782866A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112237740A (en) * | 2020-10-26 | 2021-01-19 | 网易(杭州)网络有限公司 | Beat data extraction method and device, electronic equipment and computer readable medium |
CN112667828A (en) * | 2020-12-31 | 2021-04-16 | 福建星网视易信息系统有限公司 | Audio visualization method and terminal |
CN116088390A (en) * | 2023-02-23 | 2023-05-09 | 展讯通信(上海)有限公司 | Audio processing method and device and electronic equipment |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1885976A (en) * | 2005-06-24 | 2006-12-27 | 英华达(上海)电子有限公司 | Method for making sound graphic display and playing on mobile phone display screen |
CN103338305A (en) * | 2013-06-20 | 2013-10-02 | 张家港保税区润桐电子技术研发有限公司 | Mobile phone and method for processing playing of audio file adopting same |
CN108010110A (en) * | 2017-11-24 | 2018-05-08 | 北京酷我科技有限公司 | A kind of methods of exhibiting of frequency spectrum effect during broadcasting Hi-Fi music |
CN108182047A (en) * | 2016-12-08 | 2018-06-19 | 武汉斗鱼网络科技有限公司 | The display methods and device of a kind of information volume |
-
2019
- 2019-04-04 CN CN201910272239.7A patent/CN111782866A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1885976A (en) * | 2005-06-24 | 2006-12-27 | 英华达(上海)电子有限公司 | Method for making sound graphic display and playing on mobile phone display screen |
CN103338305A (en) * | 2013-06-20 | 2013-10-02 | 张家港保税区润桐电子技术研发有限公司 | Mobile phone and method for processing playing of audio file adopting same |
CN108182047A (en) * | 2016-12-08 | 2018-06-19 | 武汉斗鱼网络科技有限公司 | The display methods and device of a kind of information volume |
CN108010110A (en) * | 2017-11-24 | 2018-05-08 | 北京酷我科技有限公司 | A kind of methods of exhibiting of frequency spectrum effect during broadcasting Hi-Fi music |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112237740A (en) * | 2020-10-26 | 2021-01-19 | 网易(杭州)网络有限公司 | Beat data extraction method and device, electronic equipment and computer readable medium |
CN112237740B (en) * | 2020-10-26 | 2024-03-15 | 网易(杭州)网络有限公司 | Beat data extraction method and device, electronic equipment and computer readable medium |
CN112667828A (en) * | 2020-12-31 | 2021-04-16 | 福建星网视易信息系统有限公司 | Audio visualization method and terminal |
CN116088390A (en) * | 2023-02-23 | 2023-05-09 | 展讯通信(上海)有限公司 | Audio processing method and device and electronic equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111782866A (en) | Drawing method, drawing device, terminal equipment and computer storage medium | |
CN107463331B (en) | Gesture track simulation method and device and electronic equipment | |
CN112102437B (en) | Canvas-based radar map generation method and device, storage medium and terminal | |
CN108089958A (en) | GPU test methods, terminal device and computer readable storage medium | |
CN108900854A (en) | Connect wheat room switching method, storage medium, equipment and system in live streaming | |
CN110795177A (en) | Graph drawing method and device | |
CN108282683A (en) | A kind of video clip display methods and device | |
CN109669751A (en) | A kind of method for drafting of input frame, device, terminal and computer storage medium | |
CN109636875B (en) | Graph drawing method, device and storage medium | |
CN113259752A (en) | Method and device for controlling playing of interactive video in browser page and server | |
CN112560308A (en) | Automobile crash test platform construction method and device based on finite elements | |
CN109976865B (en) | Task progress display method and device and terminal equipment | |
CN109840201B (en) | UI test method, device, electronic equipment and computer readable storage medium | |
CN109298817B (en) | Item display method, item display device, terminal and storage medium | |
CN107529095A (en) | A kind of video-splicing method and device | |
CN106919260A (en) | Web page operation method and apparatus | |
CN109766530B (en) | Method and device for generating chart frame, storage medium and electronic equipment | |
CN108287842B (en) | Method and device for preventing cover of navigation map and navigation equipment | |
CN114186228A (en) | Attack event visualization method and device and related equipment | |
CN113034649B (en) | Chinese character drawing and displaying method and device, electronic equipment and medium | |
CN106951138B (en) | Icon fuzzification method and device | |
CN108525304B (en) | Image analysis method and device, storage medium and electronic device | |
CN115671735A (en) | Object selection method and device in game and electronic equipment | |
CN114712853A (en) | Game map loading and displaying method, device, equipment and storage medium | |
CN114035725A (en) | Teaching method and device of ultrasonic equipment, ultrasonic imaging equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |