CN107342098B - Audio frequency playing method and device - Google Patents

Audio frequency playing method and device Download PDF

Info

Publication number
CN107342098B
CN107342098B CN201710595666.XA CN201710595666A CN107342098B CN 107342098 B CN107342098 B CN 107342098B CN 201710595666 A CN201710595666 A CN 201710595666A CN 107342098 B CN107342098 B CN 107342098B
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.)
Active
Application number
CN201710595666.XA
Other languages
Chinese (zh)
Other versions
CN107342098A (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.)
Hisense Visual Technology 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 CN201710595666.XA priority Critical patent/CN107342098B/en
Publication of CN107342098A publication Critical patent/CN107342098A/en
Application granted granted Critical
Publication of CN107342098B publication Critical patent/CN107342098B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11BINFORMATION STORAGE BASED ON RELATIVE MOVEMENT BETWEEN RECORD CARRIER AND TRANSDUCER
    • G11B20/00Signal processing not specific to the method of recording or reproducing; Circuits therefor
    • G11B20/10Digital recording or reproducing
    • G11B20/10009Improvement or modification of read or write signals
    • G11B20/10018Improvement or modification of read or write signals analog processing for digital recording or reproduction
    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS OR SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING; SPEECH OR AUDIO CODING OR DECODING
    • G10L19/00Speech 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/04Speech 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/16Vocoder architecture

Abstract

The embodiment of the present invention provides a kind of audio frequency playing method and device, is decoded this method comprises: not decoding audio section at least one, obtains the first decoding audio section;Obtaining corresponding the number N, the N for not decoding audio section of the first decoding audio section is the integer more than or equal to 1;By the playing time in non-decoded audio information queue, in first non-decoded audio information, it is determined as the first playing time of the first decoding audio section, and the first decoding audio section is played in first playing time, one non-decoded audio information corresponding one 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

