CN105931656A - Audio editing method and device - Google Patents

Audio editing method and device Download PDF

Info

Publication number
CN105931656A
CN105931656A CN201610231146.6A CN201610231146A CN105931656A CN 105931656 A CN105931656 A CN 105931656A CN 201610231146 A CN201610231146 A CN 201610231146A CN 105931656 A CN105931656 A CN 105931656A
Authority
CN
China
Prior art keywords
frame
audio file
value
read
specific field
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
CN201610231146.6A
Other languages
Chinese (zh)
Other versions
CN105931656B (en
Inventor
潘伟
彭迎
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hisense Mobile Communications Technology Co Ltd
Original Assignee
Hisense Mobile Communications 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 Hisense Mobile Communications Technology Co Ltd filed Critical Hisense Mobile Communications Technology Co Ltd
Priority to CN201610231146.6A priority Critical patent/CN105931656B/en
Publication of CN105931656A publication Critical patent/CN105931656A/en
Application granted granted Critical
Publication of CN105931656B publication Critical patent/CN105931656B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11BINFORMATION STORAGE BASED ON RELATIVE MOVEMENT BETWEEN RECORD CARRIER AND TRANSDUCER
    • G11B27/00Editing; Indexing; Addressing; Timing or synchronising; Monitoring; Measuring tape travel
    • G11B27/02Editing, e.g. varying the order of information signals recorded on, or reproduced from, record carriers
    • G11B27/031Electronic editing of digitised analogue information signals, e.g. audio or video signals

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Management Or Editing Of Information On Record Carriers (AREA)

Abstract

The invention relates to an audio editing method and device, and relates to the audio processing field. The method comprises that an audio file to be played is obtained; and all data frames in the audio file are read successively, whether the value of a specific field in the presently read data frame is a set value is determined every time one data frame is read, if yes, the presently read data frame is skipped, and otherwise, the presently read data frame is played. Thus, when the audio file is played, a determination step is added, so that played data frames belong to the audio part expected by users, editing requirements of the users are satisfied, it is not required to abandon certain data frames, complete information of the audio file is reserved, recovery is allowed, and user requirements can be met in a better manner.

Description

A kind of method and device of audio clips
Technical field
The present invention relates to field of audio processing, particularly relate to the method and device of a kind of audio clips.
Background technology
At present, along with mobile phone industry intensified competition, Consumer's Experience is more and more heavier for Business survival and development Want.Can user be more and more higher to individual requirement, provide customization service to become each big application and meet user One of mark.User is when listening music, it is often desired to wherein like one or one section of music excerpt are gone out Coming, as ringing sound of cell phone, this music excerpt is provided to the private custom ringtone needed for user, meets not With user's demand to the tinkle of bells.
Under prior art, the method for audio clips is to process original audio data, parses each Audio data frame, abandons the Frame outside editing scope, by the audio data frame retained and header file It is packaged into the audio file of a new small volume, when playing, directly plays the audio file after editing ?.
But, under prior art, when audio file is carried out editing, unwanted Frame is abandoned, this Audio file after sample makes editing does not have restorability, and required editing operation can not be repeated.
Summary of the invention
The embodiment of the present invention provides the method and device of a kind of audio clips, to solve in prior art after editing The expendable problem of audio file.
The concrete technical scheme that the embodiment of the present invention provides is as follows:
A kind of method of audio clips, including:
Obtain audio file to be played;
Each Frame being successively read in above-mentioned audio file, wherein, often reads a Frame, sentences In the disconnected current Frame read, whether the value of specific field is to set numerical value, the most then skip above-mentioned working as The Frame of front reading, otherwise, plays the Frame of above-mentioned current reading.
A kind of device of audio clips, including:
Acquiring unit, for obtaining audio file to be played;
Processing unit, for each Frame being successively read in above-mentioned audio file, wherein, often reads One Frame, it is judged that in the current Frame read, whether the value of specific field is to set numerical value, if so, Then skip the Frame of above-mentioned current reading, otherwise, play the Frame of above-mentioned current reading.
Beneficial effects of the present invention is as follows:
In the embodiment of the present invention, obtain audio file to be played, be successively read each in audio file Frame, wherein, often reads a Frame, it is judged that the value of specific field in the current Frame read Be whether to set numerical value, the most then skip the Frame of above-mentioned current reading, otherwise, play above-mentioned currently The Frame read, so, when playing audio file, adds a judgement so that the Frame of broadcasting For the desired audio-frequency unit of user, not only meet the editing demand of user, also, it is not necessary to abandon data Frame, remains the complete information of audio file, more can meet user's request.
Further, will not belong to the value of specific field in the Frame of editing time range in advance be revised as setting Numerical value, when playing, carries out judging i.e. to obtain user's desired editing audio frequency, it is not necessary to abandon Frame, Audio file after making editing can revert to original audio file, it is also possible to carries out editing repeatedly, more Add flexibly, can preferably meet the demand of user.
Accompanying drawing explanation
Fig. 1 is in the embodiment of the present invention, the structure of the audio file of mp3 form;
Fig. 2 is in the embodiment of the present invention, the method general introduction flow chart of audio clips;
Fig. 3 is in the embodiment of the present invention, the method detail flowchart of audio clips;
Fig. 4 is in the embodiment of the present invention, the apparatus structure schematic diagram of audio clips.
Detailed description of the invention
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clearly Chu, it is fully described by, it is clear that described embodiment is only a part of embodiment of the present invention, is not Whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art are not making creation The every other embodiment obtained under property work premise, broadly falls into the scope of protection of the invention.
In order to solve in prior art the expendable problem of audio file after editing, the embodiment of the present invention In, unwanted Frame need not be abandoned, and simply revise the value of specific field, play audio file Time, judge in each current read data frame, whether the value of specific field is to set numerical value, if really respectively Determine not, then play the current Frame read.
Being described in detail the present invention program below by specific embodiment, certainly, the present invention is not limited to Following example.
What deserves to be explained is, the embodiment of the present invention, as a example by the audio file of mp3 form, naturally it is also possible to Each Frame being applied to other audio file similar with mp3 form, i.e. audio file has one Frame originating point information, and in frame originating point information, include the field being similar to specific field effect, such as, amr lattice The audio file of formula.Following is a brief introduction of the structure of the audio file of lower mp3 form.
Referring particularly to shown in Fig. 1, the audio file of mp3 form is to be made up of frame, and frame is the sound of mp3 form The minimum composition unit of frequency file.Every frame all comprises frame head, it is possible to calculate the length of frame.Property according to frame Matter is different, and mp3 file is substantially broadly divided into three part: TAG_V2 (ID3V2) label frames, data Frame and TAG_V1 (ID3V1) label frame, wherein, referring particularly to shown in table 1,
The audio file structure of table 1mp3 form
1) TAG_V2 (ID3V2) label frame, is by a tag head and several label frames or an expansion Exhibition tag head composition, tag head is sequentially stored in the stem of the audio file of mp3 form together with label frame.
2) TAG_V1 (ID3V1) label frame, including altogether 128 bytes, including the title of song, Singer, the details such as special edition, it is placed on the afterbody of the audio file of mp3 form.
Wherein, the audio file of current mp3 form the most all comprises ID3V2 and ID3V1, but is not must Need, can not have.
3) Frame, typically has multiple, and audio file size and data frame sign by mp3 form are come certainly Fixed.One Frame is made up of frame head, additional information, voice data three part.Frame head is important Information, is positioned at the beginning of each Frame, and size is typically 32 (bit) (if Protection is bit Be 1, the most also want frame head finally to add the check bit of 16bit), wherein, the long form of frame head referring particularly to Shown in table 2.
The form of the frame head of the Frame of the audio file of table 2mp3 form
Refering to shown in Fig. 2, in the embodiment of the present invention, the idiographic flow of audio clips method is as follows:
Step 100: obtain audio file to be played.
Before performing step 100, farther include: according to default editing time range, at above-mentioned sound Frequency file filters out the Frame being not belonging to above-mentioned editing time range, and the Frame middle finger that will filter out The value determining field is revised as setting numerical value.
Wherein, above-mentioned specific field is the reserved field in Frame, or, for the free word in Frame Section;Or, for the specified sign position in Frame.For the audio file of mp3 form, above-mentioned designated word Section is the reserved word in the frame head of Frame.
Further, it is also desirable to the relevant information in amendment ID3V2 label frame, such as, according to filter out The length of Frame, in amendment ID3V2 label frame, the value of the audio file length of record, the most amended Value is: the length of the Frame of original value-filter out, and amended value represents the literary composition of the audio frequency after editing The length of part.
In reality, the value of reserved word of record in Frame, it is defaulted as 0, and, this position does not has It is used to represent any information, therefore, the value on this position is modified and will not be broadcast audio file Put generation impact.Such as, for the Frame being not belonging to editing time range filtered out, can be by corresponding The value of reserved word be revised as 1.
Step 110: each Frame being successively read in above-mentioned audio file, wherein, often reads one Frame, it is judged that in the current Frame read, whether the value of specific field is to set numerical value, the most then Skip the Frame of above-mentioned current reading, otherwise, play the Frame of above-mentioned current reading.
As a example by the audio file of mp3 form, when performing step 110, specifically include:
First, the Frame in above-mentioned audio file is read.
Then, the frame originating point information of the current Frame read of parsing, and the reserved word in getting frame header Value.
Finally, it is judged that in the current Frame read, whether the value of the reserved word of record is to set numerical value, if It is then to skip, and reads next Frame, otherwise, play the current Frame read.
So, playing out audio frequency is the part audio frequency in default editing time range, meets the editing of user Demand, and, the audio clips method in the embodiment of the present invention, the complete information of audio file can be retained, Need not abandon unwanted Frame, the audio file after editing can recover, and can carry out audio file Editing repeatedly or recovery operation, more flexibly, more can meet user's request.
Use a concrete application scenarios that above-described embodiment is made further description below.Concrete ginseng Read shown in Fig. 3, as a example by the audio file of mp3 form, in the embodiment of the present invention, audio clips method Execution process is specific as follows:
Step 200: read data frame.
Particularly as follows: obtain audio file to be played, and each data being successively read in this audio file Frame.
Step 201: resolve the frame originating point information of Frame.
Step 202: read the value of the reserved word of record in frame head.
Step 203: whether the value judging reserved word is to set numerical value, the most then perform step 205, Otherwise, step 204 is performed.
In reality, in Frame, the value of the reserved word of record is 0, and is not used to represent any information, According to default editing time range, will not belong to the reserved word of record in the Frame of editing time range Value is revised as setting numerical value.
Step 204: play the current Frame read.
It is to say, determine that the value of reserved word is not to set numerical value, illustrate that this Frame belongs to the editing time In the range of, for the Frame needed.
Step 205: skip the Frame of current reading.
It is to say, determine that the value of reserved word is to set numerical value, illustrate that this Frame is not belonging to the editing time In the range of, for unwanted Frame, directly skip, so, it is pre-that the audio file played out is user If editing time range in part.
Based on above-described embodiment, refering to shown in Fig. 4, in the embodiment of the present invention, audio clips device, specifically Including:
Acquiring unit 30, for obtaining audio file to be played;
Processing unit 31, for each Frame being successively read in above-mentioned audio file, wherein, often reads Take a Frame, it is judged that in the current Frame read, whether the value of specific field is to set numerical value, if It is then to skip the Frame of above-mentioned current reading, otherwise, play the Frame of above-mentioned current reading.
It is also preferred that the left before obtaining audio file to be played, farther include:
Amendment unit 32, for according to the editing time range preset, filtering out not in above-mentioned audio file Belong to the Frame of above-mentioned editing time range, and the value of above-mentioned specific field in the Frame that will filter out It is revised as above-mentioned setting numerical value.
It is also preferred that the left above-mentioned specific field is the reserved field in above-mentioned Frame, or, for above-mentioned Frame In spare field;Or, for the specified sign position in above-mentioned Frame.
It is also preferred that the left above-mentioned audio file, include multiple Frame, and each Frame has a frame Header.
It is also preferred that the left often read a Frame, it is judged that in the current Frame read, the value of specific field is No for set numerical value time, processing unit 31 specifically for:
Often read a Frame, resolve the frame originating point information of the current Frame read, and getting frame header In the value of specific field, and judge in the current Frame read the value of above-mentioned specific field is whether For setting numerical value.
In sum, in the embodiment of the present invention, obtain audio file to be played;It is successively read above-mentioned audio frequency Each Frame in file, wherein, often reads a Frame, it is judged that in the current Frame read Whether the value of the reserved word of record is to set numerical value, the most then skip the Frame of above-mentioned current reading, Otherwise, playing the Frame of above-mentioned current reading, so, the Frame of broadcasting is the desired audio portion of user Point, not only meet the editing demand of user, and, do not abandon Frame, remain audio file Complete information so that the audio file after editing can revert to original audio file, it is also possible to carry out anti- Complex shears is collected, and more flexibly, preferably meets the demand of user.
Further, will not belong to the value of the reserved word of record in the Frame of editing time range in advance be revised as Set numerical value, when playing, carry out judging i.e. can only play the Frame in editing time range, it is not necessary to Abandon Frame.
Those skilled in the art are it should be appreciated that embodiments of the invention can be provided as method, system or meter Calculation machine program product.Therefore, the present invention can use complete hardware embodiment, complete software implementation or knot The form of the embodiment in terms of conjunction software and hardware.And, the present invention can use and wherein wrap one or more Computer-usable storage medium containing computer usable program code (include but not limited to disk memory, CD-ROM, optical memory etc.) form of the upper computer program implemented.
The present invention is with reference to method, equipment (system) and computer program product according to embodiments of the present invention The flow chart of product and/or block diagram describe.It should be understood that can by computer program instructions flowchart and / or block diagram in each flow process and/or flow process in square frame and flow chart and/or block diagram and/ Or the combination of square frame.These computer program instructions can be provided to general purpose computer, special-purpose computer, embedding The processor of formula datatron or other programmable data processing device is to produce a machine so that by calculating The instruction that the processor of machine or other programmable data processing device performs produces for realizing at flow chart one The device of the function specified in individual flow process or multiple flow process and/or one square frame of block diagram or multiple square frame.
These computer program instructions may be alternatively stored in and computer or the process of other programmable datas can be guided to set In the standby computer-readable memory worked in a specific way so that be stored in this computer-readable memory Instruction produce and include the manufacture of command device, this command device realizes in one flow process or multiple of flow chart The function specified in flow process and/or one square frame of block diagram or multiple square frame.
These computer program instructions also can be loaded in computer or other programmable data processing device, makes Sequence of operations step must be performed to produce computer implemented place on computer or other programmable devices Reason, thus the instruction performed on computer or other programmable devices provides for realizing flow chart one The step of the function specified in flow process or multiple flow process and/or one square frame of block diagram or multiple square frame.
Although preferred embodiments of the present invention have been described, but those skilled in the art once know base This creativeness concept, then can make other change and amendment to these embodiments.So, appended right is wanted Ask and be intended to be construed to include preferred embodiment and fall into all changes and the amendment of the scope of the invention.
Obviously, those skilled in the art can carry out various change and modification to the embodiment of the present invention and not take off Spirit and scope from the embodiment of the present invention.So, if these amendments of the embodiment of the present invention and modification belong to Within the scope of the claims in the present invention and equivalent technologies thereof, then the present invention be also intended to comprise these change and Including modification.

