CN101634588B - A method and device for drawing audio waveforms - Google Patents
A method and device for drawing audio waveforms Download PDFInfo
- Publication number
- CN101634588B CN101634588B CN2008101172334A CN200810117233A CN101634588B CN 101634588 B CN101634588 B CN 101634588B CN 2008101172334 A CN2008101172334 A CN 2008101172334A CN 200810117233 A CN200810117233 A CN 200810117233A CN 101634588 B CN101634588 B CN 101634588B
- Authority
- CN
- China
- Prior art keywords
- audio
- data
- audio data
- display area
- sub
- 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.)
- Expired - Fee Related
Links
Images
Landscapes
- Controls And Circuits For Display Device (AREA)
- Circuit For Audible Band Transducer (AREA)
Abstract
Description
技术领域technical field
本发明涉及音频数据处理领域,特别涉及一种音频波形绘制的方法和装置。The invention relates to the field of audio data processing, in particular to a method and device for drawing audio waveforms.
背景技术Background technique
音频编辑在电台、电视台以及其他数字化建设中起着重要的作用,是媒体管理系统的重要组成部分。比如电台和电视台,编辑在对采集的原始素材入库之前,都要进行快速的编辑操作,以达到提取用户感兴趣的内容等目的。如果在编辑原始媒体素材时,系统能够准确、快速显示对应的音频数据的波形,则可以对音频数据的特征区进行快速定位(如静音区等),从而加快了编辑操作的时间,提高了工作效率。Audio editing plays an important role in radio stations, TV stations and other digital constructions, and is an important part of the media management system. For example, in radio stations and TV stations, editors must perform quick editing operations before storing the collected original materials into the library, so as to extract the content that users are interested in. If the system can accurately and quickly display the waveform of the corresponding audio data when editing the original media material, it can quickly locate the characteristic area of the audio data (such as the silent area, etc.), thereby speeding up the time of editing operations and improving the efficiency of work. efficiency.
目前有两种比较常用的波形绘制方法:There are currently two commonly used waveform drawing methods:
第一种、无缓冲方法。The first, unbuffered method.
该方法读取磁盘中显示区域对应的数据,将读取的数据绘制成波形进行显示,在用户对显示区域的数据进行操作(或调整显示区域)时,需要继续读取磁盘中的数据,将操作后的数据绘制成波形进行显示。This method reads the data corresponding to the display area in the disk, and draws the read data into a waveform for display. When the user operates on the data in the display area (or adjusts the display area), it needs to continue to read the data in the disk. The manipulated data is plotted as a waveform for display.
由于该方法将对音频数据的所有操作都放到磁盘中进行,这样会导致用户在进行操作时,就必须反复读取磁盘上的数据,由于读取磁盘的速度相对较慢,所以严重影响了绘制波形的时间。Because this method puts all the operations on the audio data on the disk, it will cause the user to repeatedly read the data on the disk when performing operations. Since the speed of reading the disk is relatively slow, it seriously affects the The time to draw the waveform.
第二种、全缓冲方法。The second is the full buffer method.
该方法先将所有音频数据存储到内存中,读取内存中显示区域对应的数据,将读取的数据绘制成波形进行显示,在用户对显示区域的数据进行操作(或调整显示区域)时,需要继续读取内存中的数据,将操作后的数据绘制成波形进行显示。This method first stores all audio data in the memory, reads the data corresponding to the display area in the memory, draws the read data into a waveform for display, and when the user operates on the data in the display area (or adjusts the display area), It is necessary to continue to read the data in the memory, and draw the operated data into a waveform for display.
由于该方法将所有音频数据存储到内存中,相比于第一种方法加快了绘制波形的速度,但是由于内存容量相对磁盘容量要小许多,对于大容量的音频数据,无法将整个音频数据全部存储到内存中,所以第二种方法无法适用大容量的音频数据。Since this method stores all audio data in the memory, it speeds up the drawing of the waveform compared to the first method, but because the memory capacity is much smaller than the disk capacity, for large-capacity audio data, it is impossible to store the entire audio data. Stored in memory, so the second method cannot be applied to large-capacity audio data.
综上所述,目前波形绘制的方法,处理对于大容量的音频文件的速度慢,从而增加了操作的时间,降低了工作效率。To sum up, the current waveform drawing method is slow in processing large-capacity audio files, which increases the operation time and reduces work efficiency.
发明内容Contents of the invention
本发明实施例提供一种音频波形绘制的方法和装置,用以解决现有技术中存在的波形绘制的方法,处理对于大容量的音频文件的速度慢,从而增加了操作的时间,降低了工作效率的问题。Embodiments of the present invention provide a method and device for drawing audio waveforms, which are used to solve the problem of waveform drawing methods in the prior art. The speed of processing large-capacity audio files is slow, thereby increasing the operation time and reducing the workload. The question of efficiency.
本发明实施例提供的一种音频波形绘制的方法包括:A method for drawing an audio waveform provided by an embodiment of the present invention includes:
确定显示音频数据的颗粒象素的数量,所述颗粒象素用于显示音频数据的音频波形;Determining the number of grainy pixels for displaying audio data, the grainy pixels being used to display an audio waveform of the audio data;
根据音频数据容量和所述显示音频数据的颗粒象素的数量,将音频波形显示区域对应的音频数据划分为多个音频子数据段;According to the audio data capacity and the quantity of the granular pixel of described display audio data, the audio data corresponding to the audio waveform display area is divided into a plurality of audio sub-data segments;
将划分后的不同的音频子数据段,根据音频数据播放时间分别存储到对应的显示缓存单元中;Store the divided different audio sub-data segments into corresponding display buffer units according to the audio data playback time;
根据所述音频数据播放时间,将对应的显示缓存单元中的音频子数据段,绘制成音频波形。According to the playing time of the audio data, the corresponding audio sub-data segment in the display buffer unit is drawn into an audio waveform.
本发明实施例提供的一种音频波形绘制装置包括:An audio waveform drawing device provided in an embodiment of the present invention includes:
确定模块,用于确定显示音频数据的颗粒象素的数量,所述颗粒象素用于显示音频数据的音频波形;Determining module, is used for determining the quantity of the granular pixel of display audio data, and described granular pixel is used for the audio wave form of display audio data;
第一划分模块,用于根据音频数据容量和所述显示音频数据的颗粒象素的数量,将音频波形显示区域对应的音频数据划分为多个音频子数据段;The first division module is used to divide the audio data corresponding to the audio waveform display area into a plurality of audio sub-data segments according to the audio data capacity and the number of granular pixels of the displayed audio data;
第一处理模块,用于将划分后的不同的音频子数据段,根据音频数据播放时间分别存储到对应的显示缓存单元中;The first processing module is used to store the divided different audio sub-data segments into corresponding display buffer units according to the playing time of the audio data;
绘制模块,用于根据所述音频数据播放时间,将对应的显示缓存单元中的音频子数据段,绘制成音频波形。The drawing module is used to draw the corresponding audio sub-data segment in the display buffer unit into an audio waveform according to the playing time of the audio data.
本发明实施例确定显示音频数据的颗粒象素的数量,所述颗粒象素用于显示音频数据的音频波形;根据音频数据容量和所述显示音频数据的颗粒象素的数量,将音频波形显示区域对应的音频数据划分为多个音频子数据段;将划分后的不同的音频子数据段,根据音频数据播放时间分别存储到对应的显示缓存单元中;根据所述音频数据播放时间,将对应的显示缓存单元中的音频子数据段,绘制成音频波形,由于不论文件大小,都可以将音频波形显示区域的音频数据存储在内存中,从而加快了处理音频数据的速度,提高了工作效率。The embodiment of the present invention determines the number of granular pixels for displaying audio data, and the granular pixels are used to display the audio waveform of the audio data; according to the audio data capacity and the number of granular pixels for displaying the audio data, the audio waveform is displayed The audio data corresponding to the region is divided into a plurality of audio sub-data segments; the divided different audio sub-data segments are stored in corresponding display buffer units according to the audio data playback time; according to the audio data playback time, the corresponding The audio sub-data segment in the display buffer unit is drawn into an audio waveform. Since the audio data in the audio waveform display area can be stored in the memory regardless of the file size, the speed of processing audio data is accelerated and the work efficiency is improved.
附图说明Description of drawings
图1为本发明实施例音频波形绘制装置结构示意图;FIG. 1 is a schematic structural diagram of an audio waveform drawing device according to an embodiment of the present invention;
图2为本发明实施例音频波形绘制的方法示意图;2 is a schematic diagram of a method for drawing an audio waveform according to an embodiment of the present invention;
图3A为本发明实施例缓存模块示意图;FIG. 3A is a schematic diagram of a cache module according to an embodiment of the present invention;
图3B为本发明实施例第一种音频波形显示区域移动后缓存模块变化示意图;FIG. 3B is a schematic diagram of the change of the buffer module after the first audio waveform display area moves according to the embodiment of the present invention;
图3C为本发明实施例第二种音频波形显示区域移动后缓存模块变化示意图;FIG. 3C is a schematic diagram of the change of the buffer module after the second audio waveform display area moves according to the embodiment of the present invention;
图4为本发明实施例音频波形显示区域移动后的方法流程示意图;Fig. 4 is a schematic flow chart of the method after the audio waveform display area is moved according to the embodiment of the present invention;
图5为本发明实施例显示粒度调整后的方法流程示意图。Fig. 5 is a schematic flow chart showing the method after particle size adjustment according to an embodiment of the present invention.
具体实施方式Detailed ways
本发明实施例根据音频数据容量和显示音频数据的颗粒象素的数量,将音频波形显示区域对应的音频数据划分为多个音频子数据段,并将音频子数据段存储到显示缓存单元中,实现了不论文件大小,都可以将音频波形显示区域的音频数据存储在内存中,从而加快了处理音频数据的速度,提高了工作效率。The embodiment of the present invention divides the audio data corresponding to the audio waveform display area into a plurality of audio sub-data segments according to the audio data capacity and the number of granular pixels displaying the audio data, and stores the audio sub-data segments in the display buffer unit, The audio data in the audio waveform display area can be stored in the memory regardless of the file size, thereby speeding up the processing of audio data and improving work efficiency.
其中,显示音频数据的颗粒象素的数量为音频波形显示区域中显示该音频数据波形的颗粒象素的数量;进一步的,Wherein, the quantity of the granular pixel of display audio data is the quantity of the granular pixel of this audio data waveform display in the audio waveform display area; Further,
音频波形显示区域的颗粒象素的数量为音频波形显示区域中能够显示音频数据波形的颗粒象素的数量。The number of grainy pixels in the audio waveform display area is the number of grainy pixels capable of displaying audio data waveforms in the audio waveform display area.
显示音频数据的颗粒象素的数量和音频波形显示区域的颗粒象素的数量可以相同,也可以不同。The number of grainy pixels displaying audio data and the number of grainy pixels in the audio waveform display area may be the same or different.
具体的,相同时说明音频波形显示区域的所有颗粒象素都显示音频数据的波形,比如:音频波形显示区域的时间等于或小于视频文件的时间。Specifically, it also shows that all the granular pixels in the audio waveform display area display the waveform of the audio data, for example: the time of the audio waveform display area is equal to or less than the time of the video file.
不同时说明音频波形显示区域的部分颗粒象素显示音频数据的波形,比如:音频波形显示区域的时间大于视频文件的时间。It does not mean that some granular pixels in the audio waveform display area display the waveform of the audio data, for example: the time of the audio waveform display area is longer than the time of the video file.
在具体实施过程中,音频波形显示区域的时间可以进行调整(即调整显示粒度),使得音频波形显示区域的每个颗粒象素的时间长度都会发生变化,从而可以改变显示音频数据的颗粒象素的数量。In the specific implementation process, the time of the audio waveform display area can be adjusted (that is, the display granularity is adjusted), so that the time length of each granular pixel in the audio waveform display area will change, so that the granular pixels displaying audio data can be changed quantity.
下面结合说明书附图对本发明实施例作进一步详细描述。The embodiments of the present invention will be further described in detail below in conjunction with the accompanying drawings.
如图1所示,本发明实施例音频波形绘制装置包括:确定模块100、第一划分模块101、第一处理模块102和绘制模块103。As shown in FIG. 1 , the audio waveform drawing device according to the embodiment of the present invention includes: a determination module 100 , a first division module 101 , a first processing module 102 and a drawing module 103 .
确定模块100,用于确定显示音频数据的颗粒象素的数量。A determining module 100, configured to determine the number of grainy pixels for displaying audio data.
其中,可以根据下列公式确定显示音频数据的颗粒象素的数量:Wherein, the number of grainy pixels displaying audio data can be determined according to the following formula:
Npix为显示音频数据的颗粒象素的数量,N为音频波形显示区域的颗粒象素的数量,T1为音频数据的时间长度,T2为颗粒象素的时间长度。 Npix is the number of granular pixels that display audio data, N is the number of granular pixels in the audio waveform display area, T 1 is the time length of audio data, and T 2 is the time length of granular pixels.
第一划分模块101,用于根据音频数据容量和确定模块100确定的显示音频数据的颗粒象素的数量,将音频波形显示区域对应的音频数据划分为多个音频子数据段。The first dividing module 101 is used for dividing the audio data corresponding to the audio waveform display area into a plurality of audio sub-data segments according to the audio data capacity and the number of granular pixels for displaying the audio data determined by the determining module 100 .
其中,在显示音频数据的颗粒象素的数量不小于音频波形显示区域的颗粒象素的数量时,根据下列公式将音频波形显示区域对应的音频数据划分为多个音频子数据段:Wherein, when the quantity of the granular pixel of display audio data is not less than the quantity of the granular pixel of audio waveform display area, the audio data corresponding to the audio waveform display area is divided into a plurality of audio frequency sub-data segments according to the following formula:
在显示音频数据的颗粒象素的数量小于音频波形显示区域的颗粒象素的数量时,根据下列公式将音频波形显示区域对应的音频数据划分为多个音频子数据段:When the number of granular pixels of the audio data displayed is less than the number of granular pixels of the audio waveform display area, the audio data corresponding to the audio waveform display area is divided into multiple audio sub-data segments according to the following formula:
具体的,根据下列公式计算开始的音频数据位置:Specifically, the starting audio data position is calculated according to the following formula:
offset=Tstart×BytesPerSecondoffset=T start ×BytesPerSecond
其中,Tstart为显示的开始时间(秒),BytesPerSecond为文件的每秒字节数。Among them, T start is the start time (seconds) of the display, and BytesPerSecond is the number of bytes per second of the file.
由于音频波形显示区域的开始位置有可能不是音频数据的开始位置,所以要确定具体从音频数据的哪个位置开始显示。Since the start position of the audio waveform display area may not be the start position of the audio data, it is necessary to determine the specific position of the audio data to start displaying.
然后从确定的位置开始根据Step(音频子数据段容量)划分音频子数据段,直到将音频波形显示区域对应的音频数据都划分完成。Then divide the audio sub-data segment according to the Step (audio sub-data segment capacity) from the determined position until the audio data corresponding to the audio waveform display area is divided.
这样音频波形显示区域的一个颗粒象素显示划分后的一份音频子数据的波形。In this way, one granular pixel in the audio waveform display area displays the divided audio sub-data waveform.
第一处理模块102,用于将第一划分模块101划分后的不同的音频子数据,根据音频数据播放时间分别存储到对应的显示缓存单元中。The first processing module 102 is configured to store different audio sub-data divided by the first dividing module 101 into corresponding display buffer units according to the playing time of the audio data.
其中,显示缓存单元的数量等于音频波形显示区域的颗粒象素的数量,这样可以保证每个音频子数据都对应一个显示缓存单元。Wherein, the number of display buffer units is equal to the number of granular pixels in the audio waveform display area, which can ensure that each audio sub-data corresponds to a display buffer unit.
根据音频数据播放时间分别存储到对应的显示缓存单元中,可以根据需要进行设定,比如将第一个音频子数据段存储到第一个显示缓存单元中,第二个音频子数据段存储到第二个显示缓存单元中,依次类推。According to the playing time of the audio data, they are respectively stored in the corresponding display buffer unit, which can be set according to the needs, for example, the first audio sub-data segment is stored in the first display buffer unit, and the second audio sub-data segment is stored in the The second shows the cache unit, and so on.
在具体实施过程中,如果一个音频子数据段的容量大于一个显示缓存单元,即每个显示缓存单元不能存储音频子数据段的所有数据,则第一处理模块102从每个音频子数据段中提取出等于每个显示缓存单元容量的数据,并根据音频数据播放时间分别存储到对应的缓存单元中。In the specific implementation process, if the capacity of an audio sub-data segment is greater than one display buffer unit, that is, each display buffer unit cannot store all the data of the audio sub-data segment, then the first processing module 102 selects from each audio sub-data segment The data equal to the capacity of each display buffer unit is extracted, and stored in the corresponding buffer unit according to the playing time of the audio data.
如果没有预先设定显示缓存单元的容量,则需要根据下列公式确定显示缓存单元的容量:If the capacity of the display cache unit is not preset, the capacity of the display cache unit needs to be determined according to the following formula:
缓存单元总容量=(显示缓存单元数量+待显示缓存单元数量)×缓存单元容量Total capacity of cache units = (number of cache units displayed + number of cache units to be displayed) × capacity of cache units
第一处理模块102可以按顺序提取,也可以随机提取。The first processing module 102 can be extracted sequentially or randomly.
比如:每个显示缓存单元容量为10k,每个音频子数据段为1M,则可以从音频子数据段开始位置往后提取10k的数据,也可以从音频子数据段中间某一位置往后提取10k的数据,还可以从音频子数据段中随即提取10k的数据。For example: the capacity of each display buffer unit is 10k, and each audio sub-data segment is 1M, then 10k data can be extracted from the beginning position of the audio sub-data segment, or can be extracted from a certain position in the middle of the audio sub-data segment 10k data, and 10k data can also be extracted from the audio sub-data segment at random.
绘制模块103,用于根据音频数据播放时间,将对应的显示缓存单元中的音频子数据段,绘制成音频波形。The drawing module 103 is configured to draw the corresponding audio sub-data segment in the display buffer unit into an audio waveform according to the playing time of the audio data.
绘制模块103可以采用取平均的策略绘制音频数据波形,即计算每个显示缓存单元中的音频子数据段的平均值,根据平均值绘制波形。The drawing module 103 may use an averaging strategy to draw the audio data waveform, that is, calculate the average value of the audio sub-data segments in each display buffer unit, and draw the waveform according to the average value.
需要说明的是,本实施例并不局限于取平均的策略,任何绘制音频数据波形的策略都适用本实施例。It should be noted that this embodiment is not limited to the averaging strategy, and any strategy for drawing audio data waveforms is applicable to this embodiment.
其中,本发明实施例音频波形绘制装置还可以进一步包括:第二划分模块104和第二处理模块105。Wherein, the audio waveform drawing apparatus in the embodiment of the present invention may further include: a second dividing module 104 and a second processing module 105 .
第二划分模块104,用于在音频波形待显示区域有对应的音频数据时,根据音频数据容量和确定模块100确定的显示音频数据的颗粒象素的数量,将音频波形待显示区域对应的音频数据划分为多个音频子数据段。The second dividing module 104 is used for when there is corresponding audio data in the region to be displayed of the audio waveform, according to the audio data capacity and the quantity of the grainy pixels of the display audio data determined by the determination module 100, the audio frequency corresponding to the region to be displayed of the audio waveform The data is divided into a plurality of audio sub-data segments.
其中,音频波形待显示区域可以在音频波形显示区域之后和/或之前,音频波形待显示区域的大小可以根据需要进行设定,比如内存比较大,则可以将音频波形待显示区域设置得比较大,相应的待显示缓存单元的数量会增加。Wherein, the audio waveform display area can be behind and/or before the audio waveform display area, and the size of the audio waveform display area can be set according to needs. For example, if the memory is relatively large, the audio waveform display area can be set relatively large , and the corresponding number of cache units to be displayed will increase.
第二划分模块104划分的方式与第一划分模块101划分的方式类似,不再赘述。The method of dividing by the second dividing module 104 is similar to that of the first dividing module 101 , and will not be repeated here.
第二处理模块105,用于将第二划分模块104划分后的不同的音频子数据段,根据音频数据播放时间分别存储到对应的待显示缓存单元中。The second processing module 105 is configured to store the different audio sub-data segments divided by the second dividing module 104 into corresponding cache units to be displayed according to the playing time of the audio data.
第二处理模块105的处理方式与第一处理模块102的处理方式类似,不再赘述。The processing manner of the second processing module 105 is similar to the processing manner of the first processing module 102, and will not be repeated here.
由于用户在处理音频时,需要来回拖动音频波形显示区域,并且拖动的浮动都不是很大,这样有可能在用户移动后的音频波形显示区域对应的音频数据会存储在缓存单元中,比如移动后的音频波形显示区域对应的音频数据全部都在缓存单元中,即一部分在显示缓存单元中,一部分在待显示缓存单元中,还有可能全部都在待显示缓存单元中;或者移动后的音频波形显示区域对应的音频数据一部分在缓存单元中。Since the user needs to drag the audio waveform display area back and forth when processing audio, and the dragged float is not very large, it is possible that the audio data corresponding to the audio waveform display area after the user moves will be stored in the cache unit, such as The audio data corresponding to the moved audio waveform display area is all in the buffer unit, that is, a part is in the display buffer unit, a part is in the buffer unit to be displayed, and possibly all is in the buffer unit to be displayed; or the moved A part of the audio data corresponding to the audio waveform display area is in the buffer unit.
这样可以保证在显示窗口移动后,可以不需要从磁盘中读取或仅从磁盘中读取一部分数据,进一步减少了与磁盘的交互,加快了绘制波形的速度,并且由于转换后的音频波形待显示缓存单元的音频数据有部分是在显示缓存单元的音频数据之前,这样在用户往前移动音频波形显示区域时,可以减少与磁盘的交互,实现实时显示音频波形。This can ensure that after the display window is moved, there is no need to read from the disk or only a part of the data is read from the disk, which further reduces the interaction with the disk and speeds up the drawing of the waveform. Some of the audio data of the display buffer unit is before the audio data of the buffer unit is displayed, so that when the user moves the audio waveform display area forward, the interaction with the disk can be reduced and the audio waveform can be displayed in real time.
其中,对于移动后的音频波形显示区域对应的音频数据全部都在缓存单元中的情况,本发明实施例音频波形绘制装置还可以进一步包括:第一转换模块106。Wherein, for the situation that all the audio data corresponding to the moved audio waveform display area are in the buffer unit, the audio waveform rendering device in the embodiment of the present invention may further include: a first conversion module 106 .
第一转换模块106,用于当移动后的音频波形显示区域对应的音频数据全部存储在缓存单元中,将移动后的音频波形显示区域的缓存单元作为显示缓存单元,将其他的缓存单元作为待显示缓存单元,通知绘制模块103绘制音频波形。The first conversion module 106 is used to store all the audio data corresponding to the audio waveform display area after the movement in the buffer unit, use the buffer unit of the audio waveform display area after the movement as the display buffer unit, and use other buffer units as the buffer unit to be displayed. The buffer unit is displayed, and the drawing module 103 is notified to draw the audio waveform.
这样绘制模块103就会绘制移动后的音频波形显示区域对应的音频数据的波形。In this way, the drawing module 103 will draw the waveform of the audio data corresponding to the moved audio waveform display area.
其中,对于移动后的音频波形显示区域对应的音频数据一部分在缓存单元中的情况,本发明实施例音频波形绘制装置还可以进一步包括:第三划分模块107、删除模块108、第三处理模块109和第二转换模块110。Wherein, for the case where part of the audio data corresponding to the moved audio waveform display area is in the cache unit, the audio waveform drawing device in the embodiment of the present invention may further include: a third division module 107, a deletion module 108, and a third processing module 109 and the second conversion module 110 .
第三划分模块107,用于当移动后的音频波形显示区域对应的音频数据部份存储在缓存单元中,根据音频数据容量和确定模块100确定的显示音频数据的颗粒象素的数量,对移动后的音频波形显示区域对应的未存储在缓存单元中的音频数据,划分为多个音频子数据段。The third division module 107 is used to store the audio data part corresponding to the audio waveform display area after the movement in the buffer unit, according to the audio data capacity and the quantity of the granular pixels of the display audio data determined by the determination module 100, to move The audio data corresponding to the audio waveform display area that is not stored in the buffer unit is divided into multiple audio sub-data segments.
由于移动后的音频波形显示区域对应的部分音频数据没有缓存到缓存单元中,所以第三划分模块107需要对这部分数据进行划分。Since part of the audio data corresponding to the moved audio waveform display area is not cached in the buffer unit, the third division module 107 needs to divide this part of data.
第三划分模块107划分的方式与第一划分模块101划分的方式类似,不再赘述。The method of dividing by the third dividing module 107 is similar to the way of dividing by the first dividing module 101 , and will not be repeated here.
删除模块108,用于从缓存单元中删除,不需要在移动后的音频波形显示区域内显示的音频波形,对应的音频子数据段。The deletion module 108 is configured to delete from the cache unit, the audio waveform that does not need to be displayed in the moved audio waveform display area, and the corresponding audio sub-data segment.
其中,音频波形显示区域移动后,音频波形显示区域的缓存单元肯定要发生变化,可能有一部分是移动前的显示缓存单元,另一部分是移动前的待显示缓存单元;或者全部都是待显示缓存单元。不管哪种情况,都会有一部分缓存单元没有存储移动后的音频波形显示区域对应的音频数据,这就需要将这部分缓存单元中的音频数据删除,才能将划分的音频数据存储到这些缓存单元中。Among them, after the audio waveform display area is moved, the buffer unit of the audio waveform display area must change, and some may be the display buffer unit before the movement, and the other part is the buffer unit to be displayed before the movement; or all of them are buffer units to be displayed unit. In either case, there will be some buffer units that do not store the audio data corresponding to the moved audio waveform display area, which requires deleting the audio data in this part of the buffer unit before storing the divided audio data into these buffer units .
第三处理模块109,用于将第三划分模块107划分后的不同的音频子数据段,根据音频数据播放时间分别存储到对应的删除音频子数据段的缓存单元中。The third processing module 109 is configured to store the different audio sub-data segments divided by the third dividing module 107 into corresponding buffer units for deleting audio sub-data segments according to the audio data playback time.
第三处理模块109的处理方式与第一处理模块102的处理方式类似,不再赘述。The processing manner of the third processing module 109 is similar to the processing manner of the first processing module 102 , and will not be repeated here.
第二转换模块110,用于将移动后的音频波形显示区域中的缓存单元作为显示缓存单元,将其他的缓存单元作为待显示缓存单元,通知绘制模块103绘制音频波形。The second conversion module 110 is configured to use the buffer unit in the moved audio waveform display area as a display buffer unit, use other buffer units as buffer units to be displayed, and notify the drawing module 103 to draw the audio waveform.
这样绘制模块103就会绘制移动后的音频波形显示区域对应的音频数据的波形。In this way, the drawing module 103 will draw the waveform of the audio data corresponding to the moved audio waveform display area.
其中,本发明实施例音频波形绘制装置还可以进一步包括:通知模块111。Wherein, the audio waveform drawing apparatus in the embodiment of the present invention may further include: a notification module 111 .
通知模块111,用于在音频波形显示区域的显示粒度发生变化后,通知确定模块100根据变化后的显示粒度,确定显示音频数据的颗粒象素的数量。The notification module 111 is configured to notify the determination module 100 to determine the number of granular pixels for displaying audio data according to the changed display granularity after the display granularity of the audio waveform display area changes.
由于显示粒度发生变化,使得显示音频数据的颗粒象素的数量也相应发生变化,从而需要重新确定显示音频数据的颗粒象素的数量。As the display granularity changes, the number of granular pixels displaying audio data also changes accordingly, so the number of granular pixels displaying audio data needs to be re-determined.
如图2所示,本发明实施例音频波形绘制的方法包括下列步骤:As shown in Figure 2, the method for drawing the audio waveform in the embodiment of the present invention includes the following steps:
步骤200、确定显示音频数据的颗粒象素的数量。
其中,可以根据下列公式确定显示音频数据的颗粒象素的数量:Wherein, the number of grainy pixels displaying audio data can be determined according to the following formula:
Npix为显示音频数据的颗粒象素的数量,N为音频波形显示区域的颗粒象素的数量,T1为音频数据的时间长度,T2为颗粒象素的时间长度。 Npix is the number of granular pixels that display audio data, N is the number of granular pixels in the audio waveform display area, T 1 is the time length of audio data, and T 2 is the time length of granular pixels.
步骤201、根据音频数据容量和步骤200确定的显示音频数据的颗粒象素的数量,将音频波形显示区域对应的音频数据划分为多个音频子数据段。Step 201: Divide the audio data corresponding to the audio waveform display area into a plurality of audio sub-data segments according to the audio data capacity and the number of granular pixels for displaying the audio data determined in
其中,在显示音频数据的颗粒象素的数量不小于音频波形显示区域的颗粒象素的数量时,根据下列公式将音频波形显示区域对应的音频数据划分为多个音频子数据段:Wherein, when the quantity of the granular pixel of displaying audio data is not less than the quantity of the granular pixel of audio waveform display area, the audio data corresponding to the audio waveform display area is divided into a plurality of audio frequency sub-data segments according to the following formula:
在显示音频数据的颗粒象素的数量小于音频波形显示区域的颗粒象素的数量时,根据下列公式将音频波形显示区域对应的音频数据划分为多个音频子数据段:When the number of granular pixels of the audio data displayed is less than the number of granular pixels of the audio waveform display area, the audio data corresponding to the audio waveform display area is divided into multiple audio sub-data segments according to the following formula:
具体的,根据下列公式计算开始的音频数据位置:Specifically, the starting audio data position is calculated according to the following formula:
offset=Tstart×BytesPerSecondoffset=T start ×BytesPerSecond
其中,Tstart为显示的开始时间(秒),BytesPerSecond为文件的每秒字节数。Among them, T start is the start time (seconds) of the display, and BytesPerSecond is the number of bytes per second of the file.
由于音频波形显示区域的开始位置有可能不是音频数据的开始位置,所以要确定具体从音频数据的哪个位置开始显示。Since the start position of the audio waveform display area may not be the start position of the audio data, it is necessary to determine the specific position of the audio data to start displaying.
然后从确定的位置开始根据Step(音频子数据段容量)划分音频子数据段,直到将音频波形显示区域对应的音频数据都划分完成。Then divide the audio sub-data segment according to the Step (audio sub-data segment capacity) from the determined position until the audio data corresponding to the audio waveform display area is divided.
这样音频波形显示区域的一个颗粒象素显示划分后的一份音频子数据的波形。In this way, one granular pixel in the audio waveform display area displays the divided audio sub-data waveform.
步骤202、将划分后的不同的音频子数据段,根据音频数据播放时间分别存储到对应的显示缓存单元中。Step 202: Store the divided audio data sub-segments in corresponding display buffer units according to audio data playback time.
其中,显示缓存单元的数量等于音频波形显示区域的颗粒象素的数量,这样可以保证每个音频子数据都对应一个显示缓存单元。Wherein, the number of display buffer units is equal to the number of granular pixels in the audio waveform display area, which can ensure that each audio sub-data corresponds to a display buffer unit.
根据音频数据播放时间分别存储到对应的显示缓存单元中,可以根据需要进行设定,比如第一个音频子数据段存储到第一个显示缓存单元中,第二个音频子数据段存储到第二个显示缓存单元中,依次类推。According to the playing time of the audio data, they are stored in the corresponding display buffer units, which can be set according to the needs. For example, the first audio sub-data segment is stored in the first display buffer unit, and the second audio sub-data segment is stored in the first display buffer unit. In the second display cache unit, and so on.
在具体实施过程中,如果一个音频子数据段的容量大于一个显示缓存单元,即每个显示缓存单元不能存储音频子数据段的所有数据,则从每个音频子数据段中提取出等于每个显示缓存单元容量的数据,并根据音频数据播放时间分别存储到对应的显示缓存单元中。In the specific implementation process, if the capacity of an audio sub-data segment is greater than one display buffer unit, that is, each display buffer unit cannot store all the data of the audio sub-data segment, then extract a value equal to each audio sub-data segment from each audio sub-data segment Display the data of the capacity of the buffer unit, and store it in the corresponding display buffer unit according to the playing time of the audio data.
如果没有预先设定显示缓存单元的容量,则需要根据下列公式确定显示缓存单元的容量:If the capacity of the display cache unit is not preset, the capacity of the display cache unit needs to be determined according to the following formula:
缓存单元总容量=(显示缓存单元数量+待显示缓存单元数量)×缓存单元容量Total capacity of cache units = (number of cache units displayed + number of cache units to be displayed) × capacity of cache units
步骤202中可以按顺序提取,也可以随机提取。In
比如:每个显示缓存单元容量为10k,每个音频子数据段为1M,则可以从音频子数据段开始位置往后提取10k的数据,也可以从音频子数据段中间某一位置往后提取10k的数据,还可以从音频子数据段中随即提取10k的数据。For example: the capacity of each display buffer unit is 10k, and each audio sub-data segment is 1M, then 10k data can be extracted from the beginning position of the audio sub-data segment, or can be extracted from a certain position in the middle of the audio sub-data segment 10k data, and 10k data can also be extracted from the audio sub-data segment at random.
步骤203、根据音频数据播放时间,将对应的显示缓存单元中的音频子数据段,绘制成音频波形。
步骤203中,可以采用取平均的策略绘制音频数据波形,即计算每个显示缓存单元中的音频子数据段的平均值,根据平均值绘制波形。In
需要说明的是,本实施例并不局限于取平均的策略,任何绘制音频数据波形的策略都适用本实施例。It should be noted that this embodiment is not limited to the averaging strategy, and any strategy for drawing audio data waveforms is applicable to this embodiment.
其中,在音频波形待显示区域有对应的音频数据时,步骤200之后还可以进一步包括:Wherein, when there is corresponding audio data in the area to be displayed of the audio waveform, after
步骤S1、根据音频数据容量和步骤200确定的显示音频数据的颗粒象素的数量,将音频波形待显示区域对应的音频数据划分为多个音频子数据段。Step S1, according to the audio data capacity and the number of grainy pixels for displaying audio data determined in
其中,音频波形待显示区域可以在音频波形显示区域之后和/或之前,音频波形待显示区域的大小可以根据需要进行设定,比如内存比较大,则可以将音频波形待显示区域设置得比较大,相应的待显示缓存单元的数量会增加。Wherein, the audio waveform display area can be behind and/or before the audio waveform display area, and the size of the audio waveform display area can be set according to needs. For example, if the memory is relatively large, the audio waveform display area can be set relatively large , and the corresponding number of cache units to be displayed will increase.
步骤S1划分的方式与步骤201划分的方式类似,不再赘述。The division method in step S1 is similar to the division method in
步骤S2、将划分后的不同的音频子数据段,根据音频数据播放时间分别存储到对应的待显示缓存单元中。Step S2. Store the divided audio sub-data segments in corresponding cache units to be displayed according to the audio data playback time.
步骤S1的处理方式与步骤201的处理方式类似,不再赘述。The processing method of step S1 is similar to the processing method of
由于用户在处理音频时,需要来回拖动音频波形显示区域,并且拖动的浮动都不是很大,这样有可能在用户移动后的音频波形显示区域对应的音频数据会存储在缓存单元中,比如移动后的音频波形显示区域对应的音频数据全部都在缓存单元中,即一部分在显示缓存单元中,一部分在待显示缓存单元中,还有可能全部都在待显示缓存单元中;或者移动后的音频波形显示区域对应的音频数据一部分在缓存单元中。Since the user needs to drag the audio waveform display area back and forth when processing audio, and the dragged float is not very large, it is possible that the audio data corresponding to the audio waveform display area after the user moves will be stored in the cache unit, such as The audio data corresponding to the moved audio waveform display area is all in the buffer unit, that is, a part is in the display buffer unit, a part is in the buffer unit to be displayed, and possibly all is in the buffer unit to be displayed; or the moved A part of the audio data corresponding to the audio waveform display area is in the buffer unit.
这样可以保证在显示窗口移动后,可以不需要从磁盘中读取或仅从磁盘中读取一部分数据,进一步减少了与磁盘的交互,加快了绘制波形的速度,并且由于转换后的音频波形待显示缓存单元的音频数据有部分是在显示缓存单元的音频数据之前,这样在用户往前移动音频波形显示区域时,可以减少与磁盘的交互,实现实时显示音频波形。This can ensure that after the display window is moved, there is no need to read from the disk or only a part of the data is read from the disk, which further reduces the interaction with the disk and speeds up the drawing of the waveform. Some of the audio data of the display buffer unit is before the audio data of the buffer unit is displayed, so that when the user moves the audio waveform display area forward, the interaction with the disk can be reduced and the audio waveform can be displayed in real time.
其中,对于移动后的音频波形显示区域对应的音频数据全部都在缓存单元中的情况,本发明实施例音频波形绘制的方法还可以进一步包括:Wherein, for the case where all the audio data corresponding to the moved audio waveform display area is in the buffer unit, the method for drawing the audio waveform in the embodiment of the present invention may further include:
步骤a204、将移动后的音频波形显示区域的缓存单元作为显示缓存单元,将其他的缓存单元作为待显示缓存单元。Step a204, using the moved buffer unit in the audio waveform display area as a display buffer unit, and using other buffer units as to-be-displayed buffer units.
步骤a205、根据音频数据播放时间,将对应的显示缓存单元中的音频子数据段,绘制成音频波形。Step a205 , according to the playing time of the audio data, draw the corresponding audio sub-data segment in the display buffer unit into an audio waveform.
这样就实现了绘制移动后的音频波形显示区域对应的音频数据的波形。In this way, the waveform of the audio data corresponding to the moved audio waveform display area can be drawn.
其中,对于移动后的音频波形显示区域对应的音频数据一部分在缓存单元中的情况,本发明实施例音频波形绘制的方法还可以进一步包括:Wherein, for the case where part of the audio data corresponding to the moved audio waveform display area is in the cache unit, the method for drawing the audio waveform in the embodiment of the present invention may further include:
步骤b204、根据音频数据容量和步骤200确定的显示音频数据的颗粒象素的数量,对音频波形显示区域对应的未存储在缓存单元中的音频数据,划分为多个音频子数据段。Step b204, according to the audio data capacity and the number of granular pixels for displaying audio data determined in
由于移动后的音频波形显示区域对应的部分音频数据没有缓存到缓存单元中,所以需要对这部分数据进行划分。Since part of the audio data corresponding to the moved audio waveform display area is not cached in the buffer unit, this part of data needs to be divided.
步骤b204划分的方式与步骤201的划分的方式类似,不再赘述。The manner of division in step b204 is similar to the manner of division in
步骤b205、从缓存单元中删除,不需要在移动后的音频波形显示区域内显示的音频波形,对应的音频子数据段。Step b205 , deleting from the cache unit the corresponding audio sub-data segment of the audio waveform that does not need to be displayed in the moved audio waveform display area.
其中,音频波形显示区域移动后,音频波形显示区域的缓存单元肯定要发生变化,可能有一部分是移动前的显示缓存单元,另一部分是移动前的待显示缓存单元;或者全部都是待显示缓存单元。不管哪种情况,都会有一部分缓存单元没有存储移动后的音频波形显示区域对应的音频数据,这就需要将这部分缓存单元中的音频数据删除,才能将划分的音频数据存储到这些缓存单元中。Among them, after the audio waveform display area is moved, the buffer unit of the audio waveform display area must change, and some may be the display buffer unit before the movement, and the other part is the buffer unit to be displayed before the movement; or all of them are buffer units to be displayed unit. In either case, there will be some buffer units that do not store the audio data corresponding to the moved audio waveform display area, which requires deleting the audio data in this part of the buffer unit before storing the divided audio data into these buffer units .
步骤b206、将划分后的不同的音频子数据段,根据音频数据播放时间分别存储到对应的删除音频子数据段的缓存单元中。Step b206. Store the divided audio sub-data segments in corresponding buffer units for deleting audio sub-data segments according to the audio data playback time.
步骤b207、将移动后的音频波形显示区域中的缓存单元作为显示缓存单元,将其他的缓存单元作为待显示缓存单元。Step b207, using the buffer unit in the moved audio waveform display area as a display buffer unit, and using other buffer units as buffer units to be displayed.
步骤b208、根据音频数据播放时间,将对应的显示缓存单元中的音频子数据段,绘制成音频波形。Step b208 , according to the playing time of the audio data, draw the corresponding audio sub-data segment in the display buffer unit into an audio waveform.
这样就实现了绘制移动后的音频波形显示区域对应的音频数据的波形。In this way, the waveform of the audio data corresponding to the moved audio waveform display area can be drawn.
其中,如果音频波形显示区域的显示粒度发生变化,则重新执行步骤200。Wherein, if the display granularity of the audio waveform display area changes,
由于显示粒度发生变化,使得显示音频数据的颗粒象素的数量也相应发生变化,从而需要重新确定显示音频数据的颗粒象素的数量。As the display granularity changes, the number of granular pixels displaying audio data also changes accordingly, so the number of granular pixels displaying audio data needs to be re-determined.
如图3A所示,本发明实施例缓存模块示意图中,假设音频波形显示区域需要三个显示缓存单元(编号为1、2、3),设定的音频波形预显示缓存单元有两个(编号为4、5)。需要说明的是实际操作中缓存单元的数量非常多,这里只是举例说明。As shown in Figure 3A, in the schematic diagram of the cache module of the embodiment of the present invention, it is assumed that the audio waveform display area needs three display buffer units (numbered as 1, 2, 3), and there are two audio waveform pre-display buffer units (numbered 4, 5). It should be noted that the number of cache units in actual operation is very large, and this is just an example for illustration.
其中,每个缓存单元的容量和结构都相同,整个缓存单元存储的音频数据在时间上是连续的。Wherein, each buffer unit has the same capacity and structure, and the audio data stored in the entire buffer unit is continuous in time.
其中,站岗指针标记了绘制波形的起始位置,这样从站岗指针位置开始,将之后的三个缓存单元(即第1、2和3缓存单元)的音频数据绘制成波形。Wherein, the guard pointer marks the starting position of drawing the waveform, so that starting from the position of the guard pointer, the audio data of the next three buffer units (that is, the 1st, 2nd and 3rd buffer units) are drawn into waveforms.
假设用户在图3A的基础上将音频波形显示区域向后拖动了1个象素,如图3B所示,整个音频波形显示区域的缓存单元发生了变化(即变为第2、3和4缓存单元),这时站岗指针向右移动到第1缓存单元,由于移动后的音频波形显示区域对应的音频数据全部存储在缓存单元(即第2、3和4缓存单元)中,所以从站岗指针位置开始,将之后的三个缓存单元(即第2、3和4缓存单元)的音频数据绘制成波形,这时第1和5缓存单元为待显示缓存单元。Assuming that the user drags the audio waveform display area backward by 1 pixel on the basis of Figure 3A, as shown in Figure 3B, the buffer units of the entire audio waveform display area have changed (i.e. become the 2nd, 3rd and 4th cache unit), at this moment, the station guard pointer moves to the right to the first buffer unit, since the audio data corresponding to the audio waveform display area after the movement is all stored in the cache unit (ie, the 2nd, 3 and 4 cache units), so from the station guard Starting from the pointer position, draw the audio data of the next three buffer units (that is, the 2nd, 3rd and 4th buffer units) into waveforms, and at this time, the 1st and 5th buffer units are the buffer units to be displayed.
假设用户在图3A的基础上将音频波形显示区域向后拖动了3个象素,如图3C所示,整个音频波形显示区域的缓存单元发生了变化(即变为第4、5和1缓存单元,因为缓存单元数量的限制,所以要循环使用缓存单元),这时站岗指针向右移动到第4缓存单元。Assuming that the user drags the audio waveform display area backward by 3 pixels on the basis of Figure 3A, as shown in Figure 3C, the buffer units of the entire audio waveform display area have changed (i.e. become the 4th, 5th and 1st Cache unit, because of the limitation of the number of cache units, so the cache unit should be recycled), at this time, the guard pointer moves to the right to the fourth cache unit.
由于移动后的音频波形显示区域对应的音频数据部分存储在缓存单元(即第4和5缓存单元)中,所以从磁盘中读取第5缓存单元缓存的音频子数据段之后的一个音频子数据段,并将该音频子数据段存储到第1缓存单元中,断开第1和第2缓存单元的双向指针,同时连接第1和第5缓存单元的双向指针,这时第1缓存单元到了尾部。Since the audio data corresponding to the moved audio waveform display area is partially stored in the cache unit (that is, the 4th and 5th cache units), an audio subdata after the audio subdata segment cached by the 5th cache unit is read from the disk segment, and store the audio sub-data segment in the first cache unit, disconnect the two-way pointers of the first and second cache units, and connect the two-way pointers of the first and fifth cache units at the same time, when the first cache unit arrives tail.
这时从站岗指针位置开始,将之后的三个缓存单元(即第4、5和1缓存单元)的音频数据绘制成波形,这时第2和3缓存单元为待显示缓存单元。At this time, starting from the position of the stand guard pointer, the audio data of the next three buffer units (that is, the 4th, 5th and 1st buffer units) are drawn into waveforms. At this time, the 2nd and 3rd buffer units are the buffer units to be displayed.
需要说明的是,音频波形显示区域向左移动的方法与上面介绍的向右移动的方法类似,不再赘述。It should be noted that the method for moving the audio waveform display area to the left is similar to the method for moving to the right described above, and will not be repeated here.
如图4所示,本发明实施例音频波形显示区域移动后的方法包括下列步骤:As shown in Figure 4, the method after the audio waveform display area of the embodiment of the present invention moves includes the following steps:
步骤400、用户移动音频波形显示区域,即向左或向右移动音频波形显示区域或随即定位音频波形显示区域。
步骤401、查看音频波形显示区域对应的音频数据是否全部存储在缓存单元中,如果是,则执行步骤407;否则,执行步骤402。
步骤402、查看音频波形显示区域对应的音频数据是否部分存储在缓存单元中,如果是,则执行步骤403;否则,执行步骤405。
步骤403、将音频波形显示区域没有的音频子数据段存储到对应的缓存单元中。Step 403: Store audio sub-data segments not in the audio waveform display area into corresponding buffer units.
步骤404、将移动后的音频波形显示区域中的缓存单元作为显示缓存单元,将其他的缓存单元作为待显示缓存单元,执行步骤407。
步骤405、根据音频数据容量和显示音频数据的颗粒象素的数量,将音频波形显示区域和音频波形待显示区域对应的音频数据划分为多个音频子数据段。Step 405: Divide the audio data corresponding to the audio waveform display area and the audio waveform display area into multiple audio sub-data segments according to the audio data capacity and the number of granular pixels displaying the audio data.
步骤406、将划分后的音频波形显示区域对应的不同的音频子数据段根据音频数据播放时间分别存储到对应的显示缓存单元中;将划分后的音频波形待显示区域对应的不同的音频子数据段,根据音频数据播放时间分别存储到对应的待显示缓存单元中。
步骤407、将站岗指针移动到音频波形显示区域第一个显示缓存单元上。
步骤408、根据音频波形显示区域的显示缓存单元中的音频子数据段,绘制成音频波形。Step 408: Draw an audio waveform according to the audio sub-data segment in the display buffer unit of the audio waveform display area.
如图5所示,本发明实施例显示粒度调整后的方法包括下列步骤:As shown in Figure 5, the embodiment of the present invention shows that the method after particle size adjustment includes the following steps:
步骤500、用户调整显示粒度。
步骤501、根据调整后的显示粒度,确定显示音频数据的颗粒象素的数量。其中,根据
步骤502、根据确定的显示音频数据的颗粒象素的数量,确定显示缓存单元的容量。Step 502: Determine the capacity of the display buffer unit according to the determined number of grainy pixels for displaying the audio data.
其中,根据下列公式确定显示缓存单元的容量:Among them, the capacity of the display cache unit is determined according to the following formula:
缓存单元总容量=(显示缓存单元数量+待显示缓存单元数量)×缓存单元容量。Total capacity of cache units=(number of cache units to be displayed+number of cache units to be displayed)×capacity of cache units.
步骤503、根据音频数据容量和调整后的显示音频数据的颗粒象素的数量,将音频波形显示区域和音频波形待显示区域对应的音频数据划分为多个音频子数据段。Step 503: Divide the audio data corresponding to the audio waveform display area and the audio waveform display area into a plurality of audio sub-data segments according to the audio data capacity and the adjusted number of granular pixels for displaying the audio data.
步骤504、将划分后的音频波形显示区域对应的不同的音频子数据段,根据音频数据播放时间分别存储到对应的显示缓存单元中;将划分后的音频波形待显示区域对应的不同的音频子数据段,根据音频数据播放时间分别存储到对应的待显示缓存单元中。
步骤505、将每个显示缓存单元中的音频子数据段,绘制成音频波形。
本发明不限于上述方法实施例中提供的步骤顺序,本领域技术人员很容易通过本发明实施例提供的方案,想到其他的步骤顺序,从而可以实现与本发明相同的目的。The present invention is not limited to the sequence of steps provided in the above method embodiments, and those skilled in the art can easily think of other sequence of steps through the solutions provided in the embodiments of the present invention, so as to achieve the same purpose as the present invention.
从上述实施例中可以看出:本发明实施例确定显示音频数据的颗粒象素的数量,所述颗粒象素用于显示音频数据的音频波形;根据音频数据容量和所述显示音频数据的颗粒象素的数量,将音频波形显示区域对应的音频数据划分为多个音频子数据段;将划分后的不同的音频子数据段,根据音频数据播放时间分别存储到对应的显示缓存单元中;根据所述音频数据播放时间,将对应的显示缓存单元中的音频子数据段,绘制成音频波形,由于不论文件大小,都可以将音频波形显示区域的音频数据存储在内存中,从而加快了处理音频数据的速度,提高了工作效率,并且如果用户移动的音频波形显示区域的数据全部或一部分在显示缓存单元和待显示缓存单元中,从而不需要从磁盘中读取或仅从磁盘中读取一部分数据,从而减少了与磁盘交互的数据量以及用户操作所需的时间,并且实现了实时显示用户处理后的音频波形。As can be seen from the foregoing embodiments: the embodiment of the present invention determines the number of granular pixels for displaying audio data, and the granular pixels are used to display audio waveforms of audio data; According to the number of pixels, the audio data corresponding to the audio waveform display area is divided into a plurality of audio sub-data segments; the divided different audio sub-data segments are stored in corresponding display buffer units according to the audio data playback time; Described audio data playing time, the audio sub-data segment in the corresponding display cache unit is drawn into audio waveforms, because regardless of the file size, the audio data in the audio waveform display area can be stored in the memory, thereby speeding up the processing of audio The speed of the data improves the work efficiency, and if all or part of the data in the audio waveform display area moved by the user is in the display buffer unit and the buffer unit to be displayed, there is no need to read from the disk or only read a part from the disk Data, thereby reducing the amount of data interacting with the disk and the time required for user operations, and realizing the real-time display of the audio waveform processed by the user.
显然,本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发明的精神和范围。这样,倘若本发明的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalent technologies, the present invention also intends to include these modifications and variations.
Claims (15)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN2008101172334A CN101634588B (en) | 2008-07-25 | 2008-07-25 | A method and device for drawing audio waveforms |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN2008101172334A CN101634588B (en) | 2008-07-25 | 2008-07-25 | A method and device for drawing audio waveforms |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN101634588A CN101634588A (en) | 2010-01-27 |
| CN101634588B true CN101634588B (en) | 2011-02-09 |
Family
ID=41593847
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN2008101172334A Expired - Fee Related CN101634588B (en) | 2008-07-25 | 2008-07-25 | A method and device for drawing audio waveforms |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN101634588B (en) |
Families Citing this family (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN104375811B (en) * | 2013-08-13 | 2019-04-26 | 腾讯科技(深圳)有限公司 | A kind of sound effect treatment method and device |
| CN105100806A (en) * | 2015-07-23 | 2015-11-25 | 柳州龙辉科技有限公司 | Compression and issuing method of super-large scale audio and video data |
| CN107172483A (en) * | 2017-05-05 | 2017-09-15 | 广州华多网络科技有限公司 | A kind of tonequality under live scene knows method for distinguishing, device and terminal device |
| CN109712220A (en) * | 2018-11-15 | 2019-05-03 | 贵阳语玩科技有限公司 | A kind of end iOS drawing audio waveforms method and apparatus and computer readable storage medium |
| CN114003456A (en) * | 2021-09-26 | 2022-02-01 | 芯华章科技股份有限公司 | Waveform data display method, device and storage medium |
| CN116343818A (en) * | 2023-02-14 | 2023-06-27 | 昆明领飞科技有限公司 | A method, system, and storage medium for drawing and zooming audio waveform diagrams |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US5675778A (en) * | 1993-10-04 | 1997-10-07 | Fostex Corporation Of America | Method and apparatus for audio editing incorporating visual comparison |
| CN1321964A (en) * | 2000-05-02 | 2001-11-14 | 莫绍祥 | Image display method and device for sound and beat |
| CN1779777A (en) * | 2005-08-16 | 2006-05-31 | 深圳市彩秀科技有限公司 | Audio-frequency editing and converting method by cutting audio-frequency wave form |
| KR20070120359A (en) * | 2006-06-19 | 2007-12-24 | 엘지전자 주식회사 | Sound wave size display device and method |
-
2008
- 2008-07-25 CN CN2008101172334A patent/CN101634588B/en not_active Expired - Fee Related
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US5675778A (en) * | 1993-10-04 | 1997-10-07 | Fostex Corporation Of America | Method and apparatus for audio editing incorporating visual comparison |
| CN1321964A (en) * | 2000-05-02 | 2001-11-14 | 莫绍祥 | Image display method and device for sound and beat |
| CN1779777A (en) * | 2005-08-16 | 2006-05-31 | 深圳市彩秀科技有限公司 | Audio-frequency editing and converting method by cutting audio-frequency wave form |
| KR20070120359A (en) * | 2006-06-19 | 2007-12-24 | 엘지전자 주식회사 | Sound wave size display device and method |
Non-Patent Citations (2)
| Title |
|---|
| 鲍永刚,等.Wave文件波形编辑方法.《小型微型计算机系统》.1997,第18卷(第1期), |
| 鲍永刚等.Wave文件波形编辑方法.《小型微型计算机系统》.1997,第18卷(第1期), * |
Also Published As
| Publication number | Publication date |
|---|---|
| CN101634588A (en) | 2010-01-27 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US8006185B2 (en) | Three dimensional viewer for video | |
| CA2821418C (en) | Method and apparatus for controlling touch screen using timeline bar, recording medium with program for the same recorded therein, and user terminal having the same | |
| CN101634588B (en) | A method and device for drawing audio waveforms | |
| AU2009246762B2 (en) | User interfaces for editing video clips | |
| US9830063B2 (en) | Modified media presentation during scrubbing | |
| CN101611451B (en) | Two-dimensional timeline display of media items | |
| US9443342B2 (en) | Information processing apparatus, data division method, and data division program | |
| CN107003720B (en) | Scripted digital media message generation | |
| US20140310601A1 (en) | Real-time scrubbing of videos using a two-dimensional grid of thumbnail images | |
| CN106852178A (en) | Animation framework | |
| WO2012028039A1 (en) | Page switching method and apparatus | |
| KR20110071708A (en) | Method and apparatus for searching contents of touch screen device | |
| WO2018049761A1 (en) | Gif file playing method and system | |
| CN105307051A (en) | Video processing method and device | |
| CN102831111B (en) | A kind of image display method and device | |
| CN105933736A (en) | Log processing method and device | |
| US9396575B2 (en) | Animation via pin that defines multiple key frames | |
| CN114374872A (en) | Video generation method and device, electronic equipment and storage medium | |
| CN111599449B (en) | Automatic playing method, device and equipment of electronic image and storage medium | |
| WO2022033137A1 (en) | Method for generating gif file on basis of hand-drawn video | |
| CN102542589B (en) | Waveform editing method and device | |
| CN108184159A (en) | The implementation method and device of a kind of progress bar | |
| CN110381365A (en) | Video takes out frame method, device and electronic equipment | |
| WO2014209305A1 (en) | Checkpoints for media buffering | |
| JP4429353B2 (en) | Capture image recording apparatus and capture image recording program |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| C06 | Publication | ||
| PB01 | Publication | ||
| C10 | Entry into substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| C14 | Grant of patent or utility model | ||
| GR01 | Patent grant | ||
| CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20110209 Termination date: 20190725 |
|
| CF01 | Termination of patent right due to non-payment of annual fee |