Audio frequency playing method and device
Technical field
The present embodiments relate to audio signal processing technique field more particularly to a kind of audio frequency playing methods and device.
Background technique
It before playing out audio, needs to be decoded audio, and decoded audio is played out.It does not solve Code audio file is usually made of multiple audio sections that do not decode, each does not decode the usual phase of the corresponding playing duration of audio section Together, each does not decode the corresponding non-decoded audio information of audio section, generally includes this in non-decoded audio information and does not decode Audio section position in memory, this do not decode playing time and playing duration of audio section etc..
Before audio broadcasting, according to the playing time for not decoding audio section, playing time is not decoded by front portion The corresponding non-decoded audio information of audio section is stored into non-decoded audio information queue, wherein play time is more forward not The corresponding non-decoded audio information of audio section is decoded closer to the head of the queue of queue.In the prior art, audio will not usually be decoded 1 is set as with the number ratio of decoding audio, that is, one does not decode the corresponding decoding audio of audio;Correspondingly, being broadcast in audio During putting, first the corresponding audio section that do not decode of first non-decoded audio information in non-decoded audio information queue is solved Code obtains decoding audio section, then, when obtaining the broadcasting in non-decoded audio information queue in first non-decoded audio information It carves, and decoding audio section is played out in the playing time, meanwhile, terminal device is not solving according to preset number ratio 1 The 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, needing multiple audio sections that do not decode that could decode It to a decoding audio section, is not decoded after audio section obtains a decoding audio section according to multiple, terminal device still root According to preset number ratio 1, the 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 decodes to obtain a decoding audio section next time, first is not solved in non-decoded audio information queue The actual play moment of the playing time and decoded audio information that acquire in code audio-frequency information is not inconsistent, so that audio broadcasting is different Often, audio is caused to play reliability poor.
Summary 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, comprising:
It does not decode audio section at least one to be decoded, obtains the first decoding audio section;
Obtaining corresponding the number N, the N for not decoding audio section of the first decoding audio section is more than or equal to 1 Integer;
By the playing time in non-decoded audio information queue, in first non-decoded audio information, it is determined as described One decoding audio section the first playing time, and first playing time play it is described first decoding audio section, it is described not One non-decoded audio information corresponding one 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.
In a kind of possible embodiment, the audio section that do not decode at least one is decoded, and obtains the first solution Code audio section, comprising:
Step A, in the non-decoded information queue, preceding m non-decoded audio informations it is corresponding do not decode audio section into Row decoding;
Step B, judge whether decoding succeeds;If so, thening follow the steps C;If it is not, thening follow the steps D;
Step C, the audio section that decoding obtains is determined as the first decoding audio section;
Step D, the value of the m is then added 1, and executes step A;
Wherein, the initial value of the m is 1.
In alternatively possible embodiment, corresponding for not decoding audio section of the first decoding audio section is obtained Number N, comprising:
Obtain it is described first decoding audio section the first playing duration and one do not decode audio section second play when 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, comprising:
Obtain audio size, the preset audio sample digit, preset audio track of the first decoding audio section Several and preset 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, corresponding for not decoding audio section of the first decoding audio section is obtained After number N, further includes:
The N is stored in the buffer.
In alternatively possible embodiment, the method 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, the second decoding audio section is obtained;
By the playing time in non-decoded audio information queue, in first non-decoded audio information, it is determined as described Second playing time of two decoding audio sections, and the second decoding audio section is played in second playing time;
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, first obtain module, Determining module, playing module and removing module, wherein
The decoder module is used for, and is not decoded audio section at least one and is decoded, and the first decoding audio section is obtained;
The first acquisition module is used for, and obtains the corresponding number N for not decoding audio section of 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 is determined as the first playing time of the first decoding audio section;
The playing module is used for, and plays the first decoding audio section in first playing time, described not decode One non-decoded audio information corresponding one 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 executing following steps:
Step A, in the non-decoded information queue, preceding m non-decoded audio informations it is corresponding do not decode audio section into Row decoding;
Step B, judge whether decoding succeeds;If so, thening follow the steps C;If it is not, thening follow the steps D;
Step C, the audio section that decoding obtains is determined as the first decoding audio section;
Step D, the value of the m is then added 1, and executes step A;
Wherein, the initial value of the m is 1.
In alternatively possible embodiment, the first acquisition module includes acquiring unit and determination unit, wherein
The acquiring unit is used for, and acquisition described first decodes the first playing duration of audio section and one does not decode sound Second playing duration of frequency range;
The determination 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 audio size, the preset audio sample digit, preset audio track of the first decoding audio section Several and preset 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 further includes memory module, wherein
The memory module is used for, and obtaining first decoding in the first acquisition module, audio section is corresponding does not decode After the number N of audio section, the N is stored in the buffer.
In alternatively possible embodiment, described device further includes that the second acquisition module and third obtain module, In,
The second acquisition module is used for, and the N is obtained in the caching;
The third obtains module and is used for, according to the non-decoded audio information of top n in the non-decoded audio information queue, It obtains and N number of does not decode audio section;
The decoder module is also used to, and is decoded to N number of audio section that do not decode, is obtained the second decoding audio section;
The determining module is also used to, by broadcasting in non-decoded audio information queue, in first non-decoded audio information The moment is put, the second playing time of the second decoding audio section is determined as;
The playing module is also used to, and plays the second decoding audio section in second playing time;
The removing module is also used 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 are not decoding according at least one audio section To after the first decoding audio section, the corresponding number N for not decoding audio section of the first decoding audio section is obtained, and first is decoded When first playing time of audio section is determined as the broadcasting in non-decoded audio information queue in first non-decoded audio information It carves, and plays the first decoding audio section in first playing time, since first does not decode in non-decoded audio information queue Playing time in audio-frequency information is N number of playing time not decoded in audio section earliest, thereby it can be assured that the The playing time 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 be 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, in this way, can make the non-decoded audio information for being located at head of the queue in current non-decoded audio information queue under In secondary decoding process, need the playing time that is decoded it is earliest not decode audio section corresponding, and then can guarantee determining It is correct that the playing time of obtained decoding audio section is decoded to next time.And so on, it can be ensured that each decoding audio The playing time of section is correct, and then abnormal problem can be played to avoid audio, and then improve the reliability of audio broadcasting.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is this hair Bright some embodiments for those of ordinary skill in the art without any creative labor, can be with It obtains other drawings based on these 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 flow diagram one of audio frequency playing method provided in an embodiment of the present invention;
Fig. 3 is the flow diagram two of audio frequency playing method provided in an embodiment of the present invention;
Fig. 4 is the corresponding relationship provided in an embodiment of the present invention for not decoding audio section and non-decoded audio information;
Fig. 5 is the structural schematic diagram one of audio playing apparatus provided in an embodiment of the present invention;
Fig. 6 is the structural schematic diagram two of audio playing apparatus provided in an embodiment of the present invention;
Fig. 7 is the structural schematic diagram three of audio playing apparatus provided in an embodiment of the present invention.
Specific embodiment
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with the embodiment of the present invention In attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is A part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art Every other embodiment obtained without making creative work, shall fall within the protection scope of the present invention.
Fig. 1 is the application scenarios schematic diagram of audio frequency playing method provided in an embodiment of the present invention.Referring to Figure 1, terminal is set Standby can be the equipment such as mobile phone, computer, TV, and terminal device can be decoded audio, and play out to audio.It please join See Fig. 1, does not decode audio and stored in the form of not decoding audio section in terminal device, for example, not decoding in audio section each It may include the audio sample frame of predetermined number, optionally, do not decode the number for the audio sample frame for including in audio section each Can be identical, correspondingly, the playing duration for not decoding audio section each is also identical.Each, which does not decode audio section, has its corresponding Non- decoded audio information includes the attribute information for not decoding audio section in non-decoded audio information, for example, non-decoded audio information In include do not decode audio section address in memory, the playing time that does not decode audio, the playing duration for not decoding audio section Etc. information.
When needing to carry out audio broadcasting, is created in terminal device and do not decode the corresponding non-decoded audio information team of audio Column, and according to the playing time for not decoding audio section, and by playing time earlier part do not decode audio section do not decode sound Frequency information is stored to non-decoded audio information queue, wherein does not decode audio positioned at the non-decoded audio information of head of the queue is corresponding The playing time of section is earliest.For example, referring to Figure 1, it is assumed that at most can store 4 in non-decoded audio information queue and do not decode Audio-frequency information, the playing time for not decoding audio section 1 is 0ms, does not decode the corresponding non-decoded audio information 1 of audio section 1 In the head of the queue of non-decoded audio information queue, the playing time for not decoding audio section 2 is 10ms, and it is corresponding not decode audio section 2 Non- decoded audio information 2 be located at the second of non-decoded audio information queue, and so on, non-decoded audio information 3 is located at Third position, non-decoded audio information 4 are located at the 4th.
When carrying out audio broadcasting, first according to non-decoded audio information 1 in non-decoded audio information queue, acquisition is not decoded Audio section 1, and be decoded according to tonal range 1 is not decoded, if 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 obtaining decoding tonal range 1 according to not decoding audio section 1 and not decoding the decoding of audio section 2, and head of the queue will be located at not Playing time (0ms) in decoded audio information 1 is determined as decoding the playing time of audio section 1, and in 0ms broadcast decoder Audio section 1, meanwhile, terminal device also determines the corresponding number (2) for not decoding audio section of decoding audio section 1, 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.
Since the playing time of decoding audio section is not decode audio letter positioned at head of the queue in non-decoded audio information queue Playing time in breath, therefore, in order to guarantee that the playing time for decoding tonal range is correctly, then to need to guarantee 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, a decoding audio is being determined After the playing time of section, calculate that the decoding audio section is corresponding not to decode audio section number, 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, in this way, May insure next decoding audio section playing time be correctly, and so on, can determine in audio that each is decoded The playing time of audio section be it is correct, abnormal problem can be played to avoid audio, and then improve the reliable of audio broadcasting Property.
In the following, technical solution shown in the application is described in detail by specific embodiment.It should be noted that Several specific embodiments can be combined with each other below, for the same or similar content, no longer carry out in various embodiments It repeats.
Fig. 2 is the flow diagram one of audio frequency playing method provided in an embodiment of the present invention.Fig. 2 is referred to, this method can To include:
S201, it does not decode audio section at least one and is decoded, obtain the first decoding audio section.
The executing subject 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 by software realization, alternatively, audio playing apparatus can also by software and Hardware is implemented in combination with.
For different audio files, since the coding mode of audio is different, accordingly, it may be desirable to which one does not decode audio Section can decode 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 Audio file generallys use a kind of coding mode, and therefore, for the same audio file, decoding obtains a decoding audio section institute The number for not decoding audio section needed is usually fixed.
When terminal device needs to play out audio file, according to the playing time for not decoding audio section, will preset A several corresponding non-decoded audio informations of audio section that do not decode are stored in non-decoded audio information queue, further, when It, 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 It is middle to increase new non-decoded audio information, to guarantee simultaneously to may include that predetermined number does not solve in non-decoded audio information queue Code audio-frequency information.For example, the predetermined number can be 4,6,8 etc., it, can be according to actual needs during actually answering The predetermined number is set, and the present invention is not especially limit this.
In terminal device for the first time to when not decoding audio section and being decoded, terminal device, which is not known, to be needed in audio file Want several audio sections that do not decode that can 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 does not decode audio section at least one and is decoded, and obtains the first decoding audio section:
To in non-decoded information queue, preceding m corresponding audio sections that do not decode of non-decoded audio information are decoded;If solution Code success, then be determined as the first decoding audio section for the audio section that decoding obtains;If decoding failure, m is added 1, and to not solving In code message queue, preceding m+1 corresponding audio sections that do not decode of non-decoded audio information be decoded, until successfully decoded;Its In, when initial, m 1.
Specifically, first to the first corresponding one of non-decoded audio information in non-decoded information queue sound can not decoded Frequency range is decoded, and judge whether can successfully decoded, if it is not, then not decoding audio to the first two in non-decoded information queue Information corresponding two do not decode audio section and are decoded, and judge whether can successfully decoded, if also unsuccessful, to not solving The non-decoded audio information of first three in code message queue corresponding three do not decode audio section and are decoded, and so on, until Successfully decoded, alternatively, determining decoding failure when m+1 is greater than preset threshold.
The corresponding number N, N for not decoding audio section of S202, acquisition the first decoding audio section is whole more than or equal to 1 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 determines N according to the first playing duration and the second playing duration.
Optionally, the first playing duration can be determined by following feasible implementation: obtains the first decoding audio section Audio size, preset audio sample digit, preset audio track number and preset 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, can determine the first playing duration d by following formula 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 , the unit of s can be byte, and the unit of b can be byte, and the unit of r 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 are as follows:Second.
Optionally, it does not decode when generally including not decode the broadcasting of audio section in the corresponding non-decoded audio information of audio section It is long, correspondingly, the second playing duration can be obtained in not decoding the corresponding non-decoded audio information of audio section.
Optionally, the ratio of the first playing duration and the second playing duration can be first obtained, it, can if the ratio is integer The ratio is directly determined as N, if the ratio is non-integer, which 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 rounding up to 1.98 Determining N is 2;Assuming that the ratio of the first playing duration and the second playing duration is 2.11, then it, can after rounding up to 2.11 To determine N for 2.
It should be noted that can also be decoded according to other feasible implementations acquisitions first, audio section is corresponding not to be solved The number N of code audio section, the present invention is not especially limit this.For example, terminal device is directly united when executing S201 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 playing time in non-decoded audio information queue, in first non-decoded audio information, be determined as First playing time of one decoding audio section, and the first decoding audio section is played in the first playing time.
After decoding obtains the first decoding audio section, first is obtained in non-decoded audio information queue and does not decode sound Frequency information, and by the playing time in first non-decoded audio information be determined as the first decoding audio section first play when It carves, and plays the first decoding audio section in the first playing time.
It should be noted that S202 and S203 can be executed sequentially, can also execute parallel;When S202 and S203 sequence is held When row, S203 can also be first carried out, then execute S202.The embodiment of the present invention does not limit the execution sequence of S202 and S203 specifically It is fixed.
S204, the non-decoded audio information of top n is deleted in non-decoded audio information queue.
After determination obtains the first playing time of the first decoding audio section, deleted in non-decoded audio information queue The non-decoded audio information of top n.Correspondingly, being located at the non-decoded audio information of non-decoded audio information queue back to not decoding The Head-of-line of audio-frequency information is mobile.It optionally, can also be in the tail of the queue of non-decoded audio information queue increase not decoding newly Audio-frequency information.It should be noted that the process that the position to non-decoded audio information is mobile, may refer to 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, what next decoding obtained The playing time for decoding audio section should not decode the playing time of audio section for N+1.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 Playing time in frequency information is therefore the N+1 playing times for not decoding audio section may insure according to the above method The playing time of each decoding audio section is correct.
It should be noted that needing repeatedly to be decoded for same audio file, carried out for the first time to audio file When decoding, the corresponding number N for not decoding audio section of decoding audio section can be determined by method shown in Fig. 2 embodiment, and Carry out audio broadcasting.Due in the same audio file, a corresponding number for not decoding audio section of decoding audio section it is usual To be fixed, therefore, determined when first time carrying out audio decoder and obtain corresponding for not decoding audio section of decoding audio section After number N, number N can be cached, when carrying out follow audio decoding, directly obtains number N in the buffer, this Sample, can be improved the efficiency of audio decoder, and then the smooth degree of audio broadcasting can be improved.
Audio frequency playing method provided in an embodiment of the present invention decodes to obtain first not decoding audio section according at least one After decoding audio section, the corresponding number N for not decoding audio section of the first decoding audio section is obtained, and decode audio section for first The first playing time be determined as the playing time in non-decoded audio information queue in first non-decoded audio information, and First playing time plays the first decoding audio section, due to first non-decoded audio information in non-decoded audio information queue In playing time be that at least one does not decode in audio section an earliest playing time, thereby it can be assured that the first solution The playing time of code audio section is correct.Further, top n is deleted also in non-decoded audio information queue do not decode sound Frequency information, the number for not decoding audio section being decoded in the number and last time decoding process of the non-decoded audio information of deletion It is identical, in this way, can make in non-decoded audio information queue positioned at the non-decoded audio information of head of the queue and next decoding process In, need the playing time that is decoded it is earliest not decode audio section corresponding, and then can guarantee that determination obtains next decoding The playing time of obtained decoding audio section is correct.And so on, it can be ensured that when the broadcasting of each decoding audio section It carves correctly, abnormal problem can be played to avoid audio, and then improve the reliability that audio plays.
On the basis of embodiment shown in Fig. 2, optionally, in the decoding of acquisition first, audio section is corresponding does not decode audio section Number N after, N can also be stored in the buffer.Correspondingly, decoding for next time, following feasible realization side can be passed through Formula is decoded and audio plays: obtaining N 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, the second decoding audio section is obtained;It will not decode Playing time in audio-frequency information queue, in first non-decoded audio information, be determined as the second decoding audio section second are broadcast It puts the moment, and plays the second decoding audio section in the second playing time;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, in the following, in conjunction with Fig. 4, by 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 flow diagram two of audio frequency playing method provided in an embodiment of the present invention.Fig. 4 mentions for the embodiment of the present invention The corresponding relationship for not decoding audio section and non-decoded audio information supplied.Fig. 3-Fig. 4 is referred to, this method may include:
S301, audio section 1, and root are not decoded according to the acquisition of non-decoded audio information 1 in non-decoded audio information queue It is decoded according to audio section 1 is not decoded.
401 in Fig. 4 are referred to, audio file to be played is made of multiple audio sections that do not decode, each is not decoded The playing duration of audio section is all the same, each does not decode the corresponding non-decoded audio information of audio section, does not decode audio letter It include corresponding not decoding audio section address in memory, not decoding the playing time of audio section and do not decode audio section in breath Playing duration etc. (full content for including in incomplete non-decoded audio information in figure).Sound is not decoded in the embodiment of the present invention Store up to four non-decoded audio informations simultaneously in frequency message queue, wherein playing time 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, includes not decoding audio letter in non-decoded audio information queue Cease the non-decoded audio information 4 of 1-, 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 the address of audio section 1 in memory in non-decoded audio information 1, it can be according to the ground Location obtains do not decode audio section 1 in memory.
After S302, judgement be not according to the decoding failure of audio section 1 is decoded, according to not solving in non-decoded audio information queue The code acquisition of audio-frequency information 2 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 the address of audio section 3 in memory in non-decoded audio information 2, it can be according to the ground Location obtains do not decode audio section 2 in memory.
S303, the first playing duration for obtaining decoding audio section 1 and the second playing duration for not decoding audio section 1.
Optionally, it can determine that the first playing duration, the embodiment of the present invention are no longer repeated by above-mentioned formula one.
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, determine decoding audio section 1 be corresponding and do not decode audio section Number N be 2.
S305, store in the buffer number N be 2.
S306, the playing time (0ms) in non-decoded audio information queue, in non-decoded audio information 1 is determined as The playing time of audio section 1 is decoded, and in 0ms broadcast decoder audio section 1.
Pass through S301-S306, it can be ensured that the playing time of decoding audio section 1 is correct.
S307, preceding 2 non-decoded audio information (non-1 Hes of decoded audio information are deleted in non-decoded audio information queue Non- decoded audio information 2).
Optionally, preceding 2 non-decoded audio information (non-decoded audio informations 1 are 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, that is, Fill into non-decoded audio information 5 and non-decoded audio information 6.
402 in Fig. 4 are referred to, include that non-decoded audio information 3- does not decode audio letter in non-decoded audio information queue 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, acquisition N is 2 in the buffer.
S309, according to 2 non-decoded audio informations preceding in non-decoded audio information queue (non-decoded audio information 3 and not Decoded audio information 4), it obtains 2 and does not decode audio section (do not decode audio section 3 and do not decode audio section 4).
Specifically, not decoding audio section 3, root according to the acquisition of non-decoded audio information 3 in non-decoded audio information queue Audio section 4 is not decoded according to the acquisition of non-decoded audio information 4 in non-decoded audio information queue.
S310, to do not decode audio section 3 and do not decode audio section 4 decode, obtain decoding audio section 2.
S311, the playing time (20ms) in non-decoded audio information queue, in non-decoded audio information 3 is determined as The playing time of audio section 2 is decoded, and in 20ms broadcast decoder audio section 2.
Pass through S301-S311, it can be ensured that the playing time of decoding audio section 2 is correct.
S312, preceding 2 non-decoded audio information (non-3 Hes of decoded audio information are deleted in non-decoded audio information queue Non- decoded audio information 4).
Optionally, preceding 2 non-decoded audio information (non-decoded audio informations 3 are 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, that is, Fill into non-decoded audio information 7 and non-decoded audio information 8.
403 in Fig. 4 are referred to, include that non-decoded audio information 5- does not decode audio letter in non-decoded audio information queue 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 may refer to S305-S312 for the decoding after second, playing process, the present invention is real Example is applied no longer to be repeated.
In above process, can determine each time decode audio section playing time be correctly, can be to avoid sound Frequency plays abnormal problem, and then improves the reliability that audio plays.
On the basis of any one above-mentioned embodiment, optionally, audio playing apparatus may include multiple plug-in units, and by Multiple plug-in units realize technical solution shown in above method embodiment jointly.In the following, including to audio playing apparatus by Fig. 5 Plug-in unit be described in detail.
Fig. 5 is the structural schematic diagram 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 frame 502, audio decoder plug-in unit 503 and audio player plug-in 504, wherein it is equal to be somebody's turn to do any one plug-in unit Software and or hardware realization can be passed through.
Demultiplexing plug-in unit 501 for generate each in audio file do not decode audio section it is corresponding do not decode audio letter Breath.Demultiplexing plug-in unit 501 is also used 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 frame 502.
Audio frame 502 is for safeguarding non-decoded audio information queue, for example, deleting in non-decoded audio information queue The non-decoded audio information for needing to delete increases the non-decoded audio information needed 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 It does not decode audio section to be decoded, after 503 pairs of audio decoder plug-in unit decodings obtain a decoding audio section, audio decoder is inserted Part 503 sends a notification message to audio frame 502, so that audio frame 502 is deleted accordingly in non-decoded audio information queue Non- decoded audio information, audio frame 502 is also used to determine the playing time of decoding audio section, and notification audio player plug-in 504 play out corresponding decoding audio section in corresponding playing time.
It should be noted that Fig. 5 only illustrates the plug-in unit and each plug-in unit that include in audio playing apparatus in exemplary fashion Function, certainly, in actual application, the plug-in unit that can include in audio playing apparatus determine according to actual needs and The function of each plug-in unit, the present invention is not especially limit this.
Fig. 6 is the structural schematic diagram two of audio playing apparatus provided in an embodiment of the present invention.Fig. 6 is referred to, which can To include that decoder module 11, first obtains module 12, determining module 13, playing module 14 and removing module 15, wherein
The decoder module 11 is used for, and is not decoded audio section at least one and is decoded, and the first decoding audio section is obtained;
The first acquisition module 12 is used for, and obtains the corresponding number for not decoding audio section of 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, the first playing time of the first decoding audio section is determined as;
The playing module 14 is used for, and plays the first decoding audio section in first playing time, described not solve One non-decoded audio information corresponding one 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 execute technical solution shown in above method embodiment, 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 executing following steps:
Step A, in the non-decoded information queue, preceding m non-decoded audio informations it is corresponding do not decode audio section into Row decoding;
Step B, judge whether decoding succeeds;If so, thening follow the steps C;If it is not, thening follow the steps D;
Step C, the audio section that decoding obtains is determined as the first decoding audio section;
Step D, the value of the m is then added 1, and executes step A;
Wherein, when initial, the value of the m is 1.
Fig. 7 is the structural schematic diagram three of audio playing apparatus provided in an embodiment of the present invention.The base of embodiment shown in Fig. 6 On plinth, Fig. 7 is referred to, described first, which obtains module 12, includes acquiring unit 121 and determination unit 122, wherein
The acquiring unit 121 is used for, and acquisition described first decodes the first playing duration of audio section and one does not decode Second playing duration of audio section;
The determination unit 122 is used for, and according to the ratio of first playing duration and second playing duration, is determined The N.
In alternatively possible embodiment, the acquiring unit 121 is specifically used for:
Obtain audio size, the preset audio sample digit, preset audio track of the first decoding audio section Several and preset 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 further includes memory module 16, wherein
The memory module 16 is used for, and it is corresponding not to obtain the first decoding audio section in the first acquisition module 12 After the number N for decoding audio section, the N is stored in the buffer.
In alternatively possible embodiment, described device further includes that the second acquisition module 17 and third obtain module 18, wherein
The second acquisition module 17 is used for, and the N is obtained in the caching;
The third obtains module 18 and is used for, and does not decode audio letter 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 is decoded to N number of audio section that do not decode, is obtained the second decoding audio Section;
The determining module also 13 is used for, will be in non-decoded audio information queue, in first non-decoded audio information Playing time is determined as the second playing time of the second decoding audio section;
The playing module 14 is also used to, and plays the second decoding audio section in second playing time;
The removing module 15 is also used 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 execute technical solution shown in above method embodiment, Realization principle and beneficial effect are similar, are no longer repeated herein.
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.
Finally, it should be noted that the above various embodiments is only to illustrate the technical solution of the embodiment of the present invention, rather than to it Limitation;Although the embodiment of the present invention is described in detail referring to foregoing embodiments, those skilled in the art It is understood that it is still possible to modify the technical solutions described in the foregoing embodiments, either to part of or All technical features are equivalently replaced;And these are modified or replaceed, it does not separate the essence of the corresponding technical solution this hair The range of bright example scheme.

Claims (10)

1. a kind of audio frequency playing method characterized by comprising
It does not decode audio section at least one to be decoded, obtains the first decoding audio section;
Obtaining corresponding the number N, the N for not decoding audio section of the first decoding audio section is the integer more than or equal to 1;
By the playing time in non-decoded audio information queue, in first non-decoded audio information, it is determined as first solution First playing time of code audio section, and the first decoding audio section is played in first playing time, it is described not decode One non-decoded audio information corresponding one 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. the method according to claim 1, wherein the audio section that do not decode at least one is decoded, Obtain the first decoding audio section, comprising:
Step A, in the non-decoded audio information queue, preceding m non-decoded audio informations it is corresponding do not decode audio section into Row decoding;
Step B, judge whether decoding succeeds;If so, thening follow the steps C;If it is not, thening follow the steps D;
Step C, the audio section that decoding obtains is determined as the first decoding audio section;
Step D, the value of the m is then added 1, and executes step A;
Wherein, the initial value of the m is 1.
3. method according to claim 1 or 2, which is characterized in that obtaining first decoding, audio section is corresponding does not solve The number N of code audio section, comprising:
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 described in claim 3, it is characterized in that, when obtaining the first broadcasting of the first decoding audio section It is long, comprising:
Obtain the first decoding audio size of audio section, preset audio sample digit, preset audio track number and Preset 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, which is characterized in that obtaining first decoding, audio section is corresponding does not solve After the number N of code audio section, further includes:
The N is stored in the buffer.
6. according to the method described in claim 5, it is characterized in that, the method 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, the second decoding audio section is obtained;
By the playing time in non-decoded audio information queue, in first non-decoded audio information, it is determined as second solution Second playing time of code audio section, and the second decoding audio section is played in second playing time;
The non-decoded audio information of top n is deleted in the non-decoded audio information queue.
7. a kind of audio playing apparatus, which is characterized in that obtain module, determining module, playing module including decoder module, first And removing module, wherein
The decoder module is used for, and is not decoded audio section at least one and is decoded, and the first decoding audio section is obtained;
The first acquisition module is used for, and obtains the corresponding number N for not decoding audio section of the first decoding audio section, described N is the integer more than or equal to 1;
The determining module is used for, by the playing time in non-decoded audio information queue, in first non-decoded audio information, It is determined as the first playing time of the first decoding audio section;
The playing module is used for, and plays the first decoding audio section in first playing time, described not decode audio One non-decoded audio information corresponding one 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, which is characterized in that the decoder module is specifically used for executing following steps:
Step A, in the non-decoded audio information queue, preceding m non-decoded audio informations it is corresponding do not decode audio section into Row decoding;
Step B, judge whether decoding succeeds;If so, thening follow the steps C;If it is not, thening follow the steps D;
Step C, the audio section that decoding obtains is determined as the first decoding audio section;
Step D, the value of the m is then added 1, and executes step A;
Wherein, when initial, the value of the m is 1.
9. device according to claim 7 or 8, which is characterized in that it is described first acquisition module include acquiring unit and really Order member, wherein
The acquiring unit is used for, and acquisition described first decodes the first playing duration of audio section and one does not decode audio section The second playing duration;
The determination 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, which is characterized in that the acquiring unit is specifically used for:
Obtain the first decoding audio size of audio section, preset audio sample digit, preset audio track number and Preset 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.
CN201710595666.XA 2017-07-20 2017-07-20 Audio frequency playing method and device Active CN107342098B (en)

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 CN107342098A (en) 2017-11-10
CN107342098B true 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 (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4716675B2 (en) * 2004-05-25 2011-07-06 三洋電機株式会社 Recording / playback device

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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
CN107342098A (en) 2017-11-10

Similar Documents

Publication Publication Date Title
CN109246441B (en) Method, storage medium, device and system for automatically generating wonderful moment video
CN106559679B (en) The decoded method of video, server and mobile terminal
WO2017148442A1 (en) Audio and video processing method and apparatus, and computer storage medium
CN103747366B (en) A kind of display methods and player of HLS playback of media files progress
CN103517143A (en) Method, device and terminal device for playing network video
CN107484011B (en) Video resource decoding method and device
CN112104909A (en) Interactive video playing method and device, computer equipment and readable storage medium
CN104902145B (en) A kind of player method and device of live stream video
KR101769689B1 (en) Communication method, apparatus and system based on voiceprint
CN105872755A (en) Video playing method and device
WO2018000637A1 (en) Information transmission method, video playing device and video display device
CN104464743B (en) Method for playing background music in voice chat room and mobile terminal
CN109089128A (en) A kind of method for processing video frequency, device, equipment and medium
CN110944123A (en) Intelligent guide method for sports events
CN107517400A (en) Flow media playing method and DST PLAYER
CN108737874A (en) A kind of video broadcasting method and electronic equipment
CN106210927A (en) A kind of track switching method and apparatus
CN105025358A (en) Video playing method and device based on EPG
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
CN105578290A (en) EPG-based plan video dotting method and device
CN107342098B (en) Audio frequency playing method and device
CN106385525A (en) Video play method and device
CN107872724A (en) A kind of preview video generation method and device
CN106921886A (en) The multimedia data playing method and device of a kind of terminal

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