Claims (10)

1. the method for an audio clips, it is characterised in that including:
Obtain audio file to be played;
Each Frame being successively read in described audio file, wherein, often reads a Frame, sentences In the disconnected current Frame read, whether the value of specific field is to set numerical value, the most then skip described working as The Frame of front reading, otherwise, plays the Frame of described current reading.
2. the method for claim 1, it is characterised in that before obtaining audio file to be played, Farther include:
According to default editing time range, filter out in described audio file and be not belonging to the described editing time The Frame of scope, and the value of specific field described in the Frame that will filter out is revised as described setting number Value.
3. the method for claim 1, it is characterised in that described specific field is described Frame In reserved field, or, for the spare field in described Frame;Or, in described Frame Specified sign position.
4. the method as described in any one of claim 1-3, it is characterised in that described audio file, bag Containing multiple Frames, and each Frame has a frame originating point information.
5. method as claimed in claim 4, it is characterised in that often read a Frame, it is judged that when In the Frame of front reading, whether the value of specific field is to set numerical value, specifically includes:
Often read a Frame, resolve the frame originating point information of the current Frame read, and getting frame header In the value of specific field, and whether judge the value of specific field described in the current Frame read For setting numerical value.
6. the device of an audio clips, it is characterised in that including:
Acquiring unit, for obtaining audio file to be played;
Processing unit, for each Frame being successively read in described audio file, wherein, often reads One Frame, it is judged that in the current Frame read, whether the value of specific field is to set numerical value, if so, Then skip the Frame of described current reading, otherwise, play the Frame of described current reading.
7. device as claimed in claim 6, it is characterised in that before obtaining audio file to be played, Farther include:
Amendment unit, for according to the editing time range preset, filtering out and not belonging in described audio file In the Frame of described editing time range, and described in the Frame that will filter out, the value of specific field is repaiied Change described setting numerical value into.
8. device as claimed in claim 6, it is characterised in that described specific field is described Frame In reserved field, or, for the spare field in described Frame;Or, in described Frame Specified sign position.
9. the device as described in any one of claim 6-8, it is characterised in that described audio file, bag Containing multiple Frames, and each Frame has a frame originating point information.
10. device as claimed in claim 9, it is characterised in that often read a Frame, it is judged that when When in the Frame of front reading, whether the value of specific field is to set numerical value, processing unit specifically for:
Often read a Frame, resolve the frame originating point information of the current Frame read, and getting frame header In the value of specific field, and whether judge the value of specific field described in the current Frame read For setting numerical value.
CN201610231146.6A 2016-04-14 2016-04-14 A kind of method and device of audio clips Active CN105931656B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610231146.6A CN105931656B (en) 2016-04-14 2016-04-14 A kind of method and device of audio clips

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610231146.6A CN105931656B (en) 2016-04-14 2016-04-14 A kind of method and device of audio clips

