Summary of the invention
In view of this, the technical problem to be solved in the present invention is to provide the processing method and processing device of audio file, with solve prior art because of voice data encrypted format change cannot normal play, the file causing user to take for receiving be damage audio file and cause unnecessary trouble.
It is as follows that the present invention solves the technical scheme that above-mentioned technical problem used:
According to an aspect of the present invention, it is provided that the processing method of a kind of audio file, comprise the steps: to obtain to need voice data to be processed;Voice data to be processed to described need is encrypted, and generates encrypted audio data;Obtain the prompting voice data that voice data to be processed to described need is relevant;Described prompting voice data and described encrypted audio data being encapsulated in successively in the voice data of described audio file, the form of wherein said audio file supports the coded format of described prompting voice data.
A kind of method as above is provided, described described prompting voice data and described encrypted audio data are encapsulated in the voice data of described audio file successively after, described method also includes: when audio file play by needs, it is judged that whether include encrypted audio data in the voice data in described audio file;If including encrypted audio data, then before playing described encrypted audio data, play described prompting voice data.
Thering is provided a kind of method as above, described prompting voice data and described encrypted audio data are encapsulated in the voice data of audio file by described prompting successively, including: obtain the template of described audio file;Described prompting voice data is inserted the initial position of the voice data of described audio file template;After described encrypted audio data is inserted described prompting voice data;The length of a length of described prompting voice data of voice data in the file header of described audio file template and the length sum of described encrypted audio data.
A kind of method as above is provided, after described prompting voice data and described encrypted audio data are encapsulated in the voice data of described audio file by described life successively, described method also includes, calculating the described encrypted audio data deviation post from described audio file beginning, wherein said deviation post is the length length sum with described prompting voice data of the file header of described audio file;Described voice data is extracted after described deviation post.
Thering is provided a kind of method as above, the coded format of described prompting voice data includes pcm format;The form of described audio file includes Waveform data format.
According to another aspect of the present invention, it is provided that the processing means of a kind of audio file, described device includes: the first acquiring unit, and being used for obtaining needs voice data to be processed;Ciphering unit, is encrypted for voice data to be processed to described need, generates encrypted audio data;Second acquisition unit, for obtaining the prompting voice data relevant to described voice data;Signal generating unit, for described prompting voice data and described encrypted audio data being encapsulated in successively in the voice data of described audio file, the form of wherein said audio file supports the coded format of described prompting voice data.
Thering is provided a kind of device as above, described device also includes: judging unit, for when playing audio file when needs, it is judged that whether include encrypted audio data in the voice data in described audio file;Broadcast unit, for when described judging unit judges to include encrypted audio data, then playing described prompting voice data before playing described encrypted audio data.
Thering is provided a kind of device as above, described signal generating unit includes: acquisition module, for obtaining the template of described audio file;Package module, for described prompting voice data being inserted the initial position of the voice data of described audio file template, and after described encrypted audio data is inserted described prompting voice data, the length of a length of described prompting voice data of voice data in the file header of wherein said audio file template and the length sum of described encrypted audio data.
A kind of device as above is provided, described device also includes: computing unit, for calculating the described encrypted audio data deviation post from described audio file beginning, wherein said deviation post is the length length sum with described prompting voice data of the file header of described audio file;Extraction unit, for extracting described voice data after the described deviation post that described computing unit calculates.
A kind of device as above, described second acquisition unit are provided, are additionally operable to obtain the prompting pcm format voice data relevant to described voice data;Described signal generating unit, is additionally operable to generate the audio file of the Waveform data format carrying described encrypted audio data and described prompting voice data.
The processing method and processing device of the audio file of the present invention, existing audio file is used to carry the voice data of encryption and relative prompting voice data, can the coded format of compatible multiple voice data and AES, when voice data is encrypted, the prompting voice data relevant to described voice data is inserted before the voice data of encryption, even if only with common player, also may be read into information, and the voice data of encryption is only play noise, while not revealing encrypted voice data, prompting user's this document contains the voice data of encryption, user is avoided to misunderstand the audio file of encryption damaged, prevent from causing unnecessary trouble.
Detailed description of the invention
In order to make the technical problem to be solved, technical scheme and beneficial effect clearer, clear, below in conjunction with drawings and Examples, the present invention is further elaborated.Should be appreciated that specific embodiment described herein, only in order to explain the present invention, is not intended to limit the present invention.
This law provides the processing method of a kind of audio file, refers to Fig. 1, and method flow includes:
S110, acquisition need voice data to be processed.
S120, voice data to be processed to described need are encrypted, and generate encrypted audio data.
S130, the prompting voice data that acquisition voice data to be processed to described need is relevant.
Concrete, this prompting voice data can use the information prerecorded by user or be recorded during voice data to be processed to these need processes by user temporarily.This prompting voice data can comprise the customized voice of copyright notice, such as voice " document that you are opened need to be deleted the most immediately " through XX organizational empowerment.
S140, described prompting voice data and described encrypted audio data being encapsulated in successively in the voice data of described audio file, the form of wherein said audio file supports the coded format of described prompting voice data.
Concrete, the form of described audio file can be Waveform data format (Waveform, Wav), the coded format of the most described prompting voice data can be the coded format that the Wav audio files such as pcm format (PulseCodeModulation, PCM) are supported.
In actual application, it would however also be possible to employ the audio file (such as mp3, aac, amr etc.) of extended formatting, and its coded format supported is used to obtain prompting voice data.
Further, after described step S140, described method also includes:
When audio file play by needs, it is judged that whether the voice data in described audio file includes encrypted audio data;
If including encrypted audio data, then before playing described encrypted audio data, play described prompting voice data.
Concrete, if voice data is encrypted, owing to can not directly decode and play through the voice data of encryption, as a example by Wav audio file, when this Wav audio file is opened, not encrypted PCM audio data still can play, but when being played to the voice data position of encryption, can only play out one section of noise.When user hears the PCM audio data of broadcasting, corresponding prompting just can be obtained.
Further, step S140 includes:
Obtain the template of described audio file;
Described prompting voice data is inserted the initial position of the voice data of described audio file template;
After described encrypted audio data is inserted described prompting voice data;
Voice data length in the file header of described audio file template is set to length and the length sum of described encrypted audio data of described prompting voice data.
Concrete, refer to Fig. 2.As a example by Wav audio file, Wav file includes file header and voice data.Header file includes: identifier, size of data, Format Type, Wav head data and voice data length.Voice data is PCM data.
When described voice data and described PCM audio data are carried in generation, PCM audio data and voice data are put into the position of voice data: PCM audio data is placed on the beginning of voice data, after the voice data of encryption is then placed on PCM audio data.
Further, after step S140, described method also includes: calculate the described encrypted audio data deviation post from described audio file beginning, and wherein said deviation post is the length length sum with described prompting voice data of the file header of described audio file;
Described voice data is extracted after described deviation post.
Concrete, refer to Fig. 3.Still as a example by Wav audio file, when voice data is reduced by needs, encrypted voice data can be taken out from Wav file, then be decrypted.
As can be seen from Figure 3, the position of voice data is from the file header length+x that the deviation post that Wav file starts is Wav file, and wherein x is PCM audio data, and its length is the most confirmable after PCM audio data is recorded, and the file header length of Wav file is usually full-length, it is 44 bytes.
The data taken out after deviation post are all voice datas.
It should be noted that the present embodiment is according to Wav file format, then can be completely compatible with existing form and AES, embodiment can be flexibly applied to the project developed, need not redesign, it is possible to reduce and transplant and the cost of exploitation.
The processing method of the audio file of the present embodiment, existing audio file is used to carry the voice data of encryption and relative prompting voice data, can the coded format of compatible multiple voice data and AES, when voice data is encrypted, the prompting voice data relevant to described voice data is inserted before the voice data of encryption, even if only with common player, also may be read into information, and the voice data of encryption is only play noise, while not revealing encrypted voice data, prompting user's this document contains the voice data of encryption, user is avoided to misunderstand the audio file of encryption damaged, prevent from causing unnecessary trouble.
On the basis of above-described embodiment, present invention also offers the processing means of a kind of audio file, refer to Fig. 4, this device includes:
First acquiring unit 410, being used for obtaining needs voice data to be processed.
Ciphering unit 420, is encrypted for voice data to be processed to described need, generates encrypted audio data;
Second acquisition unit 430, for obtaining the prompting voice data relevant to described voice data;
Signal generating unit 440, for described prompting voice data and described encrypted audio data being encapsulated in successively in the voice data of described audio file, the form of wherein said audio file supports the coded format of described prompting voice data.
Further, this device also includes:
Judging unit 450, for when audio file play by needs, it is judged that whether include encrypted audio data in the voice data in described audio file;
Broadcast unit 460, for when described judging unit 450 judges to include encrypted audio data, then playing described prompting voice data before playing described encrypted audio data.
Further, described signal generating unit 440 includes:
Acquisition module, for obtaining the template of described audio file;
Package module, for described prompting voice data being inserted the initial position of the voice data of described audio file template, and after described encrypted audio data is inserted described prompting voice data, the length of a length of described prompting voice data of voice data in the file header of wherein said audio file template and the length sum of described encrypted audio data.
Further, this device also includes:
Computing unit 470, for calculating the described encrypted audio data deviation post from described audio file beginning, wherein said deviation post is the length length sum with described prompting voice data of the file header of described audio file;
Extraction unit 480, for extracting described voice data after the described deviation post that described computing unit calculates.
Further, described second acquisition unit 430, it is additionally operable to obtain the voice data of the prompting pcm format relevant to described voice data;
Described signal generating unit 440, is additionally operable to generate the audio file of the Waveform data format carrying described encrypted audio data and described prompting voice data.
In actual application, it would however also be possible to employ the audio file (such as mp3, aac, amr etc.) of extended formatting, and its coded format supported is used to obtain prompting voice data
nullThe processing means of the audio file of the present embodiment,Existing audio file is used to carry the voice data of encryption and relative prompting voice data,After the first acquiring unit and second acquisition unit obtain voice data and relative prompting voice data,Utilize signal generating unit to generate audio file and carry voice data and the prompting voice data of encryption,The form of the most compatible multiple voice data and AES,When voice data is encrypted,Owing to inserting relative prompting voice data before voice data,Even if only with common player,Also may be read into information,And the voice data of encryption is only play noise,While not revealing encrypted voice data,Prompting user's this document contains the voice data of encryption,User is avoided to misunderstand the audio file of encryption damaged,Prevent from causing unnecessary trouble
Illustrate the preferred embodiments of the present invention above by reference to accompanying drawing, not thereby limit to the interest field of the present invention.Those skilled in the art, all should be within the interest field of the present invention without departing from any amendment, equivalent and the improvement made in the scope of the present invention and essence.