CN109903785A - Method and apparatus for buffered audio data - Google Patents

Method and apparatus for buffered audio data Download PDF

Info

Publication number
CN109903785A
CN109903785A CN201910194509.7A CN201910194509A CN109903785A CN 109903785 A CN109903785 A CN 109903785A CN 201910194509 A CN201910194509 A CN 201910194509A CN 109903785 A CN109903785 A CN 109903785A
Authority
CN
China
Prior art keywords
range
caching
audio fragment
processed
item
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201910194509.7A
Other languages
Chinese (zh)
Other versions
CN109903785B (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.)
Douyin Vision Co Ltd
Douyin Vision Beijing Co Ltd
Original Assignee
Beijing ByteDance Network Technology 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 Beijing ByteDance Network Technology Co Ltd filed Critical Beijing ByteDance Network Technology Co Ltd
Priority to CN201910194509.7A priority Critical patent/CN109903785B/en
Publication of CN109903785A publication Critical patent/CN109903785A/en
Application granted granted Critical
Publication of CN109903785B publication Critical patent/CN109903785B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Signal Processing For Digital Recording And Reproducing (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

Embodiment of the disclosure discloses the method and apparatus for buffered audio data.One specific embodiment of this method includes: to obtain caching range set related with target audio fragment sequence in response to getting to buffered audio segment;If at least one of caching range set caching range has intersection with to the first caching range corresponding to buffered audio segment respectively, then a caching range is selected as the first item to be processed at least one caching range from this, using the first caching range as the second item to be processed, it executes following caching: based on the first item to be processed and the corresponding audio fragment of the second item to be processed, determining new audio fragment;Audio fragment corresponding with the first item to be processed in target audio fragment sequence is replaced with into new audio fragment.The embodiment realizes the Segment-based caching to audio data, and can save spatial cache.

Description

Method and apparatus for buffered audio data
Technical field
Embodiment of the disclosure is related to field of computer technology, and in particular to method and dress for buffered audio data It sets.
Background technique
Existing terminal device can have audio playing function.When user plays audio using terminal device, terminal is set It is standby that segmentation downloading can be carried out to the audio, and the audio fragment completed to downloading caches.
Currently, terminal device is usually that the audio fragment that downloading is completed directly is cached to specified storage location.
Summary of the invention
Embodiment of the disclosure proposes the method and apparatus for buffered audio data.
In a first aspect, embodiment of the disclosure provides a kind of method for buffered audio data, comprising: in response to obtaining It gets to buffered audio segment, obtains caching range set related with target audio fragment sequence, wherein to buffered audio piece The corresponding first caching range of section, the caching range cached in range set correspond to the audio fragment in target audio fragment sequence; If caching at least one of range set caching range has intersection with the first caching range respectively, at least one is slow from above-mentioned It deposits and selects a caching range in range as the first item to be processed, cache range as the second item to be processed for first, hold The following caching of row: based on the first item to be processed and the corresponding audio fragment of the second item to be processed, new audio piece is determined Section;Audio fragment corresponding with the first item to be processed in target audio fragment sequence is replaced with into new audio fragment.
In some embodiments, based on the first item to be processed and the corresponding audio fragment of the second item to be processed, really Before fixed new audio fragment, the above method further include: be based on the first item to be processed and the second item to be processed, determine new caching model It encloses;And based on the first item to be processed and the corresponding audio fragment of the second item to be processed, determine new audio fragment, comprising: Based on the first item to be processed and the corresponding audio fragment of the second item to be processed, determining new audio corresponding with range is newly cached Segment.
In some embodiments, it is replaced by audio fragment corresponding with the first item to be processed in target audio fragment sequence It is changed to after new audio fragment, the above method further include: if there is also unselected to delay at least one above-mentioned caching range Range is deposited, then chooses a caching range from unselected caching range, using the caching range as the first item to be processed, And new audio fragment is extracted from target audio fragment sequence, using new caching range corresponding to new audio fragment as second Item to be processed, continues to execute caching.
In some embodiments, it is replaced by audio fragment corresponding with the first item to be processed in target audio fragment sequence It is changed to after new audio fragment, the above method further include: if there is no unselected to delay at least one above-mentioned caching range Range is deposited, then terminates above-mentioned caching.
In some embodiments, it is based on the first item to be processed and the second item to be processed, determines new caching range, comprising: will Minimum starting point in the starting point of first item to be processed and the second item to be processed is determined as newly caching the starting point of range;By first wait locate The starting point of item and the summation of length are managed as the first value, using the summation of the starting point of the second item to be processed and length as second value, It is determined as the difference of maximum value and minimum starting point in the first value and second value newly to cache the length of range.
In some embodiments, the above method further include: if there is no have with the first caching range in caching range set The caching range of intersection, but the caching range there are starting point less than the starting point of the first caching range, it is determined that caching range set In first object caching range and the first caching range with the presence or absence of joining end to end situation, wherein first object caches range Starting point with first caching range starting point close on and less than first caching range starting point;If first object caches range and the There is the situation that joins end to end in one caching range, then splice audio fragment corresponding to first object caching range and to buffered audio Segment is obtained through spliced first audio fragment, will be corresponding with first object caching range in target audio fragment sequence Audio fragment replace with the first audio fragment.
In some embodiments, the above method further include: if first object caching range and the first caching range are not present Join end to end situation, then in target audio fragment sequence, first object caching range institute will be inserted into buffered audio segment First designated position of corresponding audio fragment.
In some embodiments, the above method further include: if there is no have with the first caching range in caching range set The caching range of intersection, but there are the caching ranges that starting point is greater than the starting point of the first caching range, it is determined that caching range set In the second target cache range and the first caching range with the presence or absence of joining end to end situation, wherein the second target cache range Starting point with first caching range starting point close on and be greater than first caching range starting point;If the second target cache range and There is the situation that joins end to end in one caching range, then splice audio fragment corresponding to the second target cache range and to buffered audio Segment is obtained through spliced second audio fragment, will be corresponding with the second target cache range in target audio fragment sequence Audio fragment replace with the second audio fragment.
In some embodiments, the above method further include: if the second target cache range and the first caching range are not present Join end to end situation, then in target audio fragment sequence, the second target cache range institute will be inserted into buffered audio segment Second designated position of corresponding audio fragment.
Second aspect, embodiment of the disclosure provide a kind of device for buffered audio data, which includes: to obtain Unit is taken, is configured in response to get to buffered audio segment, obtains caching model related with target audio fragment sequence Enclose set, wherein to the corresponding first caching range of buffered audio segment, the caching range cached in range set corresponds to target sound Audio fragment in frequency fragment sequence;Cache unit, if being configured to cache at least one of range set caching range point Not with first caching range have intersection, then from it is above-mentioned at least one caching range in select a caching range as first to Processing item executes following caching: based on the first item to be processed and second using the first caching range as the second item to be processed The corresponding audio fragment of item to be processed, determines new audio fragment;It will be to be processed with first in target audio fragment sequence The corresponding audio fragment of item replaces with new audio fragment.
In some embodiments, cache unit is further configured to: it is based on the first item to be processed and the second item to be processed, Determine new caching range;It is determining with new caching based on the first item to be processed and the corresponding audio fragment of the second item to be processed The corresponding new audio fragment of range.
In some embodiments, cache unit is still further configured to: by target audio fragment sequence with After the corresponding audio fragment of one item to be processed replaces with new audio fragment, if there is also not at least one above-mentioned caching range The caching range being selected then chooses a caching range from unselected caching range, using the caching range as the One item to be processed, and new audio fragment is extracted from target audio fragment sequence, by new caching corresponding to new audio fragment Range continues to execute above-mentioned caching as the second item to be processed.
In some embodiments, cache unit is still further configured to: by target audio fragment sequence with After the corresponding audio fragment of one item to be processed replaces with new audio fragment, if there is no not at least one above-mentioned caching range The caching range being selected, then terminate above-mentioned caching.
In some embodiments, cache unit is further configured to: by the first item to be processed and the second item to be processed Minimum starting point in starting point is determined as newly caching the starting point of range;Using the summation of the starting point of the first item to be processed and length as One value, using the summation of the starting point of the second item to be processed and length as second value, by the first value and second value maximum value with The difference of minimum starting point is determined as newly caching the length of range.
In some embodiments, above-mentioned apparatus further include: the first determination unit, if being configured to cache in range set not The caching range that range has intersection, but the caching model there are starting point less than the starting point of the first caching range are cached in the presence of with first It encloses, it is determined that first object caching range and the first caching range in caching range set whether there is the situation that joins end to end, Wherein, the starting point of the starting point of first object caching range and the first caching range closes on and less than the starting point of the first caching range; First cache unit splices if being configured to first object caching range and the first caching range in the presence of the situation that joins end to end First object caches audio fragment corresponding to range and to buffered audio segment, obtains through spliced first audio fragment, Audio fragment corresponding with first object caching range in target audio fragment sequence is replaced with into the first audio fragment.
In some embodiments, above-mentioned apparatus further include: the second cache unit, if being configured to first object caching range There is no the situations that joins end to end will be inserted into buffered audio segment then in target audio fragment sequence with the first caching range To the first designated position of audio fragment corresponding to first object caching range.
In some embodiments, above-mentioned apparatus further include: the second determination unit, if being configured to cache in range set not In the presence of the caching range for having intersection with the first caching range, but there are the caching models that starting point is greater than the starting point of the first caching range It encloses, it is determined that the second target cache range and the first caching range in caching range set whether there is the situation that joins end to end, Wherein, the starting point of the starting point of the second target cache range and the first caching range closes on and is greater than the starting point of the first caching range; Third cache unit splices if being configured to the second target cache range and the first caching range in the presence of the situation that joins end to end Audio fragment corresponding to second target cache range and to buffered audio segment, obtains through spliced second audio fragment, Audio fragment corresponding with the second target cache range in target audio fragment sequence is replaced with into the second audio fragment.
In some embodiments, above-mentioned apparatus further include: the 4th cache unit, if being configured to the second target cache range There is no the situations that joins end to end will be inserted into buffered audio segment then in target audio fragment sequence with the first caching range To the second designated position of audio fragment corresponding to the second target cache range.
The third aspect, embodiment of the disclosure provide a kind of electronic equipment, which includes: one or more places Manage device;Storage device is stored thereon with one or more programs;When the one or more program is by the one or more processors It executes, so that the one or more processors realize the method as described in implementation any in first aspect.
Fourth aspect, embodiment of the disclosure provide a kind of computer-readable medium, are stored thereon with computer program, The method as described in implementation any in first aspect is realized when the program is executed by processor.
The method and apparatus provided by the above embodiment for buffered audio data of the disclosure, by response to getting To buffered audio segment, caching range set related with target audio fragment sequence is obtained, wherein to buffered audio segment pair The first caching range is answered, the caching range cached in range set corresponds to the audio fragment in target audio fragment sequence, so as to When caching at least one of range set caching range has intersection with the first caching range respectively, from this, at least one is cached A caching range is selected in range as the first item to be processed to execute using the first caching range as the second item to be processed Following caching: based on the first item to be processed and the corresponding audio fragment of the second item to be processed, new audio fragment is determined; Audio fragment corresponding with the first item to be processed in target audio fragment sequence is replaced with into new audio fragment.The disclosure it is upper Stating embodiment realizes Segment-based caching to audio data.In addition, replacing target audio segment sequence by using new audio fragment Audio fragment corresponding with the first item to be processed in column, compared to the prior art directly will be to buffered audio fragment buffer to referring to Fixed storage location can save spatial cache.
Detailed description of the invention
By reading a detailed description of non-restrictive embodiments in the light of the attached drawings below, the disclosure is other Feature, objects and advantages will become more apparent upon:
Fig. 1 is that some embodiments of the present disclosure can be applied to exemplary system architecture figure therein;
Fig. 2 is the flow chart according to one embodiment of the method for buffered audio data of the disclosure;
Fig. 3 is the flow chart according to one embodiment of the method for buffered audio data of the disclosure;
Fig. 4 is the schematic diagram according to an application scenarios of the method for buffered audio data of the disclosure;
Fig. 5 is the flow chart according to another embodiment of the method for buffered audio data of the disclosure;
Fig. 6 is the flow chart according to the further embodiment of the method for buffered audio data of the disclosure;
Fig. 7 is the flow chart according to another embodiment of the method for buffered audio data of the disclosure;
Fig. 8 is the structural schematic diagram according to one embodiment of the device for buffered audio data of the disclosure;
Fig. 9 is adapted for the structural representation for the computer system for realizing the electronic equipment of some embodiments of the present disclosure Figure.
Specific embodiment
The disclosure is described in further detail with reference to the accompanying drawings and examples.It is understood that this place is retouched The specific embodiment stated is used only for explaining that correlation is open, rather than the restriction to the disclosure.It also should be noted that in order to Convenient for description, is illustrated only in attached drawing and disclose relevant part to related.
It should be noted that in the absence of conflict, the feature in embodiment and embodiment in the disclosure can phase Mutually combination.The disclosure is described in detail below with reference to the accompanying drawings and in conjunction with the embodiments.
Fig. 1 is shown can the method for buffered audio data using the disclosure or the dress for buffered audio data The exemplary system architecture 100 for the embodiment set.
As shown in Figure 1, system architecture 100 may include terminal device 101,102,103, network 104 and server 105. Network 104 between terminal device 101,102,103 and server 105 to provide the medium of communication link.Network 104 can be with Including various connection types, such as wired, wireless communication link or fiber optic cables etc..
User can be used terminal device 101,102,103 and be interacted by network 104 with server 105, to receive or send out Send message etc..Various telecommunication customer end applications, such as audio broadcast message class application can be installed on terminal device 101,102,103 Etc..
Terminal device 101,102,103 can be hardware, be also possible to software.When terminal device 101,102,103 is hard When part, it can be the various electronic equipments with display screen, including but not limited to smart phone, tablet computer etc..Work as end When end equipment 101 is software, it may be mounted in above-mentioned cited electronic equipment.Multiple softwares or software may be implemented into it Module (such as providing Distributed Services), also may be implemented into single software or software module.It is not specifically limited herein.
Server 105 can be to provide the server of various services, such as to playing on terminal device 101,102,103 Audio provides the background server supported.The background server can store the audio played on terminal device.It needs to illustrate , server can be hardware, is also possible to software.When server is hardware, multiple server compositions may be implemented into Distributed server cluster, individual server also may be implemented into.When server is software, multiple softwares may be implemented into Or software module (such as providing Distributed Services), single software or software module also may be implemented into.It does not do and has herein Body limits.
Terminal device 101,102,103 can be segmented down target audio (such as user currently playing audio) It carries, such as downloads the audio fragment of target audio from server 105, and the audio fragment that downloading is completed is as to buffered audio Segment executes corresponding caching.
It should be noted that the method for buffered audio data that some embodiments of the present disclosure provide is generally by terminal Equipment 101,102,103 executes, correspondingly, the device for buffered audio data be generally positioned at terminal device 101,102, In 103.
It should be understood that the number of terminal device, network and server in Fig. 1 is only schematical.According to realization need It wants, can have any number of terminal device, network and server.
With continued reference to Fig. 2, it illustrates according to one embodiment of the method for buffered audio data of the disclosure Process 200.This for buffered audio data method can be applied to terminal device (such as terminal device shown in FIG. 1 101, 102,103), comprising the following steps:
Step 201, in response to getting to buffered audio segment, caching model related with target audio fragment sequence is obtained Enclose set.
In the present embodiment, it can be the audio fragment in target audio to buffered audio segment.Target audio for example may be used To be the audio etc. of the currently used terminal device broadcasting of user.Terminal device can carry out segmentation downloading to target audio, such as From the respective audio segment of server (such as server 105 shown in FIG. 1) the downloading target audio connected, and will download At audio fragment be used as to buffered audio segment.Wherein, the first caching range can be corresponded to buffered audio segment.
It should be noted that the caching range in the disclosure may include starting point and length.Starting point can represent audio piece Play position of the section in the target audio belonged to.Length can represent the playout length of audio fragment.
In the present embodiment, terminal device is being got after buffered audio segment, available and target audio segment The related caching range set of sequence.Wherein, target audio fragment sequence can be the sound to be cached got with terminal device The associated sequence of the target audio that frequency segment is belonged to, the sequence may include one or more audio pieces of the target audio Section.Caching range in caching range set can correspond to the audio fragment in target audio fragment sequence.In addition, target audio Audio fragment in fragment sequence can be arranged according to the ascending sequence of the starting point of corresponding caching range.
In practice, target audio fragment sequence and caching range set conjunction be can store in terminal device.Specifically, target Audio fragment sequence can store in the caching of terminal device.Optionally, caching range set can store in terminal device Hard disk, in caching or memory.
Step 202, if at least one of caching range set caching range is respectively and to corresponding to buffered audio segment The first caching range have intersection, then to select a caching range to be processed as first from least one caching range , using the first caching range as the second item to be processed.
In the present embodiment, terminal device can traverse in caching range set after getting caching range set Range is cached, to determine in caching range set with the presence or absence of the caching range for having intersection with the first caching range.If caching model Enclose set at least one of caching range respectively with first caching range have intersection, then terminal device can from this at least one A caching range is selected in caching range as the first item to be processed, using the first caching range as the second item to be processed.
Here, terminal device can randomly select out a caching range as the from least one above-mentioned caching range One item to be processed.Optionally, terminal device can choose the smallest caching range of starting point from least one above-mentioned caching range As the first item to be processed.
Step 203, based on the first item to be processed and the corresponding audio fragment of the second item to be processed, new audio piece is determined Section.
In the present embodiment, terminal device can be based on the first item to be processed and the corresponding audio of the second item to be processed Segment determines new audio fragment.
As an example, the lap of item to be processed for first and the second item to be processed, terminal device can be from first It crops and is somebody's turn to do in any one of audio fragment corresponding to audio fragment corresponding to item to be processed and the second item to be processed The corresponding audio content of lap, obtains audio fragment after cropped.Then terminal device can according to starting point by it is small to Big sequence, to after cropped audio fragment and another audio fragment not being cut splice, and will be after splicing Audio fragment as new audio fragment.
Step 204, audio fragment corresponding with the first item to be processed in target audio fragment sequence is replaced with into new sound Frequency segment.
In the present embodiment, terminal device can be by sound corresponding with the first item to be processed in target audio fragment sequence Frequency segment replaces with new audio fragment.This way it is possible to avoid target audio segment sequence will be directly inserted into buffered audio segment In column, spatial cache can be effectively saved.
The method provided by the above embodiment of the disclosure, by response to getting to buffered audio segment, acquisition and mesh The related caching range set of mark with phonetic symbols frequency fragment sequence, wherein to the corresponding first caching range of buffered audio segment, cache range Caching range in set corresponds to the audio fragment in target audio fragment sequence, so as at least one in caching range set When a caching range has intersection with the first caching range respectively, a caching range is selected at least one caching range from this Following caching is executed: based on first wait locate using the first caching range as the second item to be processed as the first item to be processed Item and the corresponding audio fragment of the second item to be processed are managed, determines new audio fragment;By in target audio fragment sequence with The corresponding audio fragment of first item to be processed replaces with new audio fragment.The disclosure above example implements to audio data Segment-based caching.In addition, by using corresponding with the first item to be processed in new audio fragment replacement target audio fragment sequence Audio fragment, will can directly be saved slow to buffered audio fragment buffer to specified storage location compared to the prior art Deposit space.
With further reference to Fig. 3, it illustrates one embodiment according to the method for buffered audio data of the disclosure Process 300.The method for buffered audio data can be applied to terminal device (such as terminal device shown in FIG. 1 101,102,103), comprising the following steps:
Step 301, in response to getting to buffered audio segment, caching model related with target audio fragment sequence is obtained Enclose set.
In the present embodiment, it can be the audio fragment in target audio to buffered audio segment.Target audio for example may be used To be the audio etc. of the currently used terminal device broadcasting of user.Terminal device can carry out segmentation downloading to target audio, such as From the respective audio segment of server (such as server 105 shown in FIG. 1) the downloading target audio connected, and will download At audio fragment be used as to buffered audio segment.Wherein, the first caching range can be corresponded to buffered audio segment.
It should be noted that the caching range in the disclosure may include starting point and length.Starting point can represent audio piece Play position of the section in the target audio belonged to.Length can represent the playout length of audio fragment.
In the present embodiment, terminal device is being got after buffered audio segment, available and target audio segment The related caching range set of sequence.Wherein, target audio fragment sequence can be the sound to be cached got with terminal device The associated sequence of the target audio that frequency segment is belonged to, the sequence may include one or more audio pieces of the target audio Section.Caching range in caching range set can correspond to the audio fragment in target audio fragment sequence.In addition, target audio Audio fragment in fragment sequence can be arranged according to the ascending sequence of the starting point of corresponding caching range.
In practice, target audio fragment sequence and caching range set conjunction be can store in terminal device.Specifically, target Audio fragment sequence can store in the caching of terminal device.Optionally, caching range set can store in terminal device Hard disk, in caching or memory.
Step 302, if at least one of caching range set caching range is respectively and to corresponding to buffered audio segment The first caching range have intersection, then to select a caching range to be processed as first from least one caching range , using the first caching range as the second item to be processed.
In the present embodiment, terminal device can traverse in caching range set after getting caching range set Range is cached, to determine in caching range set with the presence or absence of the caching range for having intersection with the first caching range.
If at least one of caching range set caching range has intersection, terminal device with the first caching range respectively A caching range can be selected at least one caching range from this as the first item to be processed, the first caching range is made For the second item to be processed.
Here, terminal device can randomly select out a caching range as the from least one above-mentioned caching range One item to be processed.Optionally, terminal device can choose the smallest caching range of starting point from least one above-mentioned caching range As the first item to be processed.
Step 303, it is based on the first item to be processed and the second item to be processed, determines new caching range.
In the present embodiment, terminal device can be based on first after determining the first item to be processed and the second item to be processed Item to be processed and the second item to be processed determine new caching range.
As an example, terminal device can be by the first item to be processed if the caching range in the disclosure further includes terminal It is determined as newly caching the starting point of range with the minimum starting point in the starting point of the second item to be processed.Moreover, terminal device can be by Maximum terminal in the terminal of one item to be processed and the second item to be processed is determined as newly caching the terminal of range.
In some optional implementations of the present embodiment, terminal device can determine new caching model in the following ways It encloses: the minimum starting point in the starting point of the first item to be processed and the second item to be processed being determined as newly to cache the starting point of range;By The starting point of one item to be processed and the summation of length are as the first value, using the summation of the starting point of the second item to be processed and length as The difference of maximum value and the minimum starting point in first value and second value is determined as newly caching the length of range by two-value.
Step 304, determining with new caching based on the first item to be processed and the corresponding audio fragment of the second item to be processed The corresponding new audio fragment of range.
In the present embodiment, terminal device can be based on the first item to be processed and the corresponding audio of the second item to be processed Segment, determining new audio fragment corresponding with new caching range.
As an example, the lap of item to be processed for first and the second item to be processed, terminal device can be from first It crops and is somebody's turn to do in any one of audio fragment corresponding to audio fragment corresponding to item to be processed and the second item to be processed The corresponding audio content of lap, obtains audio fragment after cropped.Then terminal device can according to starting point by it is small to Big sequence, to after cropped audio fragment and another audio fragment not being cut splice.Then terminal device Audio fragment can be extracted from through spliced audio fragment as new audio based on the starting point and length of new caching range Segment.
Step 305, audio fragment corresponding with the first item to be processed in target audio fragment sequence is replaced with into new sound Frequency segment.
In the present embodiment, terminal device can be by sound corresponding with the first item to be processed in target audio fragment sequence Frequency segment replaces with new audio fragment.This way it is possible to avoid target audio segment sequence will be directly inserted into buffered audio segment In column, spatial cache can be effectively saved.
It is the application scenarios of the method for buffered audio data of embodiment shown in Fig. 3 with continued reference to Fig. 4, Fig. 4 One schematic diagram.In the application scenarios of Fig. 4, user can be used smart phone and play song A.In the process for playing song A In, smart phone can carry out segmentation downloading to song A, and cache the audio fragment that downloading is completed.In addition, playing song A During, user can adjust the playback progress of song A by dragging progress bar.Smart phone can be in response to user couple The drag operation of progress bar redefines current caching range, and obtains audio fragment corresponding with the caching range.This In, which can be known as that the caching range is known as the first caching to buffered audio segment (as shown in label 401) Range (as shown in label 402).Then, smart phone is available related with audio fragment sequence associated by song A slow Deposit range set.Wherein, audio fragment sequence may include audio fragment A1 cached, in song A (such as 403 institute of label Show).Caching range set may include caching range B1 corresponding to audio fragment A1 (as shown in label 404).Audio fragment Sequence and caching range set conjunction can store in the caching of smart phone.Later, if the caching range of caching range B1 and first There is intersection, then smart phone can determine new caching range (such as 405 institute of label based on the first caching range and caching range B1 Show), and based on to buffered audio segment and audio fragment A1, determining new audio fragment corresponding with new caching range is (as marked Shown in numbers 406).Then, the audio fragment A1 in audio fragment sequence can be replaced with new audio fragment by smart phone.
The method that embodiment shown in Fig. 3 provides, by response to getting to buffered audio segment, acquisition and target sound The related caching range set of frequency fragment sequence, wherein to the corresponding first caching range of buffered audio segment, cache range set In caching range correspond to the audio fragment in target audio fragment sequence, so as to slow in caching at least one of range set When depositing range has intersection with the first caching range respectively, a caching range conduct is selected at least one caching range from this First item to be processed executes following caching: based on the first item to be processed using the first caching range as the second item to be processed With the second item to be processed, new caching range is determined;Based on the first item to be processed and the corresponding audio piece of the second item to be processed Section, determining new audio fragment corresponding with new caching range;It will be corresponding with the first item to be processed in target audio fragment sequence Audio fragment replace with new audio fragment.The Segment-based caching to audio data may be implemented in embodiment shown in Fig. 3.In addition, By using the audio fragment corresponding with the first item to be processed in new audio fragment replacement target audio fragment sequence, Ke Yijie Save spatial cache.
With further reference to Fig. 5, it illustrates the processes 500 of another embodiment of the method for buffered audio data. The method for being used for buffered audio data can be applied to terminal device (such as terminal device shown in FIG. 1 101,102,103), The following steps are included:
Step 501, in response to getting to buffered audio segment, caching model related with target audio fragment sequence is obtained Enclose set.
In the present embodiment, terminal device can obtain and target audio piece in response to getting to buffered audio segment The related caching range set of Duan Xulie.Wherein, the first caching range can be corresponded to buffered audio segment.Cache range set In caching range can correspond to the audio fragment in target audio fragment sequence.Caching range may include starting point and length. Starting point can represent play position of the audio fragment in the target audio belonged to.Length can represent the broadcasting of audio fragment Length.
Target audio fragment sequence can be the target sound belonged to buffered audio segment got with terminal device Frequently associated sequence, the sequence may include one or more audio fragments of the target audio.In addition, target audio segment Audio fragment in sequence can be arranged according to the ascending sequence of the starting point of corresponding caching range.
Step 502, if at least one of caching range set caching range is respectively and to corresponding to buffered audio segment The first caching range have intersection, then to select a caching range to be processed as first from least one caching range , using the first caching range as the second item to be processed.
In the present embodiment, if at least one of caching range set caching range has friendship with the first caching range respectively Collection, then terminal device can select a caching range as the first item to be processed at least one caching range from this, incite somebody to action First caching range is as the second item to be processed.Here, terminal device can be from choosing at least one above-mentioned caching range The smallest caching range of point is as the first item to be processed.
Step 503, it is based on the first item to be processed and the second item to be processed, determines new caching range.
In the present embodiment, terminal device can be based on first after determining the first item to be processed and the second item to be processed Item to be processed and the second item to be processed determine new caching range.
As an example, terminal device can be true by the minimum starting point in the starting point of the first item to be processed and the second item to be processed It is set to the starting point of new caching range.Terminal device can also be using the summation of the starting point of the first item to be processed and length as first Value, and using the summation of the starting point of the second item to be processed and length as second value, and by the maximum in the first value and second value The difference of value and the minimum starting point is determined as newly caching the length of range.
Step 504, determining with new caching based on the first item to be processed and the corresponding audio fragment of the second item to be processed The corresponding new audio fragment of range.
In the present embodiment, terminal device can be based on the first item to be processed and the corresponding audio of the second item to be processed Segment, determining new audio fragment corresponding with new caching range.It here, can institute referring to Fig. 3 for the explanation of step 504 Show the related description of the step 304 in embodiment, details are not described herein.
Step 505, audio fragment corresponding with the first item to be processed in target audio fragment sequence is replaced with into new sound Frequency segment.
In the present embodiment, terminal device can be by sound corresponding with the first item to be processed in target audio fragment sequence Frequency segment replaces with new audio fragment.
Step 506, if there is also unselected caching ranges at least one caching range, delay from unselected One caching range of selection in range is deposited, using the caching range as the first item to be processed, and from target audio fragment sequence New audio fragment is extracted, using new caching range corresponding to new audio fragment as the second item to be processed.
In the present embodiment, terminal device is by audio corresponding with the first item to be processed in target audio fragment sequence After segment replaces with new audio fragment, if there is also unselected caching range at least one above-mentioned caching range set, Then terminal device can choose a caching range from the unselected caching range, using the caching range as first to Processing item.For example, terminal device can choose the smallest caching range of starting point as from the unselected caching range One item to be processed.Terminal device can also extract the new audio fragment from target audio fragment sequence, and by the new audio New caching range is as the second item to be processed corresponding to segment.Later, terminal device can turn to execute step 503.
It should be noted that after extracting the new audio fragment in target audio fragment sequence, target audio segment sequence Column no longer include the new audio fragment.
Step 507, if unselected caching range is not present at least one caching range, terminate and sound to be cached The related caching of frequency segment.
In the present embodiment, terminal device is by audio corresponding with the first item to be processed in target audio fragment sequence After segment replaces with new audio fragment, if unselected caching range is not present at least one above-mentioned caching range, eventually End equipment can terminate with to the related caching of buffered audio segment.
From figure 5 it can be seen that compared with the corresponding embodiment of Fig. 3, in the present embodiment for buffered audio data The process 500 of method is highlighted to be replaced with by audio fragment corresponding with the first item to be processed in target audio fragment sequence Processing step after new audio fragment.The scheme of the present embodiment description can include at least two in caching range set as a result, When a and the first caching range has the caching range of intersection, different new audio fragment replacement target audio segment sequences is used for multiple times Corresponding caching range in column has the audio fragment of intersection with the first caching range, to avoid in target audio fragment sequence There are the audio fragments that corresponding caching range has intersection, can further save spatial cache in this way.
In some optional of the method for buffered audio data that the embodiment that Fig. 2, Fig. 3 and Fig. 5 are respectively shown in provides Implementation in, if but there are starting points there is no having the caching range of intersection with the first caching range in caching range set Less than the caching range of the starting point of the first caching range, then the use that terminal device can be provided using embodiment as shown in FIG. 6 In the method for buffered audio data.
In some optional of the method for buffered audio data that the embodiment that Fig. 2, Fig. 3 and Fig. 5 are respectively shown in provides Implementation in, if but there are starting points there is no having the caching range of intersection with the first caching range in caching range set Greater than the caching range of the starting point of the first caching range, then the use that terminal device can be provided using embodiment as shown in Figure 7 In the method for buffered audio data.
As shown in fig. 6, it illustrates the processes 600 of the further embodiment of the method for buffered audio data.The use In the method for buffered audio data, comprising the following steps:
Step 601, determine that the first object caching range in caching range set and the first caching range whether there is head Tail is connected situation.
In the present embodiment, if being not present and sound to be cached in caching range set related with target audio fragment sequence First caching range corresponding to frequency segment has the caching range of intersection, but the starting point there are starting point less than the first caching range Range is cached, then terminal device can determine whether the first object caching range and first in caching range set caches range In the presence of the situation that joins end to end.Wherein, the starting point of first object caching range and the starting point of the first caching range are closed on and less than the The starting point of one caching range.
Here, terminal device can cache the terminal of range and the starting point of the first caching range based on first object, determine First object caching range and the first caching range are with the presence or absence of the situation that joins end to end.For example, being belonged to buffered audio segment Target audio can correspond to time shaft.On the time shaft, if next play position of the terminal is the starting point, terminal Equipment can determine that first object caching range and the first caching range have the situation that joins end to end;Otherwise, terminal device can be with Determine that there is no the situations that joins end to end for first object caching range and the first caching range.
It should be noted that the terminal of first object caching range may be embodied in first object caching range, alternatively, The terminal can cache the starting point of range based on first object and length computation obtains.
In the present embodiment, if first object caching range and the first caching range have the situation that joins end to end, terminal Equipment can execute step 602-603;Otherwise, terminal device can execute step 604.
Step 602, if first object caching range and the first caching range have the situation that joins end to end, splice the first mesh Mark caches audio fragment corresponding to range and to buffered audio segment, obtains through spliced first audio fragment.
In the present embodiment, if first object caching range and the first caching range have the situation that joins end to end, terminal Equipment can splice audio fragment and to buffered audio segment corresponding to first object caching range, obtain through spliced the One audio fragment.Wherein, the run-out of the first audio fragment is in buffered audio segment.
Step 603, the audio fragment corresponding with first object caching range in target audio fragment sequence is replaced with First audio fragment.
In the present embodiment, terminal device is after obtaining the first audio fragment, can will be in target audio fragment sequence Audio fragment corresponding with first object caching range replaces with the first audio fragment.
Step 604, if there is no the situations that joins end to end for first object caching range and the first caching range, in target sound In frequency fragment sequence, specified being inserted into first of audio fragment corresponding to first object caching range to buffered audio segment Position.
In the present embodiment, if the situation that joins end to end is not present in first object caching range and the first caching range, In target audio fragment sequence, terminal device can will be inserted into corresponding to first object caching range to buffered audio segment First designated position of audio fragment.
For example, if the audio fragment in target audio fragment sequence is from left to right according to the starting point of corresponding caching range Ascending sequence arrangement, then the first designated position can be right side.Terminal device can will be inserted into buffered audio segment To the right side of audio fragment corresponding to first object caching range.
If the audio fragment in target audio fragment sequence is from top to bottom according to the starting point of corresponding caching range by small It is arranged to big sequence, then the first designated position can be lower section.Terminal device can will be inserted into buffered audio segment The lower section of audio fragment corresponding to one target cache range.
From fig. 6 it can be seen that the process 600 of the method for buffered audio data in the present embodiment is highlighted slow The caching range for being not present in range set and having intersection with the first caching range is deposited, but there are starting points less than the first caching range Processing step when the caching range of starting point.The diversity of information processing may be implemented in the scheme of the present embodiment description as a result,.And And when first object caching range and the first caching range exist and join end to end situation, passes through splicing first object and cache model It encloses corresponding audio fragment and replaces target audio piece to buffered audio segment, and using resulting first audio fragment is spliced Audio fragment corresponding with first object caching range in Duan Xulie, it is possible to reduce the audio piece in target audio fragment sequence The quantity of section, in this way it is subsequent get again it is new to buffered audio segment and corresponding for that should be executed to buffered audio segment It, being capable of speed up processing when caching.
As shown in fig. 7, it illustrates the processes 700 of another embodiment of the method for buffered audio data.The use In the method for buffered audio data, comprising the following steps:
Step 701, determine that the second target cache range in caching range set and the first caching range whether there is head Tail is connected situation.
In the present embodiment, if being not present and sound to be cached in caching range set related with target audio fragment sequence First caching range corresponding to frequency segment has the caching range of intersection, but there are starting points to be greater than the starting point of the first caching range Range is cached, then terminal device can determine whether the second target cache range and first in caching range set caches range In the presence of the situation that joins end to end.Wherein, the starting point of the starting point of the second target cache range and the first caching range closes on and is greater than the The starting point of one caching range.
Here, terminal device can based on first caching range terminal and the second target cache range starting point, determine Second target cache range and the first caching range are with the presence or absence of the situation that joins end to end.For example, being belonged to buffered audio segment Target audio can correspond to time shaft.On the time shaft, if next play position of the terminal is the starting point, terminal Equipment can determine that the second target cache range and the first caching range have the situation that joins end to end;Otherwise, terminal device can be with Determine that there is no the situations that joins end to end for the second target cache range and the first caching range.
It should be noted that the terminal of the first caching range may be embodied in the first caching range, alternatively, the terminal can With based on first caching range starting point and length computation obtain.
In the present embodiment, if the second target cache range and the first caching range have the situation that joins end to end, terminal Equipment can execute step 702-703;Otherwise, terminal device can execute step 704.
Step 702, if the second target cache range and the first caching range have the situation that joins end to end, splice the second mesh Mark caches audio fragment corresponding to range and to buffered audio segment, obtains through spliced second audio fragment.
In the present embodiment, if the second target cache range and the first caching range have the situation that joins end to end, terminal Equipment can splice audio fragment corresponding to the second target cache range and to buffered audio segment, obtain through spliced Two audio fragments.Wherein, the head of the second audio fragment are in buffered audio segment.
Step 703, the audio fragment corresponding with the second target cache range in target audio fragment sequence is replaced with Second audio fragment.
In the present embodiment, terminal device is after obtaining the second audio fragment, can will be in target audio fragment sequence Audio fragment corresponding with the second target cache range replaces with the second audio fragment.
Step 704, if there is no the situations that joins end to end for the second target cache range and the first caching range, in target sound In frequency fragment sequence, specified being inserted into second of audio fragment corresponding to the second target cache range to buffered audio segment Position.
In the present embodiment, if the situation that joins end to end is not present in the second target cache range and the first caching range, In target audio fragment sequence, terminal device can will be inserted into corresponding to the second target cache range to buffered audio segment Second designated position of audio fragment.
For example, if the audio fragment in target audio fragment sequence is from left to right according to the starting point of corresponding caching range Ascending sequence arrangement, then the second designated position can be left side.Terminal device can will be inserted into buffered audio segment To the left side of audio fragment corresponding to the second target cache range.
If the audio fragment in target audio fragment sequence is from top to bottom according to the starting point of corresponding caching range by small It is arranged to big sequence, then the first designated position can be top.Terminal device can will be inserted into buffered audio segment The top of audio fragment corresponding to two target cache ranges.
It can be seen from figure 7 that the process 700 of the method for buffered audio data in the present embodiment is highlighted slow The caching range for being not present in range set and having intersection with the first caching range is deposited, but there are starting points to be greater than the first caching range Processing step when the caching range of starting point.The diversity of information processing may be implemented in the scheme of the present embodiment description as a result,.And And when the second target cache range and the first caching range exist and join end to end situation, by splicing the second target cache model It encloses corresponding audio fragment and replaces target audio piece to buffered audio segment, and using resulting second audio fragment is spliced Audio fragment corresponding with the second target cache range in Duan Xulie, it is possible to reduce the audio piece in target audio fragment sequence The quantity of section, in this way it is subsequent get again it is new to buffered audio segment and corresponding for that should be executed to buffered audio segment It, being capable of speed up processing when caching.
With further reference to Fig. 8, as the realization to method shown in above-mentioned each figure, present disclose provides one kind for caching sound One embodiment of the device of frequency evidence, the Installation practice is corresponding with embodiment of the method shown in Fig. 2, which specifically may be used To be applied in various electronic equipments.
As shown in figure 8, the device 800 for buffered audio data of the present embodiment includes: that acquiring unit 801 is configured to In response to getting to buffered audio segment, caching range set related with target audio fragment sequence is obtained, wherein to slow The first caching range can be corresponded to by depositing audio fragment, and the caching range cached in range set can correspond to target audio segment sequence Audio fragment in column;If cache unit 802 is configured to cache at least one of range set caching range respectively with the One caching range has intersection, then it is to be processed as first to select a caching range from least one above-mentioned caching range , using the first caching range as the second item to be processed, execute following caching: based on the first item to be processed and second wait locate The corresponding audio fragment of item is managed, determines new audio fragment;It will be right with the first item to be processed in target audio fragment sequence The audio fragment answered replaces with new audio fragment.
In the present embodiment, in the device of buffered audio data 800: the tool of acquiring unit 801 and cache unit 802 Body processing and its brought technical effect can be respectively with reference to step 201, the steps 202, step 203 in Fig. 2 corresponding embodiment With the related description of step 204, details are not described herein.
In some optional implementations of the present embodiment, cache unit 802 can be further configured to: based on the One item to be processed and the second item to be processed determine new caching range;It is right respectively based on the first item to be processed and the second item to be processed The audio fragment answered, determining new audio fragment corresponding with new caching range.
In some optional implementations of the present embodiment, cache unit 802 can also be further configured to: incited somebody to action After audio fragment corresponding with the first item to be processed in target audio fragment sequence replaces with new audio fragment, if it is above-mentioned extremely There is also unselected caching ranges in a few caching range, then a caching is chosen from unselected caching range Range using the caching range as the first item to be processed, and extracts new audio fragment from target audio fragment sequence, will be new New caching range corresponding to audio fragment continues to execute above-mentioned caching as the second item to be processed.
In some optional implementations of the present embodiment, cache unit 802 can also be further configured to: incited somebody to action After audio fragment corresponding with the first item to be processed in target audio fragment sequence replaces with new audio fragment, if it is above-mentioned extremely Unselected caching range is not present in a few caching range, then terminates above-mentioned caching.
In some optional implementations of the present embodiment, cache unit 802 can be further configured to: by first Minimum starting point in the starting point of item to be processed and the second item to be processed is determined as newly caching the starting point of range;By the first item to be processed Starting point and length summation as the first value, using the summation of the starting point of the second item to be processed and length as second value, by The difference of maximum value and minimum starting point in one value and second value is determined as newly caching the length of range.
In some optional implementations of the present embodiment, above-mentioned apparatus 800 can also include: the first determination unit (not shown), if being configured to cache in range set, there is no the caching ranges for having intersection with the first caching range, but Caching range there are starting point less than the starting point of the first caching range, it is determined that the first object in caching range set caches model It encloses with the first caching range with the presence or absence of the situation that joins end to end, wherein first object caches the starting point and the first caching model of range The starting point enclosed closes on and less than the starting point of the first caching range;First cache unit (not shown), if being configured to first There is the situation that joins end to end in target cache range and the first caching range, then splice audio corresponding to first object caching range Segment and to buffered audio segment, obtain through spliced first audio fragment, by target audio fragment sequence with first The corresponding audio fragment of target cache range replaces with the first audio fragment.
In some optional implementations of the present embodiment, above-mentioned apparatus 800 can also include: the second cache unit (not shown), if being configured to, first object caches range and the situation that joins end to end is not present in the first caching range, In target audio fragment sequence, the of audio fragment corresponding to first object caching range will be inserted into buffered audio segment One designated position.
In some optional implementations of the present embodiment, above-mentioned apparatus 800 can also include: the second determination unit (not shown), if being configured to cache in range set, there is no the caching ranges for having intersection with the first caching range, but There are the caching ranges that starting point is greater than the starting point of the first caching range, it is determined that the second target cache model in caching range set It encloses with the first caching range with the presence or absence of the situation that joins end to end, wherein the starting point of the second target cache range and the first caching model The starting point enclosed closes on and is greater than the starting point of the first caching range;Third cache unit (not shown), if being configured to second There is the situation that joins end to end in target cache range and the first caching range, then splice audio corresponding to the second target cache range Segment and to buffered audio segment, obtain through spliced second audio fragment, by target audio fragment sequence with second The corresponding audio fragment of target cache range replaces with the second audio fragment.
In some optional implementations of the present embodiment, above-mentioned apparatus 800 can also include: the 4th cache unit (not shown), if being configured to the second target cache range and the first caching range there is no joining end to end situation, In target audio fragment sequence, of audio fragment corresponding to the second target cache range will be inserted into buffered audio segment Two designated positions.
The device provided by the above embodiment of the disclosure, by response to getting to buffered audio segment, acquisition and mesh The related caching range set of mark with phonetic symbols frequency fragment sequence, wherein to the corresponding first caching range of buffered audio segment, cache range Caching range in set corresponds to the audio fragment in target audio fragment sequence, so as at least one in caching range set When a caching range has intersection with the first caching range respectively, a caching range is selected at least one caching range from this Following caching is executed: based on first wait locate using the first caching range as the second item to be processed as the first item to be processed Item and the corresponding audio fragment of the second item to be processed are managed, determines new audio fragment;By in target audio fragment sequence with The corresponding audio fragment of first item to be processed replaces with new audio fragment.Above-described embodiment of the disclosure may be implemented to audio number According to Segment-based caching.In addition, by using right with the first item to be processed in new audio fragment replacement target audio fragment sequence The audio fragment answered can save spatial cache.
Below with reference to Fig. 9, it illustrates the electronic equipment that is suitable for being used to realize embodiment of the disclosure, (example is as shown in figure 1 Terminal device) 900 structural schematic diagram.Terminal device in embodiment of the disclosure can include but is not limited to such as move electricity Words, laptop, digit broadcasting receiver, PDA (personal digital assistant), PAD (tablet computer), PMP (portable multimedia Player), the mobile terminal and such as number TV, desktop computer etc. of car-mounted terminal (such as vehicle mounted guidance terminal) etc. Fixed terminal.Electronic equipment shown in Fig. 9 is only an example, function to embodiment of the disclosure and should not use model Shroud carrys out any restrictions.
As shown in figure 9, electronic equipment 900 may include processing unit (such as central processing unit, graphics processor etc.) 901, random access can be loaded into according to the program being stored in read-only memory (ROM) 902 or from storage device 908 Program in memory (RAM) 903 and execute various movements appropriate and processing.In RAM 903, it is also stored with electronic equipment Various programs and data needed for 900 operations.Processing unit 901, ROM 902 and RAM 903 pass through the phase each other of bus 904 Even.Input/output (I/O) interface 905 is also connected to bus 904.
In general, following device can connect to I/O interface 905: including such as touch screen, touch tablet, keyboard, mouse, taking the photograph As the input unit 906 of head, microphone, accelerometer, gyroscope etc.;Including such as liquid crystal display (LCD), loudspeaker, vibration The output device 907 of dynamic device etc.;Storage device 908 including such as hard disk etc.;And communication device 909.Communication device 909 can To allow electronic equipment 900 wirelessly or non-wirelessly to be communicated with other equipment to exchange data.Although Fig. 9 is shown with various The electronic equipment 900 of device, it should be understood that being not required for implementing or having all devices shown.It can be alternatively Implement or have more or fewer devices.Each box shown in Fig. 9 can represent a device, also can according to need Represent multiple devices.
Particularly, in accordance with an embodiment of the present disclosure, it may be implemented as computer above with reference to the process of flow chart description Software program.For example, embodiment of the disclosure includes a kind of computer program product comprising be carried on computer-readable medium On computer program, which includes the program code for method shown in execution flow chart.In such reality It applies in example, which can be downloaded and installed from network by communication device 909, or from storage device 908 It is mounted, or is mounted from ROM 902.When the computer program is executed by processing unit 901, the implementation of the disclosure is executed The above-mentioned function of being limited in the method for example.
It is situated between it should be noted that computer-readable medium described in embodiment of the disclosure can be computer-readable signal Matter or computer readable storage medium either the two any combination.Computer readable storage medium for example can be with System, device or the device of --- but being not limited to --- electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor, or it is any more than Combination.The more specific example of computer readable storage medium can include but is not limited to: have one or more conducting wires Electrical connection, portable computer diskette, hard disk, random access storage device (RAM), read-only memory (ROM), erasable type are programmable Read-only memory (EPROM or flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), light storage device, magnetic are deposited Memory device or above-mentioned any appropriate combination.In embodiment of the disclosure, computer readable storage medium, which can be, appoints What include or the tangible medium of storage program that the program can be commanded execution system, device or device use or and its It is used in combination.And in embodiment of the disclosure, computer-readable signal media may include in a base band or as carrier wave The data-signal that a part is propagated, wherein carrying computer-readable program code.The data-signal of this propagation can be adopted With diversified forms, including but not limited to electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal is situated between Matter can also be any computer-readable medium other than computer readable storage medium, which can be with It sends, propagate or transmits for by the use of instruction execution system, device or device or program in connection.Meter The program code for including on calculation machine readable medium can transmit with any suitable medium, including but not limited to: electric wire, optical cable, RF (radio frequency) etc. or above-mentioned any appropriate combination.
Above-mentioned computer-readable medium can be included in above-mentioned electronic equipment;It is also possible to individualism, and not It is fitted into the electronic equipment.Above-mentioned computer-readable medium carries one or more program, when said one or more When a program is executed by the electronic equipment, so that the electronic equipment: in response to getting to buffered audio segment, acquisition and target The related caching range set of audio fragment sequence, wherein the first caching range can be corresponded to buffered audio segment, cache model Audio fragment in target audio fragment sequence can be corresponded to by enclosing the caching range in set;If caching in range set at least One caching range has intersection with the first caching range respectively, then selects a caching from least one above-mentioned caching range Range executes following caching: based on first using the first caching range as the second item to be processed as the first item to be processed Item to be processed and the corresponding audio fragment of the second item to be processed, determine new audio fragment;It will be in target audio fragment sequence Audio fragment corresponding with the first item to be processed replace with new audio fragment.
The behaviour for executing embodiment of the disclosure can be write with one or more programming languages or combinations thereof The computer program code of work, described program design language include object oriented program language-such as Java, Smalltalk, C++ further include conventional procedural programming language-such as " C " language or similar program design language Speech.Program code can be executed fully on the user computer, partly be executed on the user computer, as an independence Software package execute, part on the user computer part execute on the remote computer or completely in remote computer or It is executed on server.In situations involving remote computers, remote computer can pass through the network of any kind --- packet It includes local area network (LAN) or wide area network (WAN)-is connected to subscriber computer, or, it may be connected to outer computer (such as benefit It is connected with ISP by internet).
Flow chart and block diagram in attached drawing are illustrated according to the system of the various embodiments of the disclosure, method and computer journey The architecture, function and operation in the cards of sequence product.In this regard, each box in flowchart or block diagram can generation A part of one module, program segment or code of table, a part of the module, program segment or code include one or more use The executable instruction of the logic function as defined in realizing.It should also be noted that in some implementations as replacements, being marked in box The function of note can also occur in a different order than that indicated in the drawings.For example, two boxes succeedingly indicated are actually It can be basically executed in parallel, they can also be executed in the opposite order sometimes, and this depends on the function involved.Also it to infuse Meaning, the combination of each box in block diagram and or flow chart and the box in block diagram and or flow chart can be with holding The dedicated hardware based system of functions or operations as defined in row is realized, or can use specialized hardware and computer instruction Combination realize.
Being described in unit involved in the embodiment of the present disclosure can be realized by way of software, can also be by hard The mode of part is realized.Wherein, the title of unit does not constitute the restriction to the unit itself under certain conditions, for example, obtaining Unit is taken to be also described as " obtaining related with target audio fragment sequence in response to getting to buffered audio segment Cache the unit of range set ".
Above description is only the preferred embodiment of the disclosure and the explanation to institute's application technology principle.Those skilled in the art Member is it should be appreciated that the open scope involved in the disclosure, however it is not limited to technology made of the specific combination of above-mentioned technical characteristic Scheme, while should also cover in the case where not departing from design disclosed above, it is carried out by above-mentioned technical characteristic or its equivalent feature Any combination and the other technical solutions formed.Such as features described above has similar function with (but being not limited to) disclosed in the disclosure Can technical characteristic replaced mutually and the technical solution that is formed.

Claims (20)

1. a kind of method for buffered audio data, comprising:
In response to getting to buffered audio segment, caching range set related with target audio fragment sequence is obtained, wherein Described to cache range to buffered audio segment corresponding first, the caching range in the caching range set corresponds to the target sound Audio fragment in frequency fragment sequence;
If at least one of described caching range set caching range has intersection with the first caching range respectively, from institute State and select a caching range at least one caching range as the first item to be processed, using described first cache range as Second item to be processed, executes following caching: being respectively corresponded based on the described first item to be processed and second item to be processed Audio fragment, determine new audio fragment;It will be corresponding with the described first item to be processed in the target audio fragment sequence Audio fragment replaces with the new audio fragment.
2. according to the method described in claim 1, wherein, described based on the described first item to be processed and described second to be processed The corresponding audio fragment of item, before determining new audio fragment, the method also includes:
Based on the described first item to be processed and second item to be processed, new caching range is determined;And
It is described based on the described first item to be processed and the corresponding audio fragment of second item to be processed, determine new audio piece Section, comprising:
It is determining with the new caching based on the described first item to be processed and the corresponding audio fragment of second item to be processed The corresponding new audio fragment of range.
3. according to the method described in claim 2, wherein, it is described by the target audio fragment sequence with described first After the corresponding audio fragment of item to be processed replaces with the new audio fragment, the method also includes:
If at least one described caching range, there is also unselected caching ranges, from the unselected caching model One caching range of middle selection is enclosed, using the caching range as the first item to be processed, and from the target audio fragment sequence The new audio fragment is extracted, using the new caching range corresponding to the new audio fragment as the second item to be processed, Continue to execute the caching.
4. according to the method described in claim 3, wherein, it is described by the target audio fragment sequence with described first After the corresponding audio fragment of item to be processed replaces with the new audio fragment, the method also includes:
If unselected caching range is not present at least one described caching range, terminate the caching.
It is described based on the described first item to be processed and described second to be processed 5. according to the method described in claim 2, wherein , determine new caching range, comprising:
Minimum starting point in the starting point of described first item to be processed and second item to be processed is determined as the new caching model The starting point enclosed;
Using the summation of the starting point of the described first item to be processed and length as the first value, by the starting point of the described second item to be processed and The summation of length is true by the difference of maximum value and the minimum starting point in first value and the second value as second value It is set to the length of the new caching range.
6. method described in one of -5 according to claim 1, wherein the method also includes:
If there is no having the caching range of intersection with the first caching range in the caching range set, but that there are starting points is small In the caching range of the starting point of the first caching range, it is determined that the first object in the caching range set caches range With the first caching range with the presence or absence of joining end to end situation, wherein the starting point of the first object caching range with it is described The starting point of first caching range closes on and is less than the starting point of the first caching range;
If the first object caching range and the first caching range have the situation that joins end to end, splice first mesh Audio fragment and described to buffered audio segment corresponding to mark caching range, obtains through spliced first audio fragment, will Audio fragment corresponding with first object caching range in the target audio fragment sequence replaces with first sound Frequency segment.
7. according to the method described in claim 6, wherein, the method also includes:
If there is no the situations that joins end to end for the first object caching range and the first caching range, in the target sound In frequency fragment sequence, audio fragment corresponding to the first object caching range is inserted into buffered audio segment by described First designated position.
8. method described in one of -5 according to claim 1, wherein the method also includes:
If there is no having the caching range of intersection with the first caching range in the caching range set, but that there are starting points is big In the caching range of the starting point of the first caching range, it is determined that the second target cache range in the caching range set With the first caching range with the presence or absence of joining end to end situation, wherein the starting point of the second target cache range with it is described The starting point of first caching range closes on and is greater than the starting point of the first caching range;
If the second target cache range and the first caching range have the situation that joins end to end, splice second mesh Audio fragment and described to buffered audio segment corresponding to mark caching range, obtains through spliced second audio fragment, will Audio fragment corresponding with the second target cache range in the target audio fragment sequence replaces with second sound Frequency segment.
9. according to the method described in claim 8, wherein, the method also includes:
If there is no the situations that joins end to end for the second target cache range and the first caching range, in the target sound In frequency fragment sequence, audio fragment corresponding to the second target cache range is inserted into buffered audio segment by described Second designated position.
10. a kind of device for buffered audio data, comprising:
Acquiring unit is configured in response to get to buffered audio segment, obtain related with target audio fragment sequence Cache range set, wherein described to the corresponding first caching range of buffered audio segment, the caching cached in range set Range corresponds to the audio fragment in the target audio fragment sequence;
Cache unit is cached with described first respectively if being configured at least one of described caching range set caching range Range has intersection, then selects a caching range as the first item to be processed, by institute from least one described caching range The first caching range is stated as the second item to be processed, executes following caching: based on the described first item to be processed and described the The corresponding audio fragment of two items to be processed, determines new audio fragment;By in the target audio fragment sequence with it is described The corresponding audio fragment of first item to be processed replaces with the new audio fragment.
11. device according to claim 10, wherein the cache unit is further configured to:
Based on the described first item to be processed and second item to be processed, new caching range is determined;
It is determining with the new caching based on the described first item to be processed and the corresponding audio fragment of second item to be processed The corresponding new audio fragment of range.
12. device according to claim 11, wherein the cache unit is still further configured to:
Audio fragment corresponding with the described first item to be processed in the target audio fragment sequence is replaced with into institute described After stating new audio fragment, if there is also unselected caching range at least one described caching range, from it is described not A caching range is chosen in the caching range being selected, using the caching range as the first item to be processed, and from the target The new audio fragment is extracted in audio fragment sequence, using the new caching range corresponding to the new audio fragment as Second item to be processed, continues to execute the caching.
13. device according to claim 12, wherein the cache unit is still further configured to:
Audio fragment corresponding with the described first item to be processed in the target audio fragment sequence is replaced with into institute described After stating new audio fragment, if unselected caching range is not present at least one described caching range, terminate described Caching.
14. device according to claim 11, wherein the cache unit is further configured to:
Minimum starting point in the starting point of described first item to be processed and second item to be processed is determined as the new caching model The starting point enclosed;
Using the summation of the starting point of the described first item to be processed and length as the first value, by the starting point of the described second item to be processed and The summation of length is true by the difference of maximum value and the minimum starting point in first value and the second value as second value It is set to the length of the new caching range.
15. device described in one of 0-14 according to claim 1, wherein described device further include:
First determination unit, if being configured in the caching range set, there is no have intersection with the first caching range Range is cached, but there are the caching ranges that starting point is less than the starting point of the first caching range, it is determined that the caching range set First object caching range and the first caching range in conjunction is with the presence or absence of the situation that joins end to end, wherein first mesh The starting point of the starting point of mark caching range and the first caching range closes on and is less than the starting point of the first caching range;
First cache unit, if being configured to, the first object caches range and the first caching range presence joins end to end Situation is then spliced audio fragment corresponding to first object caching range and described to buffered audio segment, is obtained spliced The first audio fragment after connecing, by the audio corresponding with first object caching range in the target audio fragment sequence Segment replaces with first audio fragment.
16. device according to claim 15, wherein described device further include:
Second cache unit, if being configured to, the first object caches range and head and the tail phase is not present in the first caching range Even situation is inserted into the first object caching to buffered audio segment for described then in the target audio fragment sequence First designated position of audio fragment corresponding to range.
17. device described in one of 0-14 according to claim 1, wherein described device further include:
Second determination unit, if being configured in the caching range set, there is no have intersection with the first caching range Range is cached, but there are the caching ranges that starting point is greater than the starting point of the first caching range, it is determined that the caching range set The second target cache range and the first caching range in conjunction is with the presence or absence of the situation that joins end to end, wherein second mesh The starting point of the starting point of mark caching range and the first caching range closes on and is greater than the starting point of the first caching range;
Third cache unit, if be configured to the second target cache range and it is described first caching range exist join end to end Situation is then spliced audio fragment corresponding to the second target cache range and described to buffered audio segment, is obtained spliced The second audio fragment after connecing, by the audio corresponding with the second target cache range in the target audio fragment sequence Segment replaces with second audio fragment.
18. device according to claim 17, wherein described device further include:
4th cache unit, if being configured to the second target cache range and the first caching range there is no head and the tail phase Even situation is inserted into second target cache to buffered audio segment for described then in the target audio fragment sequence Second designated position of audio fragment corresponding to range.
19. a kind of electronic equipment, comprising:
One or more processors;
Storage device is stored thereon with one or more programs,
When one or more of programs are executed by one or more of processors, so that one or more of processors are real The now method as described in any in claim 1-9.
20. a kind of computer-readable medium, is stored thereon with computer program, wherein real when described program is executed by processor The now method as described in any in claim 1-9.
CN201910194509.7A 2019-03-14 2019-03-14 Method and apparatus for buffering audio data Active CN109903785B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910194509.7A CN109903785B (en) 2019-03-14 2019-03-14 Method and apparatus for buffering audio data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910194509.7A CN109903785B (en) 2019-03-14 2019-03-14 Method and apparatus for buffering audio data

Publications (2)

Publication Number Publication Date
CN109903785A true CN109903785A (en) 2019-06-18
CN109903785B CN109903785B (en) 2020-05-15

Family

ID=66953655

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910194509.7A Active CN109903785B (en) 2019-03-14 2019-03-14 Method and apparatus for buffering audio data

Country Status (1)

Country Link
CN (1) CN109903785B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050066063A1 (en) * 2003-08-01 2005-03-24 Microsoft Corporation Sparse caching for streaming media
US20150039714A1 (en) * 2013-07-30 2015-02-05 Opera Software Asa Multimedia cache with dynamic segmenting
CN106060579A (en) * 2012-12-30 2016-10-26 乐视网信息技术(北京)股份有限公司 Streaming video playing method
CN108574860A (en) * 2017-03-07 2018-09-25 合网络技术(北京)有限公司 Multimedia resource playback method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050066063A1 (en) * 2003-08-01 2005-03-24 Microsoft Corporation Sparse caching for streaming media
CN106060579A (en) * 2012-12-30 2016-10-26 乐视网信息技术(北京)股份有限公司 Streaming video playing method
US20150039714A1 (en) * 2013-07-30 2015-02-05 Opera Software Asa Multimedia cache with dynamic segmenting
CN108574860A (en) * 2017-03-07 2018-09-25 合网络技术(北京)有限公司 Multimedia resource playback method and device

Also Published As

Publication number Publication date
CN109903785B (en) 2020-05-15

Similar Documents

Publication Publication Date Title
CN105701214B (en) Preload the mobile Web browser of webpage
CN111510760B (en) Video information display method and device, storage medium and electronic equipment
CN109495791A (en) A kind of adding method, device, electronic equipment and the readable medium of video paster
US11838251B2 (en) Information interaction method, apparatus, device, storage medium and program product
CN109635261A (en) Online document content edition method, device, storage medium and electronic equipment
CN109495790A (en) Paster adding method, device, electronic equipment and readable medium based on editing machine
CN107656768B (en) Method and system for controlling page jump
CN109684578A (en) Method and apparatus for showing information
CN109542578A (en) A kind of display methods of list interface, device, equipment and storage medium
CN108282529A (en) Publication and system, the method and apparatus for subscribing to data
CN108628673A (en) Data processing method, electronic equipment and computer-readable medium
CN108833787A (en) Method and apparatus for generating short-sighted frequency
CN109947317A (en) Application program page display method and device
CN110865734B (en) Target object display method and device, electronic equipment and computer readable medium
CN109885314A (en) Small routine autoplacement method and device
CN110213614A (en) The method and apparatus of key frame are extracted from video file
CN109446025A (en) A kind of back method of operation behavior, device, electronic equipment and readable medium
CN108920238A (en) Operate method, electronic equipment and the computer-readable medium of application
CN109918146A (en) Page generation method and device
JP2024525192A (en) Audio processing method, device, electronic device, and storage medium
CN108965984A (en) A kind of method, apparatus and equipment/terminal/server file transmission and played
CN110087122A (en) For handling system, the method and apparatus of information
CN112165647A (en) Audio data processing method, device, equipment and storage medium
CN109819042A (en) For providing the method and apparatus of Software Development Kit
CN109165723A (en) Method and apparatus for handling data

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: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Patentee after: Douyin Vision Co.,Ltd.

Address before: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Patentee before: Tiktok vision (Beijing) Co.,Ltd.

Address after: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Patentee after: Tiktok vision (Beijing) Co.,Ltd.

Address before: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Patentee before: BEIJING BYTEDANCE NETWORK TECHNOLOGY Co.,Ltd.

CP01 Change in the name or title of a patent holder