Publications (2)

Publication Number Publication Date
CN105931656A true CN105931656A (en) 2016-09-07
CN105931656B CN105931656B (en) 2019-07-05

Family

ID=56838077

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610231146.6A Active CN105931656B (en) 2016-04-14 2016-04-14 A kind of method and device of audio clips

Country Status (1)

Country Link
CN (1) CN105931656B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108735239A (en) * 2018-04-08 2018-11-02 平安科技(深圳)有限公司 A kind of control method and terminal device of audio broadcasting

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101149962A (en) * 2006-09-22 2008-03-26 无锡盈泰科技有限公司 Error correction method for playing view window multimedia audio frequency song in multimedia product
CN101986388A (en) * 2010-09-06 2011-03-16 建荣集成电路科技(珠海)有限公司 MP3 intelligent error detection method
CN102754159A (en) * 2009-10-19 2012-10-24 杜比国际公司 Metadata time marking information for indicating a section of an audio object
CN102930887A (en) * 2012-10-31 2013-02-13 深圳市宜搜科技发展有限公司 Audio file processing method and system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101149962A (en) * 2006-09-22 2008-03-26 无锡盈泰科技有限公司 Error correction method for playing view window multimedia audio frequency song in multimedia product
CN102754159A (en) * 2009-10-19 2012-10-24 杜比国际公司 Metadata time marking information for indicating a section of an audio object
CN101986388A (en) * 2010-09-06 2011-03-16 建荣集成电路科技(珠海)有限公司 MP3 intelligent error detection method
CN102930887A (en) * 2012-10-31 2013-02-13 深圳市宜搜科技发展有限公司 Audio file processing method and system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108735239A (en) * 2018-04-08 2018-11-02 平安科技(深圳)有限公司 A kind of control method and terminal device of audio broadcasting
CN108735239B (en) * 2018-04-08 2021-05-04 平安科技(深圳)有限公司 Audio playing control method and terminal equipment

Also Published As

Publication number Publication date
CN105931656B (en) 2019-07-05

Similar Documents

Publication Publication Date Title
CN105810211B (en) A kind of processing method and terminal of audio data
CN101996627B (en) Speech processing apparatus, speech processing method and program
CN106653037B (en) Audio data processing method and device
KR20080000203A (en) Method for searching music file using voice recognition
CN103677821B (en) The method and apparatus of Software Development Tools code publication
US20100049349A1 (en) Method and apparatus for playing audio files
CN108053696A (en) A kind of method, apparatus and terminal device that sound broadcasting is carried out according to reading content
CN104185088B (en) A kind of method for processing video frequency and device
CN106155470A (en) A kind of audio file generation method and device
CN104768025A (en) Method and device for repairing bad frames in video
CN107248415A (en) A kind of method, device and the user terminal of ring of alarm clock generation
CN104601535B (en) Method for processing video frequency and system
CN101641733B (en) Method and apparatus for encoding audio signal, and method and apparatus for decoding audio signal
CN105931656A (en) Audio editing method and device
CN101540184B (en) Method and apparatus for reproducing first part of music data having plurality of repeated parts
JP2006171579A (en) Speech reproducing program and recording medium therefor, speech reproducing device, and speech reproducing method
JP2013528823A (en) Audio data storage method and apparatus
JP2013528823A5 (en)
JP5533865B2 (en) Editing support system, editing support method, and editing support program
CN104768083B (en) A kind of video broadcasting method and device of chapters and sections content displaying
CN105957542B (en) A kind of audio file editing method and device
CN113963674A (en) Work generation method and device, electronic equipment and storage medium
CN104869233B (en) A kind of way of recording
TWI435319B (en) Automatic voice signal and mute signal processing device and method therefor
JP4407119B2 (en) Instruction code creation device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into 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: 266071 Shandong city of Qingdao province Jiangxi City Road No. 11

Patentee after: Qingdao Hisense Mobile Communication Technology Co.,Ltd.

Address before: 266071 Shandong city of Qingdao province Jiangxi City Road No. 11

Patentee before: HISENSE MOBILE COMMUNICATIONS TECHNOLOGY Co.,Ltd.

CP01 Change in the name or title of a patent holder