Summary of the invention
In view of this, the technical problem to be solved in the present invention is to provide disposal route and the device of audio file, with solve prior art because of the change of voice data encrypted format cannot normal play, the file causing user to take for receiving is the audio file that damages and causes unnecessary trouble.
It is as follows that the present invention solves the problems of the technologies described above adopted technical scheme:
According to an aspect of the present invention, provide a kind of disposal route of audio file, comprising the steps: to obtain needs voice data to be processed; Described need voice data to be processed is encrypted, generates encrypted audio data; Obtain the prompt tone audio data relevant to described need voice data to be processed; Be encapsulated in the voice data of described audio file successively by described prompt tone audio data and described encrypted audio data, the form of wherein said audio file supports the coded format of described prompt tone audio data.
A kind of method as above is provided, described described prompt tone audio data and described encrypted audio data are encapsulated in the voice data of described audio file successively after, described method also comprises: when needs displaying audio file, judges whether comprise encrypted audio data in the voice data in described audio file; If comprise encrypted audio data, then before the described encrypted audio data of broadcasting, play described prompt tone audio data.
There is provided a kind of method as above, described prompt tone audio data and described encrypted audio data are encapsulated in the voice data of audio file by described prompting successively, comprising: the template obtaining described audio file; Described prompt tone audio data is inserted the initial position of the voice data of described audio file template; After described encrypted audio data is inserted described prompt tone audio data; Voice data length in the file header of described audio file template is the length of described prompt tone audio data and the length sum of described encrypted audio data.
A kind of method as above is provided, after described prompt tone audio data and described encrypted audio data are encapsulated in the voice data of described audio file by described life successively, described method also comprises, calculate the deviation post of described encrypted audio data from described audio file beginning, wherein said deviation post is the length of the file header of described audio file and the length sum of described prompt tone audio data; Described voice data is extracted after described deviation post.
There is provided a kind of method as above, the coded format of described prompt tone audio data comprises pcm format; The form of described audio file comprises Waveform data format.
According to another aspect of the present invention, provide a kind for the treatment of apparatus of audio file, described device comprises: the first acquiring unit, needs voice data to be processed for obtaining; Ciphering unit, is encrypted for described need voice data to be processed, generates encrypted audio data; Second acquisition unit, for obtaining the prompt tone audio data relevant to described voice data; Generation unit, for being encapsulated in the voice data of described audio file successively by described prompt tone audio data and described encrypted audio data, the form of wherein said audio file supports the coded format of described prompt tone audio data.
There is provided a kind of device as above, described device also comprises: judging unit, for when when needs displaying audio file, judges whether comprise encrypted audio data in the voice data in described audio file; Broadcast unit, during for judging to comprise encrypted audio data at described judging unit, then play described prompt tone audio data before the described encrypted audio data of broadcasting.
There is provided a kind of device as above, described generation unit comprises: acquisition module, for obtaining the template of described audio file; Package module, for described prompt tone audio data being inserted the initial position of the voice data of described audio file template, and after described encrypted audio data is inserted described prompt tone audio data, the voice data length in the file header of wherein said audio file template is the length of described prompt tone audio data and the length sum of described encrypted audio data.
A kind of device as above is provided, described device also comprises: computing unit, for calculating the deviation post of described encrypted audio data from described audio file beginning, wherein said deviation post is the length of the file header of described audio file and the length sum of described prompt tone audio data; Extraction unit, for extracting described voice data after the described deviation post that described computing unit calculates.
There is provided a kind of device as above, described second acquisition unit, also for obtaining the prompting pcm format voice data relevant to described voice data; Described generation unit, also for generating the audio file of the Waveform data format carrying described encrypted audio data and described prompt tone audio data.
The disposal route of audio file of the present invention and device, existing audio file is adopted to carry the voice data of encryption and relative prompt tone audio data, can the coded format of compatible multiple voice data and cryptographic algorithm, when voice data is encrypted, the prompt tone audio data relevant to described voice data is inserted before the voice data of encryption, even if only adopt common player, also may be read into information, and only noise is broadcast to the voice data of encryption, while not revealing encrypted voice data, the voice data of encryption is contained in this file of prompting user, user is avoided to misunderstand the audio file number of encryption damaged, prevent from causing unnecessary trouble.
Embodiment
In order to make technical matters to be solved by this invention, technical scheme and beneficial effect clearly, understand, 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, be not intended to limit the present invention.
This law provides a kind of disposal route of audio file, refers to Fig. 1, and method flow comprises:
S110, acquisition need voice data to be processed.
S120, described need voice data to be processed to be encrypted, to generate encrypted audio number.
S130, the prompt tone audio data that acquisition is relevant to described need voice data to be processed.
Concrete, this prompt tone audio data can adopt the information prerecorded by user or be recorded in the process processed these need voice data to be processed by user temporarily.This prompt tone audio data can comprise the customized voice of copyright notice, such as voice " document that you open through XX organizational empowerment, otherwise please need be deleted immediately ".
S140, be encapsulated in the voice data of described audio file successively by described prompt tone audio data and described encrypted audio data, the form of wherein said audio file supports the coded format of described prompt tone audio data.
Concrete, the form of described audio file can be Waveform data format (Waveform, Wav), then the coded format of described prompt tone audio data can be the coded format that the Wav audio files such as pcm format (Pulse Code Modulation, PCM) are supported; .
In practical application, also can adopt the audio file (as mp3, aac, amr etc.) of extended formatting, and the coded format adopting it to support obtains prompt tone audio data.
Further, after described step S140, described method also comprises:
When needs displaying audio file, judge whether comprise encrypted audio data in the voice data in described audio file;
If comprise encrypted audio data, then before the described encrypted audio data of broadcasting, play described prompt tone audio data.
Concrete, if voice data is encrypted, owing to can not directly decode through the voice data of encryption and play, for Wav audio file, when this Wav audio file is opened, not encrypted pcm audio data still can be 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, just corresponding prompting can be obtained.
Further, step S140 comprises:
Obtain the template of described audio file;
Described prompt tone audio data is inserted the initial position of the voice data of described audio file template;
After described encrypted audio data is inserted described prompt tone audio data;
Voice data length in the file header of described audio file template is set to the length of described prompt tone audio data and the length sum of described encrypted audio data.
Concrete, refer to Fig. 2.For Wav audio file, Wav file comprises file header and voice data.Header file comprises: 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 are 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 comprises: calculate the deviation post of described encrypted audio data from described audio file beginning, and wherein said deviation post is the length of the file header of described audio file and the length sum of described prompt tone audio data;
Described voice data is extracted after described deviation post.
Concrete, refer to Fig. 3.Still for Wav audio file, when needs reduce to voice data, encrypted voice data can be gone out from Wav file, then be decrypted.
As can be seen from Figure 3, the deviation post of position from wav file of voice data is the file header length+x of Wav file, and wherein x is pcm audio data, and its length is namely confirmable after pcm audio data recording, and the file header length of Wav file is generally standard length, be 44 bytes.
All voice data from the data of taking out after deviation post.
It should be noted that, the present embodiment according to Wav file layout, then can with existing form and cryptographic algorithm completely compatible, by embodiment flexible Application in the project developed, need not be able to redesign, can reduce transplant and exploitation cost.
The disposal route of the audio file of the present embodiment, existing audio file is adopted to carry the voice data of encryption and relative prompt tone audio data, can the coded format of compatible multiple voice data and cryptographic algorithm, when voice data is encrypted, the prompt tone audio data relevant to described voice data is inserted before the voice data of encryption, even if only adopt common player, also may be read into information, and only noise is broadcast to the voice data of encryption, while not revealing encrypted voice data, the voice data of encryption is contained in this file of prompting user, user is avoided to misunderstand the audio file number of encryption damaged, prevent from causing unnecessary trouble.
On the basis of above-described embodiment, present invention also offers a kind for the treatment of apparatus of audio file, refer to Fig. 4, this device comprises:
First acquiring unit 410, needs voice data to be processed for obtaining.
Ciphering unit 420, is encrypted for described need voice data to be processed, generates encrypted audio data;
Second acquisition unit 430, for obtaining the prompt tone audio data relevant to described voice data;
Generation unit 440, for being encapsulated in the voice data of described audio file successively by described prompt tone audio data and described encrypted audio data, the form of wherein said audio file supports the coded format of described prompt tone audio data.
Further, this device also comprises:
Judging unit 450, for when needs displaying audio file, judges whether comprise encrypted audio data in the voice data in described audio file;
Broadcast unit 460, during for judging to comprise encrypted audio data at described judging unit 450, then play described prompt tone audio data before the described encrypted audio data of broadcasting.
Further, described generation unit 440 comprises:
Acquisition module, for obtaining the template of described audio file;
Package module, for described prompt tone audio data being inserted the initial position of the voice data of described audio file template, and after described encrypted audio data is inserted described prompt tone audio data, the voice data length in the file header of wherein said audio file template is the length of described prompt tone audio data and the length sum of described encrypted audio data.
Further, this device also comprises:
Computing unit 470, for calculating the deviation post of described encrypted audio data from described audio file beginning, wherein said deviation post is the length of the file header of described audio file and the length sum of described prompt tone audio data;
Extraction unit 480, for extracting described voice data after the described deviation post that described computing unit calculates.
Further, described second acquisition unit 430, also for obtaining the voice data of the prompting pcm format relevant to described voice data;
Described generation unit 440, also for generating the audio file of the Waveform data format carrying described encrypted audio data and described prompt tone audio data.
In practical application, also can adopt the audio file (as mp3, aac, amr etc.) of extended formatting, and the coded format adopting it to support obtains prompt tone audio data
The treating apparatus of the audio file of the present embodiment, existing audio file is adopted to carry the voice data of encryption and relative prompt tone audio data, after the first acquiring unit and second acquisition unit obtain voice data and relative prompt tone audio data, generation unit generation audio file is utilized to carry voice data and the prompt tone audio data of encryption, therefore the form of compatible multiple voice data and cryptographic algorithm, when voice data is encrypted, owing to inserting relative prompt tone audio data before voice data, even if only adopt common player, also may be read into information, and only noise is play to the voice data of encryption, while not revealing encrypted voice data, the voice data of encryption is contained in this file of prompting user, user is avoided to misunderstand the audio file number of encryption damaged, prevent from causing unnecessary trouble
Above with reference to the accompanying drawings of the preferred embodiments of the present invention, not thereby limit to interest field of the present invention.Those skilled in the art do not depart from the scope and spirit of the present invention interior done any amendment, equivalent replacement and improve, all should within interest field of the present invention.