CN107342098A - Audio frequency playing method and device - Google Patents
Audio frequency playing method and device Download PDFInfo
- Publication number
- CN107342098A CN107342098A CN201710595666.XA CN201710595666A CN107342098A CN 107342098 A CN107342098 A CN 107342098A CN 201710595666 A CN201710595666 A CN 201710595666A CN 107342098 A CN107342098 A CN 107342098A
- Authority
- CN
- China
- Prior art keywords
- audio
- decoded
- decoding
- section
- audio section
- 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
Links
Classifications
-
- G—PHYSICS
- G11—INFORMATION STORAGE
- G11B—INFORMATION STORAGE BASED ON RELATIVE MOVEMENT BETWEEN RECORD CARRIER AND TRANSDUCER
- G11B20/00—Signal processing not specific to the method of recording or reproducing; Circuits therefor
- G11B20/10—Digital recording or reproducing
- G11B20/10009—Improvement or modification of read or write signals
- G11B20/10018—Improvement or modification of read or write signals analog processing for digital recording or reproduction
-
- G—PHYSICS
- G10—MUSICAL INSTRUMENTS; ACOUSTICS
- G10L—SPEECH ANALYSIS OR SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING; SPEECH OR AUDIO CODING OR DECODING
- G10L19/00—Speech or audio signals analysis-synthesis techniques for redundancy reduction, e.g. in vocoders; Coding or decoding of speech or audio signals, using source filter models or psychoacoustic analysis
- G10L19/04—Speech or audio signals analysis-synthesis techniques for redundancy reduction, e.g. in vocoders; Coding or decoding of speech or audio signals, using source filter models or psychoacoustic analysis using predictive techniques
- G10L19/16—Vocoder architecture
Abstract
The embodiment of the present invention, which provides a kind of audio frequency playing method and device, this method, to be included:At least one audio section that do not decode is decoded, obtains the first decoding audio section;The number N for not decoding audio section corresponding to the first decoding audio section is obtained, the N is the integer more than or equal to 1;By the broadcasting moment in non-decoded audio information queue, in first non-decoded audio information, be defined as the first decoding audio section first plays the moment, and moment broadcasting the first decoding audio section is played described first, corresponding one of a non-decoded audio information does not decode audio section in the non-decoded audio information queue;The non-decoded audio information of top n is deleted in the non-decoded audio information queue.For improving the reliability of audio broadcasting.
Description
Technical field
The present embodiments relate to audio signal processing technique field, more particularly to a kind of audio frequency playing method and device.
Background technology
, it is necessary to be decoded to audio before being played out to audio, and decoded audio is played out.Do not solve
Code audio file is generally made up of multiple audio sections that do not decode, and each does not decode the usual phase of playing duration corresponding to audio section
Together, each does not decode the corresponding non-decoded audio information of audio section, and generally including this in non-decoded audio information does not decode
Position of the audio section in internal memory, this do not decode broadcasting moment and playing duration of audio section etc..
Before audio broadcasting, according to the broadcasting moment for not decoding audio section, a moment forward part will be played and do not decoded
Non- decoded audio information corresponding to audio section is deposited into non-decoded audio information queue, wherein, reproduction time is more forward not
Non- decoded audio information corresponding to audio section is decoded closer to the head of the queue of queue.In the prior art, audio generally will not be decoded
Number ratio with decoding audio is arranged to 1, i.e. one does not decode the corresponding decoding audio of audio;Accordingly, broadcast in audio
During putting, first solved to not decoding audio section corresponding to first non-decoded audio information in non-decoded audio information queue
Code, obtain decoding audio section, then, when obtaining the broadcasting in non-decoded audio information queue in first non-decoded audio information
Carve, and decoding audio section is played out at the broadcasting moment, meanwhile, terminal device is not solving according to default number ratio 1
A non-decoded audio information for being located at head of the queue is deleted in code audio-frequency information queue.
However, in actual application, for part audio file, it is necessary to which multiple audio sections that do not decode could decode
To a decoding audio section, do not decoded after audio section obtains a decoding audio section according to multiple, terminal device still root
According to default number ratio 1, a non-decoded audio information for being located at head of the queue is deleted in non-decoded audio information queue.This
Sample, after terminal device decoding next time obtains a decoding audio section, first does not solve in non-decoded audio information queue
The broadcasting moment acquired in code audio-frequency information and the actual play moment of decoded audio information are not inconsistent so that audio plays different
Often, audio is caused to play reliability poor.
The content of the invention
The embodiment of the present invention provides a kind of audio frequency playing method and device, improves the reliability of audio broadcasting.
In a first aspect, the embodiment of the present invention provides a kind of audio frequency playing method, including:
At least one audio section that do not decode is decoded, obtains the first decoding audio section;
The number N, the N that do not decode audio section corresponding to the first decoding audio section are obtained as more than or equal to 1
Integer;
By the broadcasting moment in non-decoded audio information queue, in first non-decoded audio information, it is defined as described
One decoding audio section first play the moment, and described first play the moment play it is described first decoding audio section, it is described not
Corresponding one of a non-decoded audio information does not decode audio section in decoded audio information queue;
The non-decoded audio information of top n is deleted in the non-decoded audio information queue.
It is described that at least one audio section that do not decode is decoded in a kind of possible embodiment, obtain the first solution
Code audio section, including:
Step A, in the non-decoded information queue, do not decode audio section corresponding to preceding m non-decoded audio informations and enter
Row decoding;
Step B, judge whether decoding succeeds;If so, then perform step C;If it is not, then perform step D;
Step C, the audio section that decoding obtains is defined as the first decoding audio section;
Step D, the value of the m is then added 1, and performs step A;
Wherein, the initial value of the m is 1.
In alternatively possible embodiment, for not decoding audio section corresponding to the first decoding audio section is obtained
Number N, including:
When obtaining the described first the first playing duration for decoding audio section and second broadcasting for not decoding audio section
It is long;
According to the ratio of first playing duration and second playing duration, the N is determined.
In alternatively possible embodiment, the first playing duration of the first decoding audio section is obtained, including:
Obtain the audio size, default audio sample digit, default audio track of the first decoding audio section
Several and default audio sample rate;
According to the audio size, the audio sample digit, the audio track number and the audio sample rate, really
Fixed first playing duration.
In alternatively possible embodiment, for not decoding audio section corresponding to the first decoding audio section is obtained
After number N, in addition to:
The N is stored in the buffer.
In alternatively possible embodiment, methods described also includes:
The N is obtained in the caching;
According to the non-decoded audio information of top n in the non-decoded audio information queue, acquisition is N number of not to decode audio section;
N number of audio section that do not decode is decoded, obtains the second decoding audio section;
By the broadcasting moment in non-decoded audio information queue, in first non-decoded audio information, it is defined as described
The second of two decoding audio sections plays the moment, and plays moment broadcasting the second decoding audio section described second;
The non-decoded audio information of top n is deleted in the non-decoded audio information queue.
Second aspect, the embodiment of the present invention provide a kind of audio playing apparatus, including decoder module, the first acquisition module,
Determining module, playing module and removing module, wherein,
The decoder module is used for, and at least one audio section that do not decode is decoded, obtains the first decoding audio section;
First acquisition module is used for, and obtains the number N for not decoding audio section corresponding to the first decoding audio section,
The N is the integer more than or equal to 1;
The determining module is used for, by the broadcasting in non-decoded audio information queue, in first non-decoded audio information
Moment, be defined as the first decoding audio section first play the moment;
The playing module is used for, and moment broadcasting the first decoding audio section is played described first, described not decode
Corresponding one of a non-decoded audio information does not decode audio section in audio-frequency information queue;
The removing module is used for, and the non-decoded audio information of top n is deleted in the non-decoded audio information queue.
In a kind of possible embodiment, the decoder module is specifically used for performing following steps:
Step A, in the non-decoded information queue, do not decode audio section corresponding to preceding m non-decoded audio informations and enter
Row decoding;
Step B, judge whether decoding succeeds;If so, then perform step C;If it is not, then perform step D;
Step C, the audio section that decoding obtains is defined as the first decoding audio section;
Step D, the value of the m is then added 1, and performs step A;
Wherein, the initial value of the m is 1.
In alternatively possible embodiment, first acquisition module includes acquiring unit and determining unit, wherein,
The acquiring unit is used for, and obtains the described first the first playing duration for decoding audio section and one does not decode sound
Second playing duration of frequency range;
The determining unit is used for, and according to the ratio of first playing duration and second playing duration, determines institute
State N.
In alternatively possible embodiment, the acquiring unit is specifically used for:
Obtain the audio size, default audio sample digit, default audio track of the first decoding audio section
Several and default audio sample rate;
According to the audio size, the audio sample digit, the audio track number and the audio sample rate, really
Fixed first playing duration.
In alternatively possible embodiment, described device also includes memory module, wherein,
The memory module is used for, and obtains in first acquisition module and is not decoded corresponding to the first decoding audio section
After the number N of audio section, the N is stored in the buffer.
In alternatively possible embodiment, described device also includes the second acquisition module and the 3rd acquisition module, its
In,
Second acquisition module is used for, and the N is obtained in the caching;
3rd acquisition module is used for, according to the non-decoded audio information of top n in the non-decoded audio information queue,
Obtain and N number of do not decode audio section;
The decoder module is additionally operable to, and N number of audio section that do not decode is decoded, obtains the second decoding audio section;
The determining module is additionally operable to, by broadcasting in non-decoded audio information queue, in first non-decoded audio information
The moment is put, be defined as the second decoding audio section second plays the moment;
The playing module is additionally operable to, and moment broadcasting the second decoding audio section is played described second;
The removing module is additionally operable to, and the non-decoded audio information of top n is deleted in the non-decoded audio information queue.
Audio frequency playing method and device provided in an embodiment of the present invention, according at least one audio section that do not decode
To after the first decoding audio section, the number N for not decoding audio section corresponding to the first decoding audio section is obtained, and first is decoded
When the first broadcasting moment of audio section is defined as the broadcasting in non-decoded audio information queue in first non-decoded audio information
Carve, and the first decoding audio section is played at the first broadcasting moment, because first does not decode in non-decoded audio information queue
The broadcasting moment in audio-frequency information is N number of broadcasting moment not decoded in audio section earliest, thereby it can be assured that the
The broadcasting moment of one decoding audio section is correct.Further, top n is deleted also in non-decoded audio information queue not solve
Code audio-frequency information, that is, what is decoded in the number and last time decoding process of the non-decoded audio information deleted does not decode audio section
Number it is identical, so, can cause the non-decoded audio information in current non-decoded audio information queue positioned at head of the queue with
In secondary decoding process, need broadcastings moment for being decoded it is earliest do not decode audio section correspondence, and then can ensure to determine
It is correct that the broadcasting moment of obtained decoding audio section is decoded to next time.The like, it can be ensured that each decoding audio
The broadcasting moment of section is correct, and then audio can be avoided to play the problem of abnormal, and then improves the reliability of audio broadcasting.
Brief description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing
There is the required accompanying drawing used in technology description to be briefly described, it should be apparent that, drawings in the following description are this hairs
Some bright embodiments, for those of ordinary skill in the art, without having to pay creative labor, can be with
Other accompanying drawings are obtained according to these accompanying drawings.
Fig. 1 is the application scenarios schematic diagram of audio frequency playing method provided in an embodiment of the present invention;
Fig. 2 is the schematic flow sheet one of audio frequency playing method provided in an embodiment of the present invention;
Fig. 3 is the schematic flow sheet two of audio frequency playing method provided in an embodiment of the present invention;
Fig. 4 is the corresponding relation figure provided in an embodiment of the present invention for not decoding audio section and non-decoded audio information;
Fig. 5 is the structural representation one of audio playing apparatus provided in an embodiment of the present invention;
Fig. 6 is the structural representation two of audio playing apparatus provided in an embodiment of the present invention;
Fig. 7 is the structural representation three of audio playing apparatus provided in an embodiment of the present invention.
Embodiment
To make the purpose, technical scheme and advantage of the embodiment of the present invention clearer, below in conjunction with the embodiment of the present invention
In accompanying drawing, the technical scheme in the embodiment of the present invention is clearly and completely described, it is clear that described embodiment is
Part of the embodiment of the present invention, rather than whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art
The every other embodiment obtained under the premise of creative work is not made, belongs to the scope of protection of the invention.
Fig. 1 is the application scenarios schematic diagram of audio frequency playing method provided in an embodiment of the present invention.Fig. 1 is referred to, terminal is set
Standby can be the equipment such as mobile phone, computer, TV, and terminal device can be decoded to audio, and audio is played out.It please join
See Fig. 1, do not decode audio and stored in terminal device in the form of not decoding audio section, for example, not decoding in audio section each
The audio sample frame of predetermined number can be included, optionally, do not decode the number for the audio sample frame that audio section includes each
The playing duration that with identical, accordingly, each can not decode audio section is also identical.Each, which does not decode audio section, has corresponding to it
Non- decoded audio information, non-decoded audio information includes the attribute information for not decoding audio section, for example, non-decoded audio information
Include not decoding address of the audio section in internal memory, do not decode the broadcasting moment of audio, do not decode the playing duration of audio section
Etc. information.
When needing to carry out audio broadcasting, created in terminal device and do not decode non-decoded audio information team corresponding to audio
Row, and according to the broadcasting moment for not decoding audio section, and by play the moment earlier part do not decode audio section do not decode sound
Frequency information is deposited to non-decoded audio information queue, wherein, audio is not decoded corresponding to the non-decoded audio information positioned at head of the queue
The broadcasting moment of section is earliest.For example, refer to Fig. 1, it is assumed that can at most store 4 in non-decoded audio information queue and not decode
Audio-frequency information, the broadcasting moment for not decoding audio section 1 is 0ms, does not decode non-decoded audio information 1 corresponding to audio section 1
In the head of the queue of non-decoded audio information queue, the broadcasting moment for not decoding audio section 2 is 10ms, does not decode the correspondence of audio section 2
Non- decoded audio information 2 be located at the second of non-decoded audio information queue, the like, non-decoded audio information 3 is located at
3rd, non-decoded audio information 4 is located at the 4th.
When carrying out audio broadcasting, do not decoded according to non-decoded audio information 1 in non-decoded audio information queue, acquisition first
Audio section 1, and decoded according to tonal range 1 is not decoded, if it can not be correctly decoded according to audio section 1 is not decoded, then root
According to non-decoded audio information 2, acquisition does not decode audio section 2, and is solved according to not decoding audio section 1 and not decoding audio section 2
Code.Assuming that according to do not decode audio section 1 and do not decode audio section 2 decoding obtain decode tonal range 1, and by positioned at head of the queue not
The broadcasting moment (0ms) in decoded audio information 1 is defined as decoding the broadcasting moment of audio section 1, and in 0ms broadcast decoders
Audio section 1, meanwhile, terminal device, which also determines to decode corresponding to audio section 1, does not decode the number (2) of audio section, and is not decoding
2 non-decoded audio informations (non-decoded audio information 1 and non-decoded audio information 2) are deleted in audio-frequency information queue.
The broadcasting moment due to decoding audio section is not decode audio letter positioned at head of the queue in non-decoded audio information queue
At the broadcasting moment in breath, therefore, in order to which the broadcasting moment for ensureing to decode tonal range is correct, then need to ensure to be located at not solve
The non-decoded audio information of head of the queue is correct in code audio-frequency information queue.In this application, it is determined that complete decoding audio
After the broadcasting moment of section, calculate and do not decode audio section number corresponding to the decoding audio section, and according to the decoding audio section pair
That answers does not decode audio section number, and the non-decoded audio information of corresponding number is deleted in non-decoded audio information queue, so,
May insure it is next decoding audio section the broadcasting moment be it is correct, the like, it may be determined that in audio each decode
The broadcasting moment of audio section is correct, and audio can be avoided to play the problem of abnormal, and then improves the reliable of audio broadcasting
Property.
Below, by specific embodiment, the technical scheme shown in the application is described in detail.It should be noted that
Several specific embodiments can be combined with each other below, for same or analogous content, no longer carry out in various embodiments
Repeat.
Fig. 2 is the schematic flow sheet one of audio frequency playing method provided in an embodiment of the present invention.Fig. 2 is referred to, this method can
With including:
S201, at least one audio section that do not decode is decoded, obtain the first decoding audio section.
The executive agent of the embodiment of the present invention can be terminal device, or the audio being arranged in terminal device is broadcast
Put device.Optionally, audio playing apparatus can be realized by software, or, audio playing apparatus can also by software and
Hardware is implemented in combination with.
For different audio files, because the coded system of audio is different, accordingly, it may be desirable to which one does not decode audio
Section can decodes to obtain a decoding audio section, it is also possible to which needing two not decode audio section can decode to obtain a solution
Code audio section, it is also possible to which needing more not decode audio section can decode to obtain a decoding audio section.Due to same
A kind of coded system of audio file generally use, therefore, for same audio file, decoding obtains a decoding audio section institute
The number for not decoding audio section needed is usually fixed.
, will be default according to the broadcasting moment for not decoding audio section when terminal device needs to play out audio file
It is individual it is several do not decode non-decoded audio information corresponding to audio section and be stored in non-decoded audio information queue, further, when
, can also be in non-decoded audio information queue after the non-decoded audio information in part in non-decoded audio information queue is deleted
The new non-decoded audio information of middle increase, to ensure that can include predetermined number in non-decoded audio information queue simultaneously does not solve
Code audio-frequency information.For example, the predetermined number can be 4,6,8 etc., actually should during, can be according to being actually needed
The predetermined number is set, and the embodiment of the present invention is not especially limited to this.
In terminal device for the first time to when not decoding audio section and decoding, terminal device, which is not known, to be needed in audio file
Several audio sections that do not decode are wanted to decode to obtain a decoding audio section, therefore, terminal device needs to attempt to different
Several audio sections that do not decode are decoded, until can correctly decode to obtain a decoding audio section.Optionally, can pass through
Following feasible implementation decodes at least one audio section that do not decode, obtains the first decoding audio section:
To in non-decoded information queue, do not decode audio section corresponding to preceding m non-decoded audio informations and decode;If solution
Code success, then be defined as the first decoding audio section by the audio section that decoding obtains;If decoding failure, adds 1 by m, and to not solving
Audio section is not decoded in code message queue, corresponding to preceding m+1 non-decoded audio informations to be decoded, until successfully decoded;Its
In, when initial, m 1.
Specifically, first it can not decode sound to one corresponding to the first non-decoded audio information in non-decoded information queue
Frequency range is decoded, and judges whether to can decode that success, if it is not, then not decoding audio to the first two in non-decoded information queue
Two do not decode audio section and are decoded corresponding to information, and judge whether to can decode that success, if also unsuccessful, to not solving
In code message queue corresponding to first three non-decoded audio information three do not decode audio section and decoded, the like, until
Successfully decoded, or, when m+1 is more than predetermined threshold value, it is determined that decoding failure.
It is whole more than or equal to 1 not decode the number N, N of audio section corresponding to S202, the decoding audio section of acquisition first
Number.
Optionally, N can be obtained by following feasible implementation:When obtaining the first broadcasting of the first decoding audio section
Long and second playing duration for not decoding audio section, according to the first playing duration and the second playing duration, determines N.
Optionally, the first playing duration can be determined by following feasible implementation:Obtain the first decoding audio section
Audio size, default audio sample digit, default audio track number and default audio sample rate;It is big according to audio
Small, audio sample digit, audio track number and audio sample rate, determine the first playing duration.
For example, the first playing duration d can be determined by equation below one:
Wherein, s is audio size, and b is audio sample digit, and r is audio sample rate, and n is audio track number.It is optional
, s unit can be byte, and b unit can be byte, and r unit can be hertz, and n is positive integer.
For example, it is assumed that the audio size of decoding audio section is 6144 bytes, sampling resolution is 2 bytes, and sound channel number is
2, sample rate is 48000 hertz, then the first playing duration is:Second.
Optionally, do not decode when generally including not decoding the broadcasting of audio section in non-decoded audio information corresponding to audio section
It is long, accordingly, the second playing duration can be obtained in non-decoded audio information corresponding to audio section is not decoded.
Optionally, the ratio of the first playing duration and the second playing duration can be first obtained, can if the ratio is integer
So that the ratio directly is defined as into N, if the ratio is non-integer, the ratio can be rounded up, to obtain N.Example
Such as, it is assumed that the ratio of the first playing duration and the second playing duration is 1.98, then, can be true after being rounded up to 1.98
N is determined for 2;Assuming that the ratio of the first playing duration and the second playing duration is 2.11, then, can after being rounded up to 2.11
To determine N as 2.
Do not solved corresponding to the first decoding audio section it should be noted that can also be obtained according to other feasible implementations
The number N of code audio section, the embodiment of the present invention are not especially limited to this.For example, when performing S201, terminal device is directly united
Meter does not decode audio section decoding according to how many and can be successfully decoded to obtain the first decoding audio section, and then can determine this
Number N.
S203, by the broadcasting moment in non-decoded audio information queue, in first non-decoded audio information, be defined as
The first of one decoding audio section plays the moment, and plays moment broadcasting the first decoding audio section first.
After decoding obtains the first decoding audio section, in non-decoded audio information queue obtain first do not decode sound
Frequency information, and by the broadcasting moment in first non-decoded audio information be defined as the first decoding audio section first play when
Carve, and moment broadcasting the first decoding audio section is played first.
It should be noted that S202 and S203 can be performed sequentially, can also perform parallel;When S202 and S203 orders are held
During row, S203 can also be first carried out, then perform S202.The embodiment of the present invention is not limited specifically S202 and S203 execution sequence
It is fixed.
S204, the non-decoded audio information of top n is deleted in non-decoded audio information queue.
After it is determined that obtaining the first broadcasting moment of the first decoding audio section, deleted in non-decoded audio information queue
The non-decoded audio information of top n.Accordingly, the non-decoded audio information positioned at non-decoded audio information queue back is not to decoding
The Head-of-line movement of audio-frequency information.Optionally, new can also not decoded in the tail of the queue increase of non-decoded audio information queue
Audio-frequency information.It should be noted that the process moved to the position of non-decoded audio information, may refer to the implementation shown in Fig. 4
Description in example, is no longer repeated herein.
In above process, the first decoding audio section is decoded to obtain by N number of audio section that do not decode, next to decode what is obtained
The broadcasting moment for decoding audio section should be the N+1 broadcasting moment for not decoding audio section.In this application, sound is not being decoded
After deleting the non-decoded audio information of top n in frequency message queue, sound is not decoded positioned at non-decoded audio information queue head of the queue
The broadcasting moment in frequency information is the N+1 broadcasting moment for not decoding audio section, therefore, be may insure according to the above method
The broadcasting moment of each decoding audio section is correct.
It should be noted that for same audio file, it is necessary to repeatedly be decoded, to audio file progress first time
During decoding, it can determine not decoding the number N of audio section corresponding to decoding audio section by the method shown in Fig. 2 embodiments, and
Carry out audio broadcasting.Because the number for not decoding audio section in same audio file, corresponding to a decoding audio section is usual
To be fixed, therefore, determine to obtain for not decoding audio section corresponding to decoding audio section when first time carrying out audio decoder
After number N, number N can be cached, when carrying out follow audio decoding, directly obtains number N in the buffer, this
Sample, the efficiency of audio decoder can be improved, and then the smooth degree of audio broadcasting can be improved.
Audio frequency playing method provided in an embodiment of the present invention, decode to obtain first according at least one audio section that do not decode
After decoding audio section, the number N for not decoding audio section corresponding to the first decoding audio section is obtained, and audio section is decoded by first
The first broadcasting moment be defined as broadcasting moment in non-decoded audio information queue in first non-decoded audio information, and
The first broadcasting moment plays the first decoding audio section, due to first non-decoded audio information in non-decoded audio information queue
In the broadcasting moment be it is at least one do not decode in audio section an earliest broadcasting moment, thereby it can be assured that the first solution
The broadcasting moment of code audio section is correct.Further, top n is deleted also in non-decoded audio information queue and does not decode sound
Frequency information, the number for not decoding audio section decoded in the number and last time decoding process of the non-decoded audio information of deletion
It is identical, so, the non-decoded audio information positioned at head of the queue and next decoding process in non-decoded audio information queue can make it that
In, need broadcastings moment for being decoded it is earliest do not decode audio section correspondence, and then can ensure that determination obtains next decoding
The broadcasting moment of obtained decoding audio section is correct.The like, it can be ensured that during the broadcasting of each decoding audio section
Carve correctly, audio can be avoided to play the problem of abnormal, and then improve the reliability that audio plays.
On the basis of embodiment illustrated in fig. 2, optionally, audio section is not decoded corresponding to the first decoding audio section obtaining
Number N after, N can also be stored in the buffer.Accordingly, decoded for next time, following feasible realization side can be passed through
Formula is decoded and audio plays:N is obtained in the buffer;Audio letter is not decoded according to top n in non-decoded audio information queue
Breath, acquisition is N number of not to decode audio section;N number of audio section that do not decode is decoded, obtains the second decoding audio section;It will not decode
Broadcasting moment in audio-frequency information queue, in first non-decoded audio information, be defined as the second decoding audio section second are broadcast
Put the moment, and moment broadcasting the second decoding audio section is played second;Top n is deleted in non-decoded audio information queue not solve
Code audio-frequency information.
On the basis of any one above-mentioned embodiment, below, with reference to Fig. 4, by the embodiment shown in Fig. 3, to audio
File is described in detail with secondary decoding, playing process for the first time.
Fig. 3 is the schematic flow sheet two of audio frequency playing method provided in an embodiment of the present invention.Fig. 4 carries for the embodiment of the present invention
The corresponding relation figure for not decoding audio section and non-decoded audio information supplied.Fig. 3-Fig. 4 is referred to, this method can include:
Non- decoded audio information 1 in S301, the non-decoded audio information queue of basis, which obtains, does not decode audio section 1, and root
Decoded according to audio section 1 is not decoded.
401 in Fig. 4 are referred to, audio file to be played is made up of multiple audio sections that do not decode, and each is not decoded
The playing duration all same of audio section, each does not decode the corresponding non-decoded audio information of audio section, does not decode audio letter
Breath includes the corresponding address for not decoding audio section in internal memory, does not decode the broadcasting moment of audio section and do not decode audio section
Playing duration etc. (full content that incomplete non-decoded audio information includes in figure).Sound is not decoded in the embodiment of the present invention
In frequency message queue simultaneously store up to four non-decoded audio informations, wherein, play the moment it is more early do not decode audio section pair
Position of the non-decoded audio information answered in non-decoded audio information queue is closer to head of the queue.
Before playing out, the S401 in Fig. 4 is referred to, non-decoded audio information queue includes not decoding audio letter
The non-decoded audio informations 4 of 1- are ceased, wherein, non-decoded audio information 1 is located at head of the queue, and non-decoded audio information 4 is located at tail of the queue.
For example, include not decoding address of the audio section 1 in internal memory in non-decoded audio information 1, can be according to the ground
Location, obtained in internal memory and do not decode audio section 1.
After S302, judgement be not according to the decoding failure of audio section 1 is decoded, not solving in non-decoded audio information queue
Code audio-frequency information 2, which obtains, does not decode audio section 2, and is decoded according to not decoding audio section 1 and not decoding audio section 2, obtains
Decode audio section 1.
For example, include not decoding address of the audio section 3 in internal memory in non-decoded audio information 2, can be according to the ground
Location, obtained in internal memory and do not decode audio section 2.
S303, the first playing duration for obtaining decoding audio section 1 and the second playing duration for not decoding audio section 1.
Optionally, the first playing duration can be determined by above-mentioned formula one, the embodiment of the present invention is no longer repeated.
Optionally, the second playing duration can be obtained in non-decoded audio information 1.
S304, according to the first playing duration and the second playing duration, it is determined that not decoding audio section corresponding to decoding audio section 1
Number N be 2.
S305, number N is stored in the buffer as 2.
S306, the broadcasting moment (0ms) in non-decoded audio information queue, in non-decoded audio information 1 is defined as
The broadcasting moment of audio section 1 is decoded, and in 0ms broadcast decoders audio section 1.
Pass through S301-S306, it can be ensured that the broadcasting moment of decoding audio section 1 is correct.
S307, in non-decoded audio information queue delete before 2 non-decoded audio information (non-Hes of decoded audio information 1
Non- decoded audio information 2).
Optionally, 2 non-decoded audio information (non-decoded audio informations 1 before being deleted in non-decoded audio information queue
Non- decoded audio information 2) after, two new non-decoded audio informations are filled into the tail of the queue of non-decoded audio information, i.e.
Fill into non-decoded audio information 5 and non-decoded audio information 6.
402 in Fig. 4 are referred to, non-decoded audio information queue includes non-decoded audio information 3- and do not decode audio letter
Breath 6, wherein, non-decoded audio information 3 is located at head of the queue, and non-decoded audio information 6 is located at tail of the queue.
S308, N is obtained in the buffer as 2.
S309, according to (the non-decoded audio information 3 and not of preceding 2 non-decoded audio informations in non-decoded audio information queue
Decoded audio information 4), obtain 2 and do not decode audio section (do not decode audio section 3 and do not decode audio section 4).
Specifically, the non-decoded audio information 3 in non-decoded audio information queue obtains and does not decode audio section 3, root
Obtained according to the non-decoded audio information 4 in non-decoded audio information queue and do not decode audio section 4.
S310, decoded to not decoding audio section 3 and not decoding audio section 4, obtain decoding audio section 2.
S311, the broadcasting moment (20ms) in non-decoded audio information queue, in non-decoded audio information 3 is defined as
The broadcasting moment of audio section 2 is decoded, and in 20ms broadcast decoders audio section 2.
Pass through S301-S311, it can be ensured that the broadcasting moment of decoding audio section 2 is correct.
S312, in non-decoded audio information queue delete before 2 non-decoded audio information (non-Hes of decoded audio information 3
Non- decoded audio information 4).
Optionally, 2 non-decoded audio information (non-decoded audio informations 3 before being deleted in non-decoded audio information queue
Non- decoded audio information 4) after, two new non-decoded audio informations are filled into the tail of the queue of non-decoded audio information, i.e.
Fill into non-decoded audio information 7 and non-decoded audio information 8.
403 in Fig. 4 are referred to, non-decoded audio information queue includes non-decoded audio information 5- and do not decode audio letter
Breath 8, wherein, non-decoded audio information 5 is located at head of the queue, and non-decoded audio information 8 is located at tail of the queue.
It should be noted that for the decoding after second, playing process, S305-S312 is may refer to, the present invention is real
Example is applied no longer to be repeated.
In above process, it may be determined that the broadcasting moment for decoding audio section each time is correct, can avoid sound
Frequency plays the problem of abnormal, and then improves the reliability that audio plays.
On the basis of any one above-mentioned embodiment, optionally, audio playing apparatus can include multiple plug-in units, and by
Multiple plug-in units realize the technical scheme shown in above method embodiment jointly.Below, by Fig. 5, audio playing apparatus is included
Plug-in unit be described in detail.
Fig. 5 is the structural representation one of audio playing apparatus provided in an embodiment of the present invention.Fig. 5 is referred to, including is demultiplexed
With plug-in unit 501, audio framework 502, audio decoder plug-in unit 503 and audio player plug-in 504, wherein, any one plug-in unit is equal
It can be realized by software and/or hardware.
Demultiplexing plug-in unit 501 be used for generate each in audio file do not decode do not decoded corresponding to audio section audio letter
Breath.Demultiplexing plug-in unit 501 is additionally operable to the decoding performance according to audio decoder plug-in unit 503, will not decode sound in a certain order
Frequency information is sent to audio framework 502.
Audio framework 502 is used to safeguard non-decoded audio information queue, for example, being deleted in non-decoded audio information queue
The non-decoded audio information deleted is needed, the non-decoded audio information that increase needs in non-decoded audio information queue.
Audio decoder plug-in unit 503 is used for according to the non-decoded audio information in non-decoded audio information queue, to corresponding
Do not decode audio section to be decoded, after audio decoder plug-in unit 503 obtains decoding one decoding audio section, audio decoder is inserted
Part 503 sends a notification message to audio framework 502, so that audio framework 502 is deleted accordingly in non-decoded audio information queue
Non- decoded audio information, audio framework 502 is additionally operable to determine the broadcasting moment of decoding audio section, and notification audio player plug-in
504 play out at the broadcasting moment accordingly to corresponding decoding audio section.
It should be noted that Fig. 5 plug-in units that simply signal audio playing apparatus includes in exemplary fashion and each plug-in unit
Function, certainly, in actual application, can according to be actually needed determine the plug-in unit that includes of audio playing apparatus and
The function of each plug-in unit, the embodiment of the present invention are not especially limited to this.
Fig. 6 is the structural representation two of audio playing apparatus provided in an embodiment of the present invention.Fig. 6 is referred to, the device can
With including decoder module 11, the first acquisition module 12, determining module 13, playing module 14 and removing module 15, wherein,
The decoder module 11 is used for, and at least one audio section that do not decode is decoded, obtains the first decoding audio section;
First acquisition module 12 is used for, and obtains the number for not decoding audio section corresponding to the first decoding audio section
N, the N are the integer more than or equal to 1;
The determining module 13 is used for, by broadcasting in non-decoded audio information queue, in first non-decoded audio information
The moment is put, be defined as the first decoding audio section first plays the moment;
The playing module 14 is used for, and moment broadcasting the first decoding audio section is played described first, described not solve
Corresponding one of a non-decoded audio information does not decode audio section in code audio-frequency information queue;
The removing module 15 is used for, and the non-decoded audio information of top n is deleted in the non-decoded audio information queue.
Audio playing apparatus shown in the embodiment of the present invention can perform the technical scheme shown in above method embodiment, its
Realization principle and beneficial effect are similar, are no longer repeated herein.
In a kind of possible embodiment, the decoder module 11 is specifically used for performing following steps:
Step A, in the non-decoded information queue, do not decode audio section corresponding to preceding m non-decoded audio informations and enter
Row decoding;
Step B, judge whether decoding succeeds;If so, then perform step C;If it is not, then perform step D;
Step C, the audio section that decoding obtains is defined as the first decoding audio section;
Step D, the value of the m is then added 1, and performs step A;
Wherein, when initial, the value of the m is 1.
Fig. 7 is the structural representation three of audio playing apparatus provided in an embodiment of the present invention.In the base of embodiment illustrated in fig. 6
On plinth, Fig. 7 is referred to, first acquisition module 12 includes acquiring unit 121 and determining unit 122, wherein,
The acquiring unit 121 is used for, and obtains the described first the first playing duration for decoding audio section and one does not decode
Second playing duration of audio section;
The determining unit 122 is used for, according to the ratio of first playing duration and second playing duration, it is determined that
The N.
In alternatively possible embodiment, the acquiring unit 121 is specifically used for:
Obtain the audio size, default audio sample digit, default audio track of the first decoding audio section
Several and default audio sample rate;
According to the audio size, the audio sample digit, the audio track number and the audio sample rate, really
Fixed first playing duration.
In alternatively possible embodiment, described device also includes memory module 16, wherein,
The memory module 16 is used for, and is obtained in first acquisition module 12 corresponding to the first decoding audio section not
After the number N for decoding audio section, the N is stored in the buffer.
In alternatively possible embodiment, described device also includes the second acquisition module 17 and the 3rd acquisition module
18, wherein,
Second acquisition module 17 is used for, and the N is obtained in the caching;
3rd acquisition module 18 is used for, and audio letter is not decoded according to top n in the non-decoded audio information queue
Breath, acquisition is N number of not to decode audio section;
The decoder module also 11 is used for, and N number of audio section that do not decode is decoded, obtains the second decoding audio
Section;
The determining module also 13 is used for, by non-decoded audio information queue, in first non-decoded audio information
The moment is played, be defined as the second decoding audio section second plays the moment;
The playing module 14 is additionally operable to, and moment broadcasting the second decoding audio section is played described second;
The removing module 15 is additionally operable to, and top n is deleted in the non-decoded audio information queue and does not decode audio letter
Breath.
Audio playing apparatus shown in the embodiment of the present invention can perform the technical scheme shown in above method embodiment, its
Realization principle and beneficial effect are similar, are no longer repeated herein.
One of ordinary skill in the art will appreciate that:Realizing all or part of step of above-mentioned each method embodiment can lead to
The related hardware of programmed instruction is crossed to complete.Foregoing program can be stored in a computer read/write memory medium.The journey
Sequence upon execution, execution the step of including above-mentioned each method embodiment;And foregoing storage medium includes:ROM, RAM, magnetic disc or
Person's CD etc. is various can be with the medium of store program codes.
Finally it should be noted that:Various embodiments above is only illustrating the technical scheme of the embodiment of the present invention, rather than to it
Limitation;Although the embodiment of the present invention is described in detail with reference to foregoing embodiments, one of ordinary skill in the art
It should be understood that:It can still modify to the technical scheme described in foregoing embodiments, either to which part or
All technical characteristic carries out equivalent substitution;And these modifications or replacement, the essence of appropriate technical solution is departed from this hair
The scope of bright embodiment scheme.
Claims (10)
- A kind of 1. audio frequency playing method, it is characterised in that including:At least one audio section that do not decode is decoded, obtains the first decoding audio section;The number N for not decoding audio section corresponding to the first decoding audio section is obtained, the N is the integer more than or equal to 1;By the broadcasting moment in non-decoded audio information queue, in first non-decoded audio information, it is defined as first solution The first of code audio section plays the moment, and plays moment broadcasting the first decoding audio section described first, described not decode Corresponding one of a non-decoded audio information does not decode audio section in audio-frequency information queue;The non-decoded audio information of top n is deleted in the non-decoded audio information queue.
- 2. according to the method for claim 1, it is characterised in that it is described that at least one audio section that do not decode is decoded, The first decoding audio section is obtained, including:Step A, in the non-decoded information queue, do not decode audio section corresponding to preceding m non-decoded audio informations and solve Code;Step B, judge whether decoding succeeds;If so, then perform step C;If it is not, then perform step D;Step C, the audio section that decoding obtains is defined as the first decoding audio section;Step D, the value of the m is then added 1, and performs step A;Wherein, the initial value of the m is 1.
- 3. method according to claim 1 or 2, it is characterised in that obtain and do not solved corresponding to the first decoding audio section The number N of code audio section, including:Obtain the first playing duration and second playing duration for not decoding audio section of the first decoding audio section;According to the ratio of first playing duration and second playing duration, the N is determined.
- 4. according to the method for claim 3, it is characterised in that when obtaining the first broadcasting of the first decoding audio section It is long, including:Obtain the first decoding audio size of audio section, default audio sample digit, default audio track number and Default audio sample rate;According to the audio size, the audio sample digit, the audio track number and the audio sample rate, institute is determined State the first playing duration.
- 5. method according to claim 1 or 2, it is characterised in that obtain and do not solved corresponding to the first decoding audio section After the number N of code audio section, in addition to:The N is stored in the buffer.
- 6. according to the method for claim 5, it is characterised in that methods described also includes:The N is obtained in the caching;According to the non-decoded audio information of top n in the non-decoded audio information queue, acquisition is N number of not to decode audio section;N number of audio section that do not decode is decoded, obtains the second decoding audio section;By the broadcasting moment in non-decoded audio information queue, in first non-decoded audio information, it is defined as second solution The second of code audio section plays the moment, and plays moment broadcasting the second decoding audio section described second;The non-decoded audio information of top n is deleted in the non-decoded audio information queue.
- 7. a kind of audio playing apparatus, it is characterised in that including decoder module, the first acquisition module, determining module, playing module And removing module, wherein,The decoder module is used for, and at least one audio section that do not decode is decoded, obtains the first decoding audio section;First acquisition module is used for, and obtains the number N for not decoding audio section corresponding to the first decoding audio section, described N is the integer more than or equal to 1;The determining module is used for, by the broadcasting moment in non-decoded audio information queue, in first non-decoded audio information, Be defined as the first decoding audio section first plays the moment;The playing module is used for, and moment broadcasting the first decoding audio section is played described first, described not decode audio Corresponding one of a non-decoded audio information does not decode audio section in message queue;The removing module is used for, and the non-decoded audio information of top n is deleted in the non-decoded audio information queue.
- 8. device according to claim 7, it is characterised in that the decoder module is specifically used for performing following steps:Step A, in the non-decoded information queue, do not decode audio section corresponding to preceding m non-decoded audio informations and solve Code;Step B, judge whether decoding succeeds;If so, then perform step C;If it is not, then perform step D;Step C, the audio section that decoding obtains is defined as the first decoding audio section;Step D, the value of the m is then added 1, and performs step A;Wherein, when initial, the value of the m is 1.
- 9. the device according to claim 7 or 8, it is characterised in that first acquisition module is including acquiring unit and really Order member, wherein,The acquiring unit is used for, and obtains the described first the first playing duration for decoding audio section and one does not decode audio section The second playing duration;The determining unit is used for, and according to the ratio of first playing duration and second playing duration, determines the N.
- 10. device according to claim 9, it is characterised in that the acquiring unit is specifically used for:Obtain the first decoding audio size of audio section, default audio sample digit, default audio track number and Default audio sample rate;According to the audio size, the audio sample digit, the audio track number and the audio sample rate, institute is determined State the first playing duration.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710595666.XA CN107342098B (en) | 2017-07-20 | 2017-07-20 | Audio frequency playing method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710595666.XA CN107342098B (en) | 2017-07-20 | 2017-07-20 | Audio frequency playing method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107342098A true CN107342098A (en) | 2017-11-10 |
CN107342098B CN107342098B (en) | 2019-11-26 |
Family
ID=60217437
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710595666.XA Active CN107342098B (en) | 2017-07-20 | 2017-07-20 | Audio frequency playing method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107342098B (en) |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20050265689A1 (en) * | 2004-05-25 | 2005-12-01 | Masanao Yoshida | Content recording/reproducing apparatus |
CN103065641A (en) * | 2013-02-01 | 2013-04-24 | 飞天诚信科技股份有限公司 | Method for analyzing audio data |
CN103931204A (en) * | 2011-10-05 | 2014-07-16 | 高通股份有限公司 | Network streaming of media data |
CN104505109A (en) * | 2014-12-29 | 2015-04-08 | 珠海全志科技股份有限公司 | Audio track switching method and system of multimedia player and corresponding player and equipment |
CN105187897A (en) * | 2015-09-09 | 2015-12-23 | 北京暴风科技股份有限公司 | Multi-segment media file cross-segment playing method and system |
CN105744334A (en) * | 2016-02-18 | 2016-07-06 | 海信集团有限公司 | Method and equipment for audio and video synchronization and synchronous playing |
CN105915493A (en) * | 2015-12-03 | 2016-08-31 | 乐视致新电子科技(天津)有限公司 | Audio and video real-time transmission method and device and audio and video real-time playing method and device |
CN106921885A (en) * | 2017-03-02 | 2017-07-04 | 深圳创维数字技术有限公司 | The switching player method and device of a kind of multimedia data stream |
-
2017
- 2017-07-20 CN CN201710595666.XA patent/CN107342098B/en active Active
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20050265689A1 (en) * | 2004-05-25 | 2005-12-01 | Masanao Yoshida | Content recording/reproducing apparatus |
CN103931204A (en) * | 2011-10-05 | 2014-07-16 | 高通股份有限公司 | Network streaming of media data |
CN103065641A (en) * | 2013-02-01 | 2013-04-24 | 飞天诚信科技股份有限公司 | Method for analyzing audio data |
CN104505109A (en) * | 2014-12-29 | 2015-04-08 | 珠海全志科技股份有限公司 | Audio track switching method and system of multimedia player and corresponding player and equipment |
CN105187897A (en) * | 2015-09-09 | 2015-12-23 | 北京暴风科技股份有限公司 | Multi-segment media file cross-segment playing method and system |
CN105915493A (en) * | 2015-12-03 | 2016-08-31 | 乐视致新电子科技(天津)有限公司 | Audio and video real-time transmission method and device and audio and video real-time playing method and device |
CN105744334A (en) * | 2016-02-18 | 2016-07-06 | 海信集团有限公司 | Method and equipment for audio and video synchronization and synchronous playing |
CN106921885A (en) * | 2017-03-02 | 2017-07-04 | 深圳创维数字技术有限公司 | The switching player method and device of a kind of multimedia data stream |
Also Published As
Publication number | Publication date |
---|---|
CN107342098B (en) | 2019-11-26 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9973793B2 (en) | Method and apparatus for processing video image | |
WO2017148442A1 (en) | Audio and video processing method and apparatus, and computer storage medium | |
CN104902145B (en) | A kind of player method and device of live stream video | |
CN103747366B (en) | A kind of display methods and player of HLS playback of media files progress | |
CN107517400A (en) | Flow media playing method and DST PLAYER | |
CN104464743B (en) | Method for playing background music in voice chat room and mobile terminal | |
CN112104909A (en) | Interactive video playing method and device, computer equipment and readable storage medium | |
CN110944123A (en) | Intelligent guide method for sports events | |
CN102364905A (en) | Data representation method and apparatus, and mobile terminal | |
CN105872755A (en) | Video playing method and device | |
CN108174280A (en) | A kind of online playback method of audio and video and system | |
CN105898555A (en) | Audio abnormity positioning method and device | |
CN106210927A (en) | A kind of track switching method and apparatus | |
CN102737681B (en) | Performance testing method and device of stream media player | |
CN107454447A (en) | A kind of plug-in loading method of player, device and television set | |
CN105872827A (en) | Live broadcast method and device of application interface in mobile terminal | |
CN106385525A (en) | Video play method and device | |
CN107872724A (en) | A kind of preview video generation method and device | |
CN104104901B (en) | A kind of data playing method and device | |
CN107342098B (en) | Audio frequency playing method and device | |
CN107426600A (en) | Switch the player method and device of track and captions rail | |
CN107863112A (en) | A kind of audio acquisition methods and device | |
CN112203108A (en) | Method and equipment for identifying and switching to live video stream according to short video stream | |
EP2177023B1 (en) | Method and apparatus for generating and accessing metadata in media file format | |
CN106792219B (en) | It is a kind of that the method and device reviewed is broadcast live |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CP01 | Change in the name or title of a patent holder |
Address after: 266555 Qingdao economic and Technological Development Zone, Shandong, Hong Kong Road, No. 218 Patentee after: Hisense Video Technology Co., Ltd Address before: 266555 Qingdao economic and Technological Development Zone, Shandong, Hong Kong Road, No. 218 Patentee before: HISENSE ELECTRIC Co.,Ltd. |
|
CP01 | Change in the name or title of a patent holder |