CN109905752A - Audio data processing method, device, electronic equipment and storage medium - Google Patents

Audio data processing method, device, electronic equipment and storage medium Download PDF

Info

Publication number
CN109905752A
CN109905752A CN201910194879.0A CN201910194879A CN109905752A CN 109905752 A CN109905752 A CN 109905752A CN 201910194879 A CN201910194879 A CN 201910194879A CN 109905752 A CN109905752 A CN 109905752A
Authority
CN
China
Prior art keywords
audio data
timestamp
audio
corrected
module
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.)
Granted
Application number
CN201910194879.0A
Other languages
Chinese (zh)
Other versions
CN109905752B (en
Inventor
陈春晓
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Qingdao Hisense Electronics Co Ltd
Original Assignee
Qingdao Hisense Electronics Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Qingdao Hisense Electronics Co Ltd filed Critical Qingdao Hisense Electronics Co Ltd
Priority to CN201910194879.0A priority Critical patent/CN109905752B/en
Publication of CN109905752A publication Critical patent/CN109905752A/en
Application granted granted Critical
Publication of CN109905752B publication Critical patent/CN109905752B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The present invention provides a kind of audio data processing method, device, electronic equipment and storage medium, this method comprises: reading audio data from cache module;Determine the audio data whether be timestamp to be corrected audio data;If so, reading the first parameter from first functional module, first parameter is used to indicate the initial time stamp of the audio data;According to the initial time stamp of the audio data, the timestamp of the audio data is corrected, the timestamp after obtaining the audio data correction.The present invention can be corrected the timestamp of audio data, realize that sound is drawn and synchronize.

Description

Audio data processing method, device, electronic equipment and storage medium
Technical field
The present invention relates to audio data processing technology field more particularly to a kind of audio data processing method, device, electronics Equipment and storage medium.
Background technique
Intelligent terminal can be realized the function of playing audio-video document, wherein the multimedia synchronous function in intelligent terminal It is to allow and there is in multiple multi-medium datas such as video data, audio data identical time stamp (presentation Timestamp, pts) multi-medium data synchronization be played come out, i.e., realization sound draw synchronize.
Gstreamer is the open source multimedia framework of realization multimedia synchronous function general at present, is used Gstaudioringbuffer module caches audio data, provides clock by the transmission to audio data and realizes that sound is drawn Synchronously control.In order to be consumed when reducing transmission audio, video data to the transition of overall performance, proposes the new audio-video of one kind and broadcast Mode playback: tunnel mode (Tunnel Mode).When using this mode playback audio-video document, Gstaudioringbuffer The audio data stored in module does not carry timestamp information;Need Gstaudioflingersink module according to The parameter of the audio data cached in Gstaudioringbuffer module calculates the timestamp of audio data, to audio data Increase additional header information, the timestamp obtained in header information comprising calculating;Gstaudioflingersink module will wrap Audio data containing header information is transferred to AudioTrack module, so that AudioTrack module is according to timestamp information reality Existing audio-video is played simultaneously.
But the play mode of this audio-video switches over track in the audio-video that user plays intelligent terminal and (such as will Chinese is switched to English) when being played out to audio-video, Gstaudioringbuffer module will be destroyed and be rebuild, wherein The parameter of the audio data of caching accordingly changes;If the direct basis of Gstaudioflingersink module The parameter of audio data after rebuilding in Gstaudioringbuffer module carries out the calculating of timestamp, the timestamp and switching There are errors for the timestamp of audio data before track, and it is asynchronous in turn result in sound picture.
Summary of the invention
The present invention provides a kind of audio data processing method, device, electronic equipment and storage medium, can be to audio data Timestamp be corrected, realize sound draw synchronize.
The first aspect of the present invention provides a kind of audio data processing method, be applied to the second functional module, described second Functional module is used to add timestamp to the audio data for being sent to audio-frequency module, which comprises
Audio data is read from cache module;
Determine the audio data whether be timestamp to be corrected audio data;
If so, reading the first parameter from first functional module, first parameter is used to indicate the audio number According to initial time stamp;
According to the initial time stamp of the audio data, the timestamp of the audio data is corrected, obtains the audio number According to the timestamp after correction.
Optionally, the determination audio data whether be timestamp to be corrected audio data, comprising:
Judge whether the audio data is the first frame audio data transmitted after the completion of the cache module is rebuild;
If so, determining that the audio data is the audio data of timestamp to be corrected.
Optionally, described to judge whether the audio data is the first frame sound transmitted after the completion of the cache module is rebuild Before frequency evidence, the method also includes:
The second parameter is read from first functional module, second parameter is used to indicate the cache module and is in weight Build completion status.
Optionally, described to judge whether the audio data is the first frame sound transmitted after the completion of the cache module is rebuild Frequency is after, further includes:
If it is not, then judging whether the audio data is the first frame audio number transmitted after the cache module empties the cache According to;
If so, determining that the audio data is the audio data of timestamp to be corrected.
Optionally, described to judge whether the audio data is the first frame sound transmitted after the cache module empties the cache Before frequency evidence, the method also includes:
Notification message is received, the notification message is used to indicate the cache module and is in the state that empties the cache.
Optionally, the initial time stamp according to the audio data, corrects the timestamp of the audio data, obtains Timestamp after the audio data correction, comprising:
Using the initial time stamp of the audio data as the timestamp after audio data correction.
Optionally, the initial time stamp according to the audio data, corrects the timestamp of the audio data, obtains Timestamp after the audio data correction, comprising:
Determine the timestamp estimated value of the audio data;
According to the initial time stamp of the timestamp estimated value of the audio data and the audio data, the audio is determined The timestamp corrected value of data;
According to the timestamp corrected value of the timestamp estimated value of the audio data and the audio data, the sound is corrected The timestamp of frequency evidence, the timestamp after obtaining the audio data correction.
It is optionally, described according to the timestamp estimated value of the audio data and the initial time stamp of the audio data, Determine the timestamp corrected value of the audio data, comprising:
The difference that the initial time stamp of the timestamp estimated value of the audio data and the audio data is subtracted each other, Timestamp corrected value as the audio data.
Optionally, described to be corrected according to the timestamp estimated value of the audio data and the timestamp of the audio data Value, corrects the timestamp of the audio data, the timestamp after obtaining the audio data correction, comprising:
The timestamp estimated value of the audio data is added with the timestamp corrected value of the audio data, is obtained described Timestamp after audio data correction.
It is optionally, described according to the timestamp estimated value of the audio data and the initial time stamp of the audio data, After the timestamp corrected value for determining the audio data, the method also includes:
Using the timestamp corrected value of the audio data as other audio datas being segmented where the audio data Timestamp corrected value is corrected the timestamp of other audio datas.
Optionally, after the timestamp obtained after audio data correction, the method also includes:
Head information is added in the audio data, the head information includes: the timestamp after the audio data correction;
Audio data after addition head information is sent to the audio-frequency module.
The second aspect of the present invention provides a kind of audio data processing method, be applied to the first functional module, described first Functional module is used to that audio data to be written to cache module, which is characterized in that the described method includes:
Audio data is received, the audio data includes the initial time stamp of the audio data;
Determine the audio data whether be timestamp to be corrected audio data;
If so, the first parameter is arranged according to the initial time stamp of the audio data, first parameter is used to indicate The initial time stamp of the audio data.
Optionally, the determination audio data whether be timestamp to be corrected audio data, comprising:
Judge whether the audio data is the first frame audio data transmitted after the completion of the cache module is rebuild;
If so, determining that the audio data is the audio data of timestamp to be corrected.
Optionally, described to judge whether the audio data is the first frame sound transmitted after the completion of the cache module is rebuild Before frequency evidence, the method also includes:
The cache module is rebuild;
The second parameter is set after the completion of the cache module is rebuild, second parameter is used to indicate the cache module In reconstruction completion status.
Optionally, described to judge whether the audio data is the first frame sound transmitted after the completion of the cache module is rebuild Frequency is after, further includes:
If it is not, then judging whether the audio data is the first frame audio number transmitted after the cache module empties the cache According to;
If so, determining that the audio data is the audio data of timestamp to be corrected.
Optionally, described to judge whether the audio data is the first frame sound transmitted after the cache module empties the cache Before frequency evidence, the method also includes:
Notification message is received, the notification message is used to indicate the cache module and is in the state that empties the cache.
The third aspect of the present invention provides a kind of audio-frequency data processing device, comprising:
Reading unit, for reading audio data from cache module;
Judging unit, for determine the audio data whether be timestamp to be corrected audio data;
The reading unit, if being the audio data of timestamp to be corrected specifically for the audio data, from described First functional module reads the first parameter, and first parameter is used to indicate the initial time stamp of the audio data;
Correction unit corrects the timestamp of the audio data, obtains for the initial time stamp according to the audio data Timestamp to after audio data correction.
Optionally, the judging unit is also used to judge whether the audio data is that the cache module rebuilds completion The first frame audio data transmitted afterwards.
Optionally, described device further include: determination unit;
The determination unit, if being the first frame sound transmitted after the completion of the cache module is rebuild for the audio data Frequency evidence, it is determined that the audio data is the audio data of timestamp to be corrected.
Optionally, the reading unit is also used to read the second parameter, second parameter from first functional module It is used to indicate the cache module and is in reconstruction completion status.
Optionally, the judging unit, if being after the completion of the cache module is rebuild for judging the audio data not The first frame audio data of transmission then judges whether the audio data is first transmitted after the cache module empties the cache Frame audio data.
Optionally, the determination unit, if being transmitted after emptying the cache for the audio data cache module First frame audio data, it is determined that the audio data is the audio data of timestamp to be corrected.
Optionally, described device further include: notification message receiving unit;
The notification message receiving unit, for receiving notification message, the notification message is used to indicate the caching mould Block is in the state that empties the cache.
Optionally, the correction unit, specifically for using the initial time stamp of the audio data as the audio number According to the timestamp after correction.
Optionally, the correction unit, specifically for the timestamp estimated value of the determination audio data;According to the sound The timestamp estimated value of frequency evidence and the initial time stamp of the audio data determine the timestamp correction of the audio data Value;According to the timestamp corrected value of the timestamp estimated value of the audio data and the audio data, the audio number is corrected According to timestamp, timestamp after obtaining audio data correction.
Optionally, the correction unit, specifically for by the timestamp estimated value of the audio data and the audio number According to the difference subtracted each other of initial time stamp, timestamp corrected value as the audio data.
Optionally, the correction unit, specifically for by the timestamp estimated value of the audio data and the audio number According to timestamp corrected value be added, the timestamp after obtaining audio data correction.
Optionally, the correction unit, specifically for using the timestamp corrected value of the audio data as the audio The timestamp corrected value for other audio datas being segmented where data, is corrected the timestamp of other audio datas.
Optionally, described device further include: head information transmitting unit;
The head information transmitting unit, for adding head information in the audio data, the head information includes: described Timestamp after audio data correction;Audio data after addition head information is sent to audio-frequency module.
The fourth aspect of the present invention provides a kind of audio-frequency data processing device, comprising:
Audio data receipt unit, for receiving audio data, the audio data includes the initial of the audio data Timestamp;
Judging unit, for determine the audio data whether be timestamp to be corrected audio data;
Setting unit, if being the audio data of timestamp to be corrected for the audio data, according to the audio number According to initial time stamp the first parameter is set, first parameter is used to indicate the initial time stamp of the audio data.
Optionally, the judging unit, specifically for judging whether the audio data is that the cache module has been rebuild At the first frame audio data of rear transmission.
Optionally, described device further include: determination unit;
The determination unit, if being the first frame sound transmitted after the completion of the cache module is rebuild for the audio data Frequency evidence, it is determined that the audio data is the audio data of timestamp to be corrected.
Optionally, described device further include: reconstruction unit;
The reconstruction unit, for being rebuild to the cache module.
Optionally, the setting unit is also used to be arranged the second parameter after the completion of the cache module is rebuild, and described the Two parameters are used to indicate the cache module and are in reconstruction completion status.
Optionally, the judging unit, if not being after the completion of the cache module is rebuild specifically for the audio data The first frame audio data of transmission then judges whether the audio data is first transmitted after the cache module empties the cache Frame audio data.
Optionally, the determination unit, if being transmitted after emptying the cache for the audio data cache module First frame audio data, it is determined that the audio data is the audio data of timestamp to be corrected.
Optionally, described device further include: notification message receiving unit;
The notification message receiving unit, for receiving notification message, the notification message is used to indicate the caching mould Block is in the state that empties the cache.
The fifth aspect of the present invention provides a kind of electronic equipment, comprising:
Memory, for storing program instruction;
Processor executes such as aforementioned described in any item sides for calling and executing the program instruction in the memory Method step.
The sixth aspect of the present invention provides a kind of readable storage medium storing program for executing, and computer journey is stored in the readable storage medium storing program for executing Sequence, the computer program is for executing such as aforementioned described in any item methods.
The present invention provides a kind of audio data processing method, device, electronic equipment and storage medium, and this method is determining When stating the audio data that audio data is timestamp to be corrected, according to the first parameter read in the first functional module, institute is corrected State the timestamp of audio data;First parameter is used to indicate the initial time stamp of the audio data.The present invention is not changing Become on the basis of open source multimedia framework structure in the prior art, i.e., does not carry timestamp in audio data transmission process On the basis of, the timestamp of audio data can be corrected, realize that sound is drawn and synchronize.
Detailed description of the invention
It, below will be to embodiment or the prior art in order to illustrate more clearly of the present invention or technical solution in the prior art Attached drawing needed in description is briefly described, it should be apparent that, the accompanying drawings in the following description is of the invention one A little embodiments for those of ordinary skill in the art without any creative labor, can also be according to this A little attached drawings obtain other attached drawings.
Fig. 1 is the functional module structure schematic diagram of the present invention for realizing audio data processing method;
Fig. 2 is the signaling process schematic diagram one of audio data processing method provided by the invention;
Fig. 3 is the signaling process schematic diagram two of audio data processing method provided by the invention;
Fig. 4 is the signaling process schematic diagram three of audio data processing method provided by the invention;
Fig. 5 is the flow diagram one of audio data processing method provided by the invention;
Fig. 6 is the flow diagram two of audio data processing method provided by the invention;
Fig. 7 is the structural schematic diagram one of an audio-frequency data processing device provided by the invention;
Fig. 8 is the structural schematic diagram two of an audio-frequency data processing device provided by the invention;
Fig. 9 is the structural schematic diagram one of another audio-frequency data processing device provided by the invention;
Figure 10 is the structural schematic diagram two of another audio-frequency data processing device provided by the invention;
Figure 11 is the structural schematic diagram of electronic equipment provided by the invention.
Specific embodiment
To make the object, technical solutions and advantages of the present invention clearer, below in conjunction with attached in the embodiment of the present invention Figure, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is the present invention A part of the embodiment, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art are not having Every other embodiment obtained under the premise of creative work is made, shall fall within the protection scope of the present invention.
Intelligent terminal in the present invention uses open source multimedia framework Gstreamer in the prior art, in audio data After decoding and before audio data rendering, audio data is handled, and then realizes multimedia synchronous function.Fig. 1 is this The functional module structure schematic diagram for the realization audio data processing method being related to is invented, functional module therein can be Existing functional module in Gstreamer, specifically includes: the first functional module (such as Gstaudiobasesink module), Cache module (such as Gstaudioringbuffer module), the second functional module (such as Gstaudioflingersink mould Block) and audio-frequency module (such as AudioTrack module).
Wherein, the first functional module, for the audio data received to be written to cache module.For example, the first function mould Cache module is written as unit of buffer, by audio data in block.It is 300k with buffer, the first functional module is every time to caching The audio data of module write-in 300k.It should be understood that in the present embodiment, each frame audio number received by the first functional module According to the initial time including pulse code modulation data (Pulse Code Modulation, PCM) data and the frame audio data Stamp.It only includes PCM data that first functional module, which is written to the audio data of cache module,.
Cache module caches PCM data, and for caching to audio data in audio playing process It is middle to export the PCM data of caching to the second functional module.Wherein, PCM data sequentially in time be divided be stored in it is multiple It is segmented in (segment), a segment of audio data in the audio data is stored in a segment, a segment includes more The audio data of a buffer, i.e. a segment of audio data include multiple sub-audio datas again.
Second functional module, for adding timestamp to the audio data for being sent to audio-frequency module.Wherein, the second function The corresponding audio sample number of a segment of audio data (i.e. a segment) that module is exported according to the cache module read (sample) and audio sample rates (rate) the played audio data duration duration of cache module, can be calculated, Wherein when audio data a length of audio sample number and audio sample rates quotient, i.e., (duration=samples/rate);It connects Pass through the timestamp estimated value (curPos=duration+ of the available section audio data of conversion with system clock Seg.start-base_time), and using the timestamp estimated value as the timestamp pts of the section audio data.Wherein, Segment.start indicates the initial time stamp in all sub-audio datas for including in the section audio data, base_time table Show an opposite datum quantity with system clock.Specifically, can store base_time and every section in the first functional module The segment.start of audio data, the second functional module is when obtaining the timestamp estimated value of every section audio data, Ke Yi Segment.start and base_time is read in first functional module.
After the timestamp that the second functional module calculates the section audio data, head letter is increased to the audio data read It ceases, includes timestamp in this information;Further, also by include information the section audio data be written audio mould Block.
Audio-frequency module, the audio data for will acquire spread out of the broadcasting that audio is carried out to audio hardware.
In the present invention realize audio data processing method in the first functional module, cache module, the second functional module and Audio-frequency module can be realized above-mentioned with identical function in the prior art.
When playing audio file progress track switching, if Chinese is converted into English, cache module can be to the Chinese of caching PCM data is destroyed, and the reconstruction of the PCM data to English audio data, the corresponding parameter such as audio of English PCM data Hits and audio sample rates are all reset.Because cache module is destroyed and is rebuild after switching track, audio sample number It resets, although the audio in terminal persistently plays, audio sample number is not recorded continuously, and the timestamp value estimated is inclined Small, there are errors with true timestamp for the timestamp estimated by the above method.
To solve the above-mentioned problems, the present invention provides a kind of audio data processing method, can to the correction of timestamp, It realizes that sound is drawn to synchronize.Below from the interactive angle of the first functional module, cache module, the second functional module to provided by the invention Audio data processing method is illustrated, and Fig. 2 is the signaling process schematic diagram one of audio data processing method provided by the invention, As shown in Fig. 2, audio data processing method provided in this embodiment includes:
S201, the first functional module receive audio data, and audio data includes the initial time stamp of audio data.
In the present embodiment, the first functional module can receive audio data, which can be needs and continuously broadcast The audio data put is also possible to switch the audio data received after track.Wherein, which is decoded PCM Data.
It can be the local audio number being stored in terminal that the first functional module in the present embodiment, which receives audio data, According to being also possible to the audio data that terminal is obtained from server.When playing out the audio data received, such as play extremely 10s;Illustratively, when user switches the icon of track at the terminal with click or the selection of other modes of operation, such as start to broadcast What is put is Chinese, and in 10s, user is switched to English, then the first functional module receives English audio data.
Specifically, including the initial time stamp of audio data in the audio data that the first functional module receives.It is exemplary , as may include in audio data switch track after English audio data initial time stamp, such as after 10s first The timestamp of frame English audio data.
S202, the first functional module determine audio data whether be timestamp to be corrected audio data.
In the prior art, it will be obtained according to the audio sample number and audio sample rates of the audio data cached in cache module Timestamp of the timestamp estimated value taken as audio data.If switch track, the first functional module carries out cache module It destroys and rebuilds;If fast forwarding and fast rewinding occurs, the first functional module is purged the audio data cached in cache module;If When fast forwarding and fast rewinding occurs after switching track, the first functional module is also required to being destroyed and rebuild in cache module;Or Due to other extraneous factors, cause the audio data cached in cache module change (as delete portion of audio data or Modification etc.).
The parameter that the above various situations will lead to the audio data cached in cache module changes, and then leads to the The timestamp estimated value inaccuracy for the audio data that two functional modules obtain.The audio number of timestamp to be corrected in the present embodiment According to can be the audio data to change in cache module.
In the present embodiment, the first functional module can determine that audio data is according to the audio data cached in cache module The no audio data for timestamp to be corrected.Specifically, the audio that the first functional module can cache in determining cache module When data change, determine that audio data is the audio data of timestamp to be corrected.
S203, if audio data is the audio data of timestamp to be corrected, the first functional module is according to audio data The first parameter is arranged in initial time stamp, and the first parameter is used to indicate the initial time stamp of audio data.
First functional module is when determining audio data is the audio data of timestamp to be corrected, according to the audio received The first parameter is arranged in the initial time stamp of data, and stores the first parameter;Wherein, the first parameter is used to indicate the first of audio data Beginning timestamp, the initial time stamp of audio data are the first frame audio data in the audio data that the first functional module receives Timestamp.
Optionally, may include in the first parameter in the present embodiment cache module reconstruction after the completion of the first frame that receives The timestamp of audio data, such as the first parameter can be ringbuffer_released_pts.Illustratively, as broadcast in terminal When the audio-video document put is to 10s, user's triggering terminal switches track, and the first functional module calls function to carry out cache module It rebuilds;The timestamp for the first frame audio data that the reconstruction that first functional module can recorde cache module receives after the completion, Such as 11s;Illustratively, the first parameter can be ringbuffer_released_11.
Cache module is written in audio data by S204, the first functional module.
S205, the second functional module read audio data from cache module.
Second functional module can read audio data from cache module, specifically, being that reading audio data is corresponding PCM data;The corresponding audio sample number of the audio data cached after the reconstruction of available cache module and audio sample rates.
Illustratively, for terminal when playing an audio-video document, audio sample number switches track when being 2000, then caches mould Audio sample number after block is rebuild is calculated since 0 again.It is cached after the reconstruction of the available cache module of second functional module The corresponding audio sample number of audio data.
S206, the second functional module determine audio data whether be timestamp to be corrected audio data.
As in above-mentioned S203, in the present embodiment, the audio data of timestamp to be corrected is to change in cache module Audio data.Correspondingly, the first functional module can be in the first function mould when the audio data in cache module changes Increase audio data in block to change corresponding label.Illustratively, can be occurred according to the audio data in cache module The type of variation increases corresponding label.Such as after cache module rebuilds completion, the first functional module can increase wherein Second parameter, second parameter can rebuild completion status for cache module and mark ringbuffer_released.
Optionally, the first functional module can store increase mark after increase audio data changes corresponding label The initial time stamp of the audio data received after note.Such as after cache module is rebuild and completed, the first functional module can be After wherein increasing by the second parameter, the initial time stamp ringbuffer_released_pts of the audio data received is stored.
In the present embodiment, the second functional module can be read in the first functional module label determine audio data whether be The audio data of timestamp to be corrected.When the second functional module can read increased label in the first functional module, Determine that audio data is the audio data of timestamp to be corrected.
S207, if audio data is the audio data of timestamp to be corrected, the second functional module is from the first functional module Read the first parameter.
If audio data is the audio data of timestamp to be corrected, the second functional module reads the from the first functional module One parameter, wherein the initial time of the second functional module audio data of available timestamp to be corrected in the first parameter Stamp.
Illustratively, as the second functional module determines audio data for the audio data of timestamp to be corrected, then from first Functional module reads the first parameter, is ringbuffer_released_11.
S208, the second functional module obtain sound according to the initial time stamp of audio data, the timestamp of audio calibration data Timestamp after frequency Data correction.
In the present embodiment, the second functional module can be according to the corresponding audio sample number of audio data and audio sample speed Rate obtains the timestamp of audio data by method in the prior art;After being rebuild due to cache module, audio sample therein Number changes, and such as resets to 0, then the timestamp for the audio data that the second functional module obtains is the timestamp of inaccuracy.It is worth note Meaning, the second function mould can obtain audio data according to the corresponding audio sample number of audio data and audio sample rates In each frame audio data timestamp.
In the present embodiment, initial time stamp of second functional module according to audio data, the timestamp of audio calibration data, Timestamp after obtaining audio data correction;It wherein, can be directly by for the first frame audio data in the audio data The initial time stamp for the audio data that two functional modules are read in the first functional module is as the first frame in the audio data Timestamp after audio data correction.
Optionally, for each frame audio data of the audio data, the sound that the second functional module can be calculated The initial time stamp of audio data that frequency is read in the timestamp of first frame audio data and the first functional module in makes the difference, Acquisition time stabs difference;After the timestamp for each frame audio data that the second functional module is calculated, in addition the timestamp Difference is the timestamp after each frame audio data correction.
A kind of audio data processing method is provided in the present embodiment, this method comprises: reading audio number from cache module According to;Determine audio data whether be timestamp to be corrected audio data;If so, reading the first ginseng from the first functional module Number, the first parameter are used to indicate the initial time stamp of audio data;According to the initial time stamp of audio data, audio calibration data Timestamp, obtain audio data correction after timestamp.The present invention is not changing open source multimedia framework in the prior art It, i.e., can be to the time of audio data on the basis of not carrying timestamp in audio data transmission process on the basis of structure Stamp is corrected, and is realized that sound is drawn and is synchronized.
Below with reference to Fig. 3 angle pair interactive from the first functional module, cache module, the first functional module and audio-frequency module Audio data processing method provided by the invention is further described, and Fig. 3 is audio data processing method provided by the invention Signaling process schematic diagram two, as shown in figure 3, audio data processing method provided in this embodiment includes:
S301, the first functional module receive audio data, and audio data includes the initial time stamp of audio data.
S302, the first functional module rebuild cache module;The first functional module after the completion of cache module is rebuild Second parameter is set, and the second parameter is used to indicate cache module and is in reconstruction completion status.
In the present embodiment, when switching track, the first functional module can call function, rebuild to cache module.
The state that the available cache module of first functional module is rebuild, the first function mould after the completion of cache module is rebuild The second parameter is arranged in block, i.e., increases by the second parameter in the first functional module, wherein the second parameter is used to indicate at cache module In rebuilding completion status, such as the second parameter is ringbuffer_released.
Whether S303, the first functional module audio data are the first frame audio transmitted after the completion of cache module is rebuild Data.
In the present embodiment, the first functional module receives audio data, and whether audio data is that cache module has been rebuild At the first frame audio data of rear transmission.
Specifically, the first functional module is after the completion of cache module is rebuild, available cache module rebuild complete when Between stab;The timestamp completed is rebuild according to the timestamp of each frame audio data of the audio data received and cache module, Whether audio data is the first frame audio data transmitted after the completion of cache module is rebuild.
S304, if audio data is the first frame audio data transmitted after the completion of cache module is rebuild, the first function mould Block determines that audio data is the audio data of timestamp to be corrected.
In the present embodiment, since cache module is rebuild, the parameter of the audio data of caching can be reset, and then lead to the second function The timestamp inaccuracy for the audio data that energy module calculates.Determine that audio data is that cache module has been rebuild in the first functional module At rear transmission first frame audio data when, determine the audio data be timestamp to be corrected audio data.
S305, if audio data is the audio data of timestamp to be corrected, the first functional module is according to audio data The first parameter is arranged in initial time stamp.
Cache module is written in audio data by S306, the first functional module.
S307, the second functional module read audio data from cache module.
S308, the second functional module read the second parameter from the first functional module.
The second parameter is stored in first functional module, which is used to indicate cache module and is in reconstruction completion shape State, such as the ringbuffer_released stored in the first functional module.
Second functional module reads the second parameter from the first functional module, determines that cache module is in and rebuilds completion status.
Whether S309, the second functional module audio data are the first frame audio transmitted after the completion of cache module is rebuild Data.
In the present embodiment, the second functional module is sentenced by reading the second parameter and the first parameter in the first functional module Whether disconnected audio data is the first frame audio data transmitted after the completion of cache module is rebuild.Due to the second parameter be used to indicate it is slow Storing module, which is in, rebuilds completion status, and such as the second parameter is ringbuffer_released;First parameter is used to indicate audio number According to initial time stamp, such as ringbuffer_released_pts;If the second functional module can be read in the first functional module Newly-increased the second parameter and the first parameter are got, can determine that audio data is the first frame transmitted after the completion of cache module is rebuild Audio data.
S310, if audio data is the first frame audio data transmitted after the completion of cache module is rebuild, the second function mould Block determines that audio data is the audio data of timestamp to be corrected.
S311, if audio data is the audio data of timestamp to be corrected, the second functional module is from the first functional module Read the first parameter.
S312, the second functional module obtain sound according to the initial time stamp of audio data, the timestamp of audio calibration data Timestamp after frequency Data correction.
In the present embodiment, if audio data is the first frame audio data transmitted after the completion of cache module is rebuild, by audio The initial time stamp of data is as the timestamp after audio data correction.Alternatively, the second functional module can determine audio data Timestamp estimated value, which can be is calculated according to curPos=duration+seg.start-base_time It obtains;According to the timestamp estimated value of audio data and the initial time stamp of audio data, the timestamp school of audio data is determined Positive value;According to the timestamp corrected value of the timestamp estimated value of audio data and audio data, the timestamp of audio calibration data, Timestamp after obtaining audio data correction.
Specifically, the difference that the initial time stamp of the timestamp estimated value of audio data and audio data can be subtracted each other Value, the timestamp corrected value as audio data.The timestamp of the timestamp estimated value of audio data and audio data is corrected Value is added, the timestamp after obtaining audio data correction.
Illustratively, the timestamp estimated value of first frame audio data is pts1, and the timestamp estimated value of audio data It is pts_diff with the difference that the initial time stamp of audio data is subtracted each other, then the timestamp after audio data correction is Pts1'(pts1'=pts1+pts_diff).
In the present embodiment, the second functional module can also be using the timestamp corrected value of audio data as where audio data The timestamp corrected value of other audio datas of segmentation, is corrected the timestamp of other audio datas.
Illustratively, the timestamp estimated value for other audio datas such as the second frame audio data being segmented where audio data For pts2, then the timestamp pts2'(pts2'=pts2+pts_diff after the correction of the second frame audio data).
S313, the second functional module add head information in audio data, head information include: after audio data correction when Between stab.
In the present embodiment, the second functional module is after obtaining the timestamp information after audio data correction, in audio data Middle addition head information, head information include: the timestamp after audio data correction.It optionally, can be by audio number in the present embodiment The timestamp after the correction of each frame audio data in is added in information.
Audio data after adding head information is sent to audio-frequency module by S314, the second functional module.
In the present embodiment, after the audio data after adding head information is sent to audio-frequency module by the second functional module, audio Timestamp after the correction of the available audio data of module, according to after the correction for the audio data for including in this information when Between stab, broadcasting synchronized to audio, video data, realizes that sound is drawn and synchronizes.
Wherein, the embodiment in S301, S305-S307 in the present embodiment is referred in above-described embodiment Associated description in S201, S203-S205, this will not be repeated here.
In the present embodiment, if audio data is the first frame audio data transmitted after the completion of cache module is rebuild, it is determined that Audio data is the audio data of timestamp to be corrected, can be directly by the initial of the audio data read in the first functional module Timestamp is as the timestamp after audio data correction;It can also be according to the timestamp estimated value of audio data and audio data Initial time stamp determines the timestamp corrected value of audio data;According to the timestamp estimated value of audio data and audio data Timestamp corrected value, the timestamp of audio calibration data, the timestamp after obtaining audio data correction may be implemented to audio number The correction of the timestamp of each frame audio data in is realized that sound is drawn and is synchronized.
In the present embodiment, switch track in the case where, if after switch track also to audio-video document carry out rewind or fastly Into operation, cache module also removes the audio data of caching accordingly.Since cache module is rebuild, the audio of caching can be reset The parameter of data;The timestamp for the audio data that second functional module calculates is also inaccurate.
Below with reference to Fig. 4 angle pair interactive from the first functional module, cache module, the first functional module and audio-frequency module Audio data processing method provided by the invention is further described, and Fig. 4 is audio data processing method provided by the invention Signaling process schematic diagram three, as shown in figure 4, audio data processing method provided in this embodiment includes:
S401, the first functional module receive audio data, and audio data includes the initial time stamp of audio data.
S402, the first functional module rebuild cache module;The first functional module after the completion of cache module is rebuild Second parameter is set, and the second parameter is used to indicate cache module and is in reconstruction completion status.
Whether S404, the first functional module audio data are the first frame audio transmitted after the completion of cache module is rebuild Data.
S405, the first functional module receive notification message, and notification message is used to indicate cache module and is in the shape that empties the cache State.
In the present embodiment, after the completion of audio-video document rewind or F.F., modules can receive rewind or F.F. is complete At notification message flush_stop;Wherein, notification message is used to indicate cache module and is in the state that empties the cache, corresponding, Cache module removes the audio data of caching, in the state of emptying the cache.
Specifically, determining that rewind or F.F. are completed after the first functional module receives notification message, third ginseng can be set Number, third parameter are completed for characterizing rewind or F.F., such as sink_flushed.
S406, if audio data is not the first frame audio data transmitted after the completion of cache module is rebuild, the first function Whether module audio data is the first frame audio data transmitted after cache module empties the cache.
In the present embodiment, it is the first frame transmitted after the completion of cache module is rebuild that the first functional module, which determines audio data not, When audio data, whether audio data is the first frame audio data transmitted after cache module empties the cache.
First functional module obtains cache module and rebuilds the timestamp completed, according to connecing after cache module empties the cache The timestamp and cache module of each frame audio data of the audio data received rebuild the timestamp completed, audio data It whether is the first frame audio data transmitted after cache module empties the cache.
First functional module audio data is the first frame audio data that transmits after cache module empties the cache, can be with The timestamp of the first frame audio data transmitted after the cache module is emptied the cache stores, such as flushed_pts.
S407, if audio data is the first frame audio data transmitted after cache module empties the cache, the first function mould Block determines that audio data is the audio data of timestamp to be corrected.
Wherein, audio data is the first frame audio data transmitted after cache module empties the cache, due to cache module weight It builds, the timestamp that will lead to the audio data of the second functional module calculating is also inaccurate;Therefore, audio data is that cache module is clear When the first frame audio data transmitted after sky caching, audio data is the audio data of timestamp to be corrected.
S408, if audio data is the audio data of timestamp to be corrected, the first functional module is according to audio data The first parameter is arranged in initial time stamp.
Audio data is written to cache module for S409, the first functional module.
S410, the second functional module read audio data from cache module.
S411, the second functional module read the second parameter from the first functional module.
Whether S412, the second functional module audio data are the first frame audio transmitted after the completion of cache module is rebuild Data.
S413, the second functional module receive notification message.
In the present embodiment, after the completion of audio-video document rewind or F.F., modules can receive rewind or F.F. is complete At notification message (such as flush_stop);Wherein, notification message is used to indicate cache module and is in the state that empties the cache, right It answers, cache module removes the audio data of caching, in the state of emptying the cache.Specifically, the second functional module can receive Notification message.
S414, if audio data is not the first frame audio data transmitted after the completion of cache module is rebuild, the second function Whether module audio data is the first frame audio data transmitted after cache module empties the cache.
In the present embodiment, it is the first frame transmitted after the completion of cache module is rebuild that the second functional module, which determines audio data not, When audio data, the first frame sound that is transmitted after being emptied the cache by reading third parameter and cache module in the first functional module Whether the timestamp of frequency evidence, audio data are the first frame audio data transmitted after the completion of cache module is rebuild.Due to Third parameter is completed for characterizing rewind or F.F., also illustrates that cache module empties the cache completions, if third parameter is sink_ flushed;The timestamp for the first frame audio data that cache module transmits after emptying the cache, such as flushed_pts;If the second function Energy module can read first transmitted after newly-increased third parameter and cache module empty the cache in the first functional module The timestamp of frame audio data can determine that audio data is the first frame audio data transmitted after cache module empties the cache.
S415, if audio data is the first frame audio data transmitted after cache module empties the cache, the second function mould Block determines that audio data is the audio data of timestamp to be corrected.
S416, if audio data is the audio data of timestamp to be corrected, the second functional module is from the first functional module Read the first parameter.
S417, the second functional module obtain sound according to the initial time stamp of audio data, the timestamp of audio calibration data Timestamp after frequency Data correction.
If correspondingly, the first frame audio number transmitted after being emptied the cache using audio data as cache module in the present embodiment According to using the initial time stamp of audio data as the timestamp after audio data correction.
Alternatively, the second functional module can determine the timestamp estimated value of audio data, the estimated value can be according to when Between stab pts (curPos=duration+seg.start-base_time) formula carry out calculating acquisition;According to audio data Timestamp estimated value and audio data initial time stamp, determine the timestamp corrected value of audio data;According to audio data Timestamp estimated value and audio data timestamp corrected value, the timestamp of audio calibration data, obtain audio data correction Timestamp afterwards.
Specifically, the difference that the initial time stamp of the timestamp estimated value of audio data and audio data can be subtracted each other Value, the timestamp corrected value as audio data.The timestamp of the timestamp estimated value of audio data and audio data is corrected Value is added, the timestamp after obtaining audio data correction.
In the present embodiment, the second functional module can also be using the timestamp corrected value of audio data as where audio data The timestamp corrected value of other audio datas of segmentation, is corrected the timestamp of other audio datas.
It is worth noting that, initial time stamp therein is flushed_pts.
S418, the second functional module add head information in audio data, head information include: after audio data correction when Between stab.
Audio data after adding head information is sent to audio-frequency module by S419, the second functional module.
Wherein, the embodiment in S401-S404, S408-S412, S416-S419 in the present embodiment is referred to The associated description in S301-S304, S305-S309, S311-S314 in embodiment is stated, this will not be repeated here.
In the present embodiment, if audio data is the first frame audio data transmitted after cache module empties the cache, it is determined that Audio data is the audio data of timestamp to be corrected, can be directly by the initial of the audio data read in the first functional module Timestamp is as the timestamp after audio data correction;It can also be according to the timestamp estimated value of audio data and audio data Initial time stamp determines the timestamp corrected value of audio data;According to the timestamp estimated value of audio data and audio data Timestamp corrected value, the timestamp of audio calibration data, the timestamp after obtaining audio data correction may be implemented to audio number The correction of the timestamp of each frame audio data in is realized that sound is drawn and is synchronized.
To sum up, audio data of the invention is handled from the angle of the first functional module and the second functional module separately below Method is illustrated.
Audio data processing method is illustrated from the angle of the second functional module below with reference to Fig. 5;Fig. 5 is the present invention The flow diagram one of the audio data processing method of offer, as shown in figure 5, audio data processing method provided in this embodiment Include:
S501 reads audio data from cache module.
Whether S502, audio data are the first frame audio data transmitted after the completion of cache module is rebuild;If so, holding Row S504, if it is not, executing S503.
Whether S503, audio data are the first frame audio data transmitted after cache module empties the cache;If so, holding Row S504, if it is not, executing S505.
S504 determines that audio data is the audio data of timestamp to be corrected.
S505, according to the initial time stamp of audio data, the timestamp of audio calibration data, after obtaining audio data correction Timestamp.
In the present embodiment, the first frame audio data and cache module transmitted after the completion of rebuilding for cache module empties slow The first frame audio data (referred to as following first frame audio data) transmitted after depositing, can directly by audio data it is initial when Between stamp as audio data correct after timestamp;It can also be using the timestamp estimated value for obtaining first frame audio data and the The timestamp corrected value of the initial time stamp of one frame audio data, according to the timestamp estimated value of audio data and audio data The difference of timestamp corrected value, using the adduction of the difference and the initial time stamp of first frame audio data as first frame audio number According to the timestamp after correction.
For non-first frame audio data, the timestamp estimated value of available each frame audio data and each frame audio The timestamp corrected value of the initial time stamp of data, according to the timestamp school of the timestamp estimated value of audio data and audio data The difference of positive value, after the adduction of the difference and the initial time stamp of each frame audio data is corrected as each frame audio data Timestamp.
S506, adds head information in audio data, and head information includes: the timestamp after audio data correction.
Audio data after addition head information is sent to audio-frequency module by S507.
Audio data processing method is illustrated from the angle of the first functional module below with reference to Fig. 6;Fig. 6 is the present invention The flow diagram two of the audio data processing method of offer, as shown in fig. 6, audio data processing method provided in this embodiment Include:
S601 receives audio data.
Whether S602, audio data are the first frame audio data transmitted after the completion of cache module is rebuild;If so, holding Row S604, if it is not, executing S603.
Whether S603, audio data are the first frame audio data transmitted after cache module empties the cache;If so, holding Row S604, if it is not, executing S605.
S604 determines that audio data is the audio data of timestamp to be corrected, and the initial time stamp of recording audio evidence.
Cache module is written in audio data by S605.
Although being appreciated that above-described embodiment using the first functional module, the second functional module as executing subject, to this Audio data processing method provided by inventive embodiments is illustrated and introduces.But it will be appreciated by those skilled in the art that , aforesaid operations it also will be understood that are as follows: these functional modules are called come what is completed and realize by smart television, this is no longer added To repeat.
Those of ordinary skill in the art will appreciate that: realize that all or part of the steps of above-mentioned each method embodiment can lead to The relevant hardware of program instruction is crossed to complete.Program above-mentioned can be stored in a computer readable storage medium.The journey When being executed, execution includes the steps that above-mentioned each method embodiment to sequence;And storage medium above-mentioned include: ROM, RAM, magnetic disk or The various media that can store program code such as person's CD.
Fig. 7 is the structural schematic diagram one of an audio-frequency data processing device provided by the invention;The audio-frequency data processing device The some or all of of electronic equipment (such as smart television) can be implemented in combination with by software, hardware or both.Such as Fig. 7 Shown, which may include: reading unit 701, judging unit 702 and correction unit 703.
Reading unit 701, for reading audio data from cache module.
Judging unit 702, for determine audio data whether be timestamp to be corrected audio data.
Reading unit 701, if being the audio data of timestamp to be corrected specifically for audio data, from the first function mould Block reads the first parameter, and the first parameter is used to indicate the initial time stamp of audio data.
Unit 703 is corrected, for the initial time stamp according to audio data, the timestamp of audio calibration data obtains sound Timestamp after frequency Data correction.
Optionally, Fig. 8 is the structural schematic diagram two of an audio-frequency data processing device provided by the invention, as shown in figure 8, should Audio-frequency data processing device 700 can also comprise determining that unit 704, notification message receiving unit 705 and head information transmitting unit 706。
Optionally, judging unit 702 are also used to whether audio data is the transmitted after the completion of cache module is rebuild One frame audio data.
Determination unit 704, if being the first frame audio data transmitted after the completion of cache module is rebuild for audio data, Determine that audio data is the audio data of timestamp to be corrected.
Optionally, reading unit 701 are also used to read the second parameter from the first functional module, and the second parameter is used to indicate Cache module, which is in, rebuilds completion status.
Optionally, judging unit 702, if for audio data not being first transmitted after the completion of cache module is rebuild Frame audio data, then whether audio data is the first frame audio data transmitted after cache module empties the cache.
Optionally, determination unit 704, if being the first frame audio transmitted after cache module empties the cache for audio data Data, it is determined that audio data is the audio data of timestamp to be corrected.
Notification message receiving unit 705, for receiving notification message, notification message, which is used to indicate cache module and is in, to be emptied Buffer status.
Optionally, unit 703 is corrected, after correcting the initial time stamp of audio data as audio data Timestamp.
Optionally, unit 703 is corrected, specifically for determining the timestamp estimated value of audio data;According to audio data The initial time stamp of timestamp estimated value and audio data determines the timestamp corrected value of audio data;According to audio data The timestamp corrected value of timestamp estimated value and audio data, the timestamp of audio calibration data, after obtaining audio data correction Timestamp.
Optionally, correct unit 703, specifically for by the timestamp estimated value of audio data and audio data it is initial when Between stab the difference subtracted each other, the timestamp corrected value as audio data.
Optionally, unit 703 is corrected, specifically for by the timestamp estimated value of audio data and the timestamp of audio data Corrected value is added, the timestamp after obtaining audio data correction.
Optionally, unit 703 is corrected, specifically for using the timestamp corrected value of audio data as where audio data points The timestamp corrected value of other audio datas of section, is corrected the timestamp of other audio datas.
Head information transmitting unit 706, for adding head information in audio data, head information includes: audio data correction Timestamp afterwards;Audio data after addition head information is sent to audio-frequency module.
Audio-frequency data processing device provided by the invention can execute the dynamic of the second functional module in above method embodiment Make, it is similar that the realization principle and technical effect are similar, and details are not described herein.
Fig. 9 is the structural schematic diagram one of another audio-frequency data processing device provided by the invention;Audio data processing dress The some or all of of electronic equipment (such as smart television) can be implemented in combination with by software, hardware or both by setting.Such as Shown in Fig. 9, which may include: that audio data receipt unit 901, judging unit 902 and setting are single Member 903.
Audio data receipt unit 901, for receiving audio data, audio data includes the initial time of audio data Stamp.
Judging unit 902, for determine audio data whether be timestamp to be corrected audio data.
Setting unit 903, if being the audio data of timestamp to be corrected for audio data, according to the first of audio data The first parameter of beginning time stamp setting, the first parameter are used to indicate the initial time stamp of audio data.
Figure 10 is the structural schematic diagram two of another audio-frequency data processing device provided by the invention, as shown in Figure 10, the sound Frequency data processing equipment 900 can also comprise determining that unit 904, reconstruction unit 905 and notification message receiving unit 906.
Optionally, whether judging unit 902 are to transmit after the completion of cache module is rebuild specifically for audio data First frame audio data.
Determination unit 904, if being the first frame audio data transmitted after the completion of cache module is rebuild for audio data, Determine that audio data is the audio data of timestamp to be corrected.
Reconstruction unit 905, for being rebuild to cache module.
Optionally, setting unit 903, are also used to be arranged after the completion of cache module is rebuild the second parameter, and the second parameter is used It is in instruction cache module and rebuilds completion status.
Optionally, judging unit 902, if specifically for audio data not being first transmitted after the completion of cache module is rebuild Frame audio data, then whether audio data is the first frame audio data transmitted after cache module empties the cache.
Optionally, determination unit 904, if being the first frame audio transmitted after cache module empties the cache for audio data Data, it is determined that audio data is the audio data of timestamp to be corrected.
Notification message receiving unit 906, for receiving notification message, notification message, which is used to indicate cache module and is in, to be emptied Buffer status.
Audio-frequency data processing device provided by the invention can execute the dynamic of the first functional module in above method embodiment Make, it is similar that the realization principle and technical effect are similar, and details are not described herein.
Figure 11 is the structural schematic diagram of electronic equipment provided by the invention.As shown in figure 11, which may include: At least one processor 1101 and memory 1102.Figure 11 shows the electronic equipment taken a processor as an example, wherein
Memory 1102, for storing program.Specifically, program may include program code, and said program code includes Computer operation instruction.Memory 1102 may include high speed RAM memory, it is also possible to further include nonvolatile memory (non-volatile memory), for example, at least a magnetic disk storage.
Processor 1101 is used to execute the computer executed instructions that the memory 1102 stores, to realize above-described embodiment In button processing method, it is similar that the realization principle and technical effect are similar, and details are not described herein.
Wherein, processor 1101 may be a central processing unit (Central Processing Unit, referred to as CPU) or specific integrated circuit (Application Specific Integrated Circuit, referred to as ASIC), Or it is arranged to implement one or more integrated circuits of the embodiment of the present invention.
Optionally, in specific implementation, if communication interface, memory 1102 and the independent realization of processor 1101, lead to Letter interface, memory 1102 and processor 1101 can be connected with each other by bus and complete mutual communication.The bus It can be industry standard architecture (Industry Standard Architecture, referred to as ISA) bus, external equipment Interconnect (Peripheral Component, referred to as PCI) bus or extended industry-standard architecture (Extended Industry Standard Architecture, referred to as EISA) bus etc..The bus can be divided into address bus, number According to bus, control bus etc., it is not intended that an only bus or a type of bus.
Optionally, in specific implementation, if communication interface, memory 1102 and processor 1101 are integrated in chip piece Upper realization, then communication interface, memory 1102 and processor 1101 can be completed by internal interface it is identical between communication.
The present invention also provides a kind of computer readable storage medium, which may include: U Disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), the various media that can store program code such as disk or CD.Specifically, the computer readable storage medium In be stored with program instruction, program instruction is for the method in above-described embodiment.
The present invention also provides a kind of computer program product, which includes computer program or refers to Enable, when the computer program or instruction be run when, the method in above-described embodiment may be implemented.
Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention., rather than its limitations;To the greatest extent Pipe present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that: its according to So be possible to modify the technical solutions described in the foregoing embodiments, or to some or all of the technical features into Row equivalent replacement;And these are modified or replaceed, various embodiments of the present invention technology that it does not separate the essence of the corresponding technical solution The range of scheme.

Claims (20)

1. a kind of audio data processing method, it is applied to the second functional module, second functional module is used for being sent to The audio data of audio-frequency module adds timestamp, which is characterized in that the described method includes:
Audio data is read from cache module;
Determine the audio data whether be timestamp to be corrected audio data;
If so, reading the first parameter from the first functional module, first parameter is used to indicate the initial of the audio data Timestamp;
According to the initial time stamp of the audio data, the timestamp of the audio data is corrected, obtains the audio data school Timestamp after just.
2. the method according to claim 1, wherein whether the determination audio data is the time to be corrected The audio data of stamp, comprising:
Judge whether the audio data is the first frame audio data transmitted after the completion of the cache module is rebuild;
If so, determining that the audio data is the audio data of timestamp to be corrected.
3. according to the method described in claim 2, it is characterized in that, described judge whether the audio data is the caching mould Before the first frame audio data that block transmits after the completion of rebuilding, the method also includes:
From first functional module read the second parameter, second parameter be used to indicate the cache module be in rebuild At state.
4. according to the method described in claim 2, it is characterized in that, described judge whether the audio data is the caching mould After the first frame audio data that block transmits after the completion of rebuilding, further includes:
If it is not, then judging whether the audio data is the first frame audio data transmitted after the cache module empties the cache;
If so, determining that the audio data is the audio data of timestamp to be corrected.
5. according to the method described in claim 4, it is characterized in that, described judge whether the audio data is the caching mould Before the first frame audio data that block transmits after emptying the cache, the method also includes:
Notification message is received, the notification message is used to indicate the cache module and is in the state that empties the cache.
6. the method according to claim 1, wherein the initial time stamp according to the audio data, school The timestamp of the just described audio data, the timestamp after obtaining the audio data correction, comprising:
Using the initial time stamp of the audio data as the timestamp after audio data correction.
7. the method according to claim 1, wherein the initial time stamp according to the audio data, school The timestamp of the just described audio data, the timestamp after obtaining the audio data correction, comprising:
Determine the timestamp estimated value of the audio data;
According to the initial time stamp of the timestamp estimated value of the audio data and the audio data, the audio data is determined Timestamp corrected value;
According to the timestamp corrected value of the timestamp estimated value of the audio data and the audio data, the audio number is corrected According to timestamp, timestamp after obtaining audio data correction.
8. the method according to the description of claim 7 is characterized in that the timestamp estimated value according to the audio data and The initial time stamp of the audio data determines the timestamp corrected value of the audio data, comprising:
The difference that the initial time stamp of the timestamp estimated value of the audio data and the audio data is subtracted each other, as The timestamp corrected value of the audio data.
9. according to the method described in claim 8, it is characterized in that, the timestamp estimated value according to the audio data and The timestamp corrected value of the audio data, corrects the timestamp of the audio data, after obtaining the audio data correction Timestamp, comprising:
The timestamp estimated value of the audio data is added with the timestamp corrected value of the audio data, obtains the audio Timestamp after Data correction.
10. the method according to the description of claim 7 is characterized in that the timestamp estimated value according to the audio data With the initial time stamp of the audio data, after the timestamp corrected value for determining the audio data, the method also includes:
Using the timestamp corrected value of the audio data as the time for other audio datas being segmented where the audio data Corrected value is stabbed, the timestamp of other audio datas is corrected.
11. -10 described in any item methods according to claim 1, which is characterized in that it is described obtain audio data correction after Timestamp after, the method also includes:
Head information is added in the audio data, the head information includes: the timestamp after the audio data correction;
Audio data after addition head information is sent to the audio-frequency module.
12. a kind of audio data processing method, is applied to the first functional module, first functional module is used for cache module Audio data is written, which is characterized in that the described method includes:
Audio data is received, the audio data includes the initial time stamp of the audio data;
Determine the audio data whether be timestamp to be corrected audio data;
If so, the first parameter is arranged according to the initial time stamp of the audio data, first parameter is used to indicate described The initial time stamp of audio data.
13. according to the method for claim 12, which is characterized in that when whether the determination audio data is to be corrected Between the audio data that stabs, comprising:
Judge whether the audio data is the first frame audio data transmitted after the completion of the cache module is rebuild;
If so, determining that the audio data is the audio data of timestamp to be corrected.
14. according to the method for claim 13, which is characterized in that described to judge whether the audio data is the caching Before the first frame audio data transmitted after the completion of remodelling, the method also includes:
The cache module is rebuild;
The second parameter is set after the completion of the cache module is rebuild, second parameter is used to indicate the cache module and is in Rebuild completion status.
15. according to the method for claim 13, which is characterized in that described to judge whether the audio data is the caching After the first frame audio data transmitted after the completion of remodelling, further includes:
If it is not, then judging whether the audio data is the first frame audio data transmitted after the cache module empties the cache;
If so, determining that the audio data is the audio data of timestamp to be corrected.
16. according to the method for claim 15, which is characterized in that described to judge whether the audio data is the caching Before the first frame audio data that module is transmitted after emptying the cache, the method also includes:
Notification message is received, the notification message is used to indicate the cache module and is in the state that empties the cache.
17. a kind of audio-frequency data processing device characterized by comprising
Reading unit, for reading audio data from cache module;
Judging unit, for determine the audio data whether be timestamp to be corrected audio data;
The reading unit, if the audio data that the audio data is timestamp to be corrected is also used to, from the first function mould Block reads the first parameter, and first parameter is used to indicate the initial time stamp of the audio data;
It corrects unit and corrects the timestamp of the audio data for the initial time stamp according to the audio data, obtain institute Timestamp after stating audio data correction.
18. a kind of audio-frequency data processing device characterized by comprising
Audio data receipt unit, for receiving audio data, the audio data includes the initial time of the audio data Stamp;
Judging unit, for determine the audio data whether be timestamp to be corrected audio data;
Setting unit, if being the audio data of timestamp to be corrected for the audio data, according to the audio data The first parameter is arranged in initial time stamp, and first parameter is used to indicate the initial time stamp of the audio data.
19. a kind of electronic equipment characterized by comprising
Memory, for storing program instruction;
Processor, for calling and executing the program instruction in the memory, perform claim requires 1-16 described in any item Method and step.
20. a kind of readable storage medium storing program for executing, which is characterized in that be stored with computer program, the meter in the readable storage medium storing program for executing Calculation machine program requires the described in any item methods of 1-16 for perform claim.
CN201910194879.0A 2019-03-14 2019-03-14 Audio data processing method and device, electronic equipment and storage medium Active CN109905752B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910194879.0A CN109905752B (en) 2019-03-14 2019-03-14 Audio data processing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910194879.0A CN109905752B (en) 2019-03-14 2019-03-14 Audio data processing method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN109905752A true CN109905752A (en) 2019-06-18
CN109905752B CN109905752B (en) 2021-06-08

Family

ID=66953198

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910194879.0A Active CN109905752B (en) 2019-03-14 2019-03-14 Audio data processing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN109905752B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112153447A (en) * 2020-09-27 2020-12-29 海信视像科技股份有限公司 Display device and sound and picture synchronous control method

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101237586A (en) * 2008-02-22 2008-08-06 上海华平信息技术股份有限公司 Synchronous playing method for audio and video buffer
US20140104440A1 (en) * 2012-10-12 2014-04-17 Sriram Sampathkumaran Method and apparatus for video streaming
CN104269182A (en) * 2014-09-18 2015-01-07 歌尔声学股份有限公司 Synchronized audio playing method, device and system
CN107566890A (en) * 2017-09-15 2018-01-09 深圳国微技术有限公司 Handle audio stream broadcasting abnormal method, apparatus, computer installation and computer-readable recording medium
CN107566889A (en) * 2017-09-15 2018-01-09 深圳国微技术有限公司 Audio stream flow rate error processing method, device, computer installation and computer-readable recording medium
US20180329670A1 (en) * 2017-05-15 2018-11-15 MIXHalo Corp. Systems and methods for providing real-time audio and data

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101237586A (en) * 2008-02-22 2008-08-06 上海华平信息技术股份有限公司 Synchronous playing method for audio and video buffer
US20140104440A1 (en) * 2012-10-12 2014-04-17 Sriram Sampathkumaran Method and apparatus for video streaming
CN104269182A (en) * 2014-09-18 2015-01-07 歌尔声学股份有限公司 Synchronized audio playing method, device and system
US20180329670A1 (en) * 2017-05-15 2018-11-15 MIXHalo Corp. Systems and methods for providing real-time audio and data
CN107566890A (en) * 2017-09-15 2018-01-09 深圳国微技术有限公司 Handle audio stream broadcasting abnormal method, apparatus, computer installation and computer-readable recording medium
CN107566889A (en) * 2017-09-15 2018-01-09 深圳国微技术有限公司 Audio stream flow rate error processing method, device, computer installation and computer-readable recording medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
贺志强: "基于Gstreamer媒体播放器的研究与设计", 《中国优秀硕士学位论文全文数据库(电子期刊)》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112153447A (en) * 2020-09-27 2020-12-29 海信视像科技股份有限公司 Display device and sound and picture synchronous control method
CN112153447B (en) * 2020-09-27 2022-06-14 海信视像科技股份有限公司 Display device and sound and picture synchronous control method

Also Published As

Publication number Publication date
CN109905752B (en) 2021-06-08

Similar Documents

Publication Publication Date Title
US20140086446A1 (en) Method and apparatus for image data processing, and electronic device including the apparatus
CN100592379C (en) Apparatuses and methods for switching between buffers using a video frame buffer flip queue
CN106371998A (en) Mobile application testing system and method
CN107018443A (en) Video recording method, device and electronic equipment
US10529383B2 (en) Methods and systems for processing synchronous data tracks in a media editing system
CN105612743A (en) Audio video playback synchronization for encoded media
CN101106770A (en) A method for making shot animation with background music in mobile phone
CN110418183B (en) Audio and video synchronization method and device, electronic equipment and readable medium
US10412320B1 (en) Method and system for switching display from first video source to second video source
CN109379619A (en) Sound draws synchronous method and device
CN110166723A (en) It is a kind of to record the audio and video synchronization method in shielding, electronic equipment, storage medium
US8054337B2 (en) Methods and apparatuses for serializing and/or deserializing video timing signals and parallel image data output from an image sensor
CN107864393A (en) The method and device that video is shown with captioning synchronization
CN109905752A (en) Audio data processing method, device, electronic equipment and storage medium
CN114025202A (en) Video processing method, device and storage medium
CN111641758B (en) Video and audio recording method and device and computer readable storage medium
CN107580264A (en) Multimedia resource play handling method and device
CN108966000A (en) Playback method and its device, medium, terminal
WO2018076899A1 (en) Data switching method, device, terminal and computer-readable storage medium
CN113473215B (en) Screen recording method, device, terminal and storage medium
CN105847990A (en) Media file playing method and apparatus
CN107872678B (en) Textual presentation method and apparatus, live broadcasting method and device based on live streaming
CN102752478B (en) Field synchronizing signal processing method and control circuit
US7672402B2 (en) Data processing apparatus and method and encoding device
KR101027529B1 (en) Apparatus for editing multi-picture and apparatus for displaying multi-picture

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
CB02 Change of applicant information

Address after: 266555 Qingdao economic and Technological Development Zone, Shandong, Hong Kong Road, No. 218

Applicant after: Hisense Video Technology Co., Ltd

Address before: 266555 Qingdao economic and Technological Development Zone, Shandong, Hong Kong Road, No. 218

Applicant before: HISENSE ELECTRIC Co.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant