[summary of the invention]
Based on this, for the voice notes file in the picture affix generated, will lose after transfer, lack portable problem, the method realizing talking picture of voice notes after being necessary to provide a kind of picture to shift, can not be lost.
In addition, for the voice notes file in the picture affix generated, will lose after transfer, lack portable problem, the system realizing talking picture of voice notes after being necessary to provide a kind of picture to shift, will be lost.
Realize a method for talking picture, comprise the following steps:
Obtain picture file;
Obtain voice document;
Using institute's voice file as the growth data block forecast of picture file in described picture file.
Preferably, the step of described acquisition picture file is:
Shooting obtains instant picture file, and by described instant picture file buffer memory;
The step of described acquisition voice document is: while pictures taken, start recorded speech until default record length arrives, and according to the speech production voice document recorded;
After record length arrives, using the voice document of generation as described instant picture file growth data block forecast in described instant picture file.
Preferably, described acquisition picture file also comprises:
The picture file of reading pre-stored;
By buffer memory after the described picture file generation coded data prestored.
Preferably, using institute's voice file as the growth data block forecast of picture file to described picture file in after also comprise to described picture file carry out decoding play step.
Preferably, described to picture file carry out decoding play step comprise:
Detect described picture file and whether have corresponding voice document, if so, then described picture file decoding is play;
Otherwise broadcasting of after extracting the corresponding voice document of described picture file, both being decoded.
Realize a system for talking picture, comprising:
Picture acquiring unit, for obtaining picture file;
Voice acquiring unit, for obtaining voice document;
Coding of graphics unit, for using institute's voice file as the growth data block forecast of picture file in described picture file.
Preferably, picture acquiring unit comprises:
Taking module, obtains instant picture file for shooting;
Cache module, by described instant picture file buffer memory;
Described voice acquiring unit comprises:
Recording module, for starting recorded speech while pictures taken until default record length arrives;
Speech production module, for the speech production voice document according to recording;
Described coding of graphics unit record length arrive after, using generate voice document as described instant picture file growth data block forecast in described instant picture file.
Preferably, picture acquiring unit also comprises,
Read module, for the picture file of reading pre-stored;
Picture decode module, generates coded data by the described picture file decoding prestored;
Described cache module is by the coded data buffer memory of described generation.
Preferably, also comprise decoding unit, play for carrying out decoding to described picture file.
Preferably, described decoding unit comprises,
Whether detection module, have corresponding voice document for detecting described picture file;
Extraction module, for extracting corresponding voice document when described detection module is detected as no;
Playing module, plays for carrying out decoding to described picture file and voice document.
The above-mentioned method and system realizing talking picture are passed through to obtain voice document and picture file, and using voice document as the growth data block forecast of picture file to described picture file in become a complete picture file, avoid after the voice notes file of the picture affix generated forms two files, in transfer process, easily occur the problem of File lose.In addition, a kind of system realizing talking picture is also disclosed.
[embodiment]
In order to make object of the present invention, technical scheme and advantage clearer, below in conjunction with drawings and Examples, the present invention is described in more detail.Should be appreciated that specific embodiment described herein only in order to explain the present invention, be not intended to limit the present invention.
As shown in Figure 1, a kind of method realizing talking picture comprises the following steps:
Step S110, obtains picture file.The equipment with camera function can be utilized to take instant photo, after the instant photo of shooting, the picture file of this instant photo is cached as data cached.In addition, the picture file prestored in equipment decoding can also be generated coded data to be cached as data cached.
Step S120, obtains voice document.The sound-recording function of equipment can be utilized to record preset duration voice and generate voice document, and preset duration can be set to 10 seconds, 20 seconds, 30 seconds, or arranges other preset duration as required.In addition, also can the audio file that prestores of fetch equipment as the voice document realized needed for talking picture, as the voice document, music file etc. that prestore.
Step S130, using voice document as the growth data block forecast of picture file in picture file.In picture file format, except the Pixel Information of picture file, usually also comprise other information of picture file, such as, represent the information of file layout, the information representing file size etc.In addition, picture file can also comprise growth data district, and the data that some are extra are included in picture file.Voice document is become a complete picture file as the growth data block forecast of picture file by the present embodiment in picture file, and now picture file comprises picture and speech data.
Such picture file can realize photo on equipment and voice are play simultaneously.The more important thing is in addition, comprise the picture file of picture and voice at one, avoid after the voice notes file of the picture affix generated forms two files, in transfer process, easily occur the problem of File lose.
As shown in Figure 2, in a preferred embodiment, the method realizing talking picture of another embodiment comprises the following steps:
Step S210, obtains picture file.In the present embodiment, the mode of taking instant photo can be utilized to obtain picture file, please refer to Fig. 3, comprise step S212 ~ S214:
Step S212, shooting obtains instant picture file.Utilize the shoot function of equipment, user presses shooting push button to obtain required instant picture file by finding a view.
Step S214, by instant picture file buffer memory.After user presses shooting push button, picture file is cached with the form of picture frame data by equipment.
In other embodiment, obtaining picture file can be obtain the picture file prestored in device memory, please refer to Fig. 4 and comprises step S216 ~ S218:
Step S216, the picture file of reading pre-stored.In device memory, choose the picture file prestored, the picture file prestored wherein can be the file simply only comprising picture, also can be the picture file including other data, such as, comprise the picture file of speech data.
Step S218, generates buffer memory after coded data by the picture file that prestores.The picture file prestored is decoded into buffer memory after coded data.As base24 coding or other mate the coded data that can be encoded into picture file with voice document.
After the step obtaining picture file, perform step S220.
Step S220, obtains voice document.What obtain in the above-mentioned step obtaining picture file can be instant picture file, can be the picture file of pre-stored.Correspondingly, in the present embodiment, obtaining in the step of voice document can be obtain the voice document that real-time phonetic file also can be pre-stored.
Please refer to Fig. 3 to obtain real-time phonetic file and comprise step S222 ~ S224:
Step S222, starts recorded speech until default record length arrives while pictures taken.Before pictures taken and recording start, can arrange the preset duration of record length, preset duration can be set to 10 seconds, 20 seconds, 30 seconds, or arranges other preset duration as required.Certainly, also can Non-follow control, control the length of record length as required.
Step S224, according to the speech production voice document recorded.By the speech production voice document that preset duration is recorded, preferably voice document and picture file are saved in the storer of same paths.
In another embodiment, also can the audio file that prestores of fetch equipment as the voice document realized needed for talking picture, as the voice document, music file etc. that prestore.
After the step obtaining voice document, perform step S230.
Step S230, using voice document as the growth data block forecast of picture file in picture file.If acquisition is instant picture file, after record length arrives, using the voice document of generation as instant picture file growth data block forecast in instant picture file, can realize like this being recorded in mood when taking pictures.If what obtain is the picture file prestored, then using the voice document got as the picture file growth data block forecast prestored in the picture file prestored, be specially coded data that the picture file that prestores decoding in buffer memory obtains and voice document and encode and produce newborn picture file.
In the present embodiment, also comprise step S240, decoding is carried out to picture file and plays.After comprising the picture file synthesis of picture and voice data, this picture file preview can be play by equipment.Please refer to Fig. 6, decoding broadcasting step carried out to picture file and comprises step S242 ~ S246:
Whether step S242, detecting picture file has corresponding voice document.Using voice document as the growth data block forecast of picture file in the process in picture file, there will be the situation that voice document is not encoded into picture file, therefore whether, in the process of decoding playing pictures file, first needing to detect picture file has corresponding voice document.
Step S244, if detect picture file have corresponding voice document, then plays picture file decoding.Utilize the player of equipment to carry out picture and audio decoder to picture file, the content comprised by picture file presents.
Step S246, if detect picture file there is no corresponding voice document, then broadcasting of after extracting the corresponding voice document of picture file, both being decoded.In a preferred embodiment, the voice document got is saved to picture file same paths, therefore when detecting picture file and there is no a corresponding voice document by the corresponding voice document of searching route catalog extraction picture file after, player is decoded to picture file and voice document respectively, and the content both comprised presents.In other embodiments, voice document can be set up and be kept at different route directory, so can search for after different route directory extracts the corresponding voice document of picture file and play.
The above-mentioned method realizing talking picture is passed through to obtain voice document and picture file, and using voice document as the growth data block forecast of picture file to described picture file in become a complete picture file, avoid after the voice notes file of the picture affix generated forms two files, in transfer process, easily occur the problem of File lose.Achieve the mood that can be recorded in when taking pictures simultaneously.In addition, if after occurring that situation that voice document is not encoded into picture file is by the corresponding voice document of searching route catalog extraction picture file, player is decoded to picture file and voice document respectively, and the content both comprised presents.
As shown in Figure 7, a kind of system realizing talking picture comprises picture acquiring unit 400, voice acquiring unit 500, coding of graphics unit 600, decoding unit 700 and the storer shown in Fig. 8 800.
Picture acquiring unit 400 is for obtaining picture file; Voice acquiring unit 500 is for obtaining voice document; Coding of graphics unit 600 for using institute's voice file as the growth data block forecast of picture file in described picture file.Such picture file is play realization and can photo and voice be play simultaneously on equipment.The more important thing is in addition, comprise the picture file of picture and voice at one, avoid after the voice notes file of the picture affix generated forms two files, in transfer process, easily occur the problem of File lose.
In a preferred embodiment, picture acquiring unit 400 comprises taking module 410, cache module 420.
Taking module 410 obtains instant picture file for shooting.Utilize the shoot function of equipment, user presses shooting push button to obtain required instant picture file by finding a view.
Cache module 420 is connected with taking module 410, and cache module 420 is by described instant picture file buffer memory.After user presses shooting push button, the form of picture file picture frame data is cached by equipment.
In other embodiment, please refer to Fig. 8, picture acquiring unit 400 can be obtain the picture file prestored in device memory 800, and picture acquiring unit 400 also comprises read module 430, picture decode module 440.
Read module 430 is for the picture file of reading pre-stored.In the storer 800 of equipment, choose the picture file prestored, the picture file prestored wherein can be the file simply only comprising picture, also can be the picture file including other data, such as, comprise the picture file of speech data.
Picture decode module 440 is connected with read module 430, and the described picture file decoding prestored is generated coded data by picture decode module 440.The picture file prestored is decoded into buffer memory after coded data.As base24 coding or other mate the coded data that can be encoded into picture file with voice document.Afterwards, cache module 420 is by the coded data buffer memory of described generation.
Voice acquiring unit 500 with above-mentioned can be instant picture file obtaining what obtain in picture file, can be the picture file of pre-stored.Correspondingly, in the present embodiment, obtaining in voice document can be obtain the voice document that real-time phonetic file also can be pre-stored.Voice acquiring unit 500 comprises recording module 510, speech production module 520.
Recording module 510 is connected with speech production module 520, recording module 510 for starting recorded speech while pictures taken until default record length arrives.Before pictures taken and recording start, can arrange the preset duration of record length, preset duration can be set to 10 seconds, 20 seconds, 30 seconds, or arranges other preset duration as required.Certainly, also can Non-follow control, control the length of record length as required.
Speech production module 520 is for the speech production voice document according to recording.By the speech production voice document that preset duration is recorded, preferably voice document and picture file are saved in the storer of same paths.
In another embodiment, also can the audio file that prestores of fetch equipment as the voice document realized needed for talking picture, as the voice document, music file etc. that prestore.
Coding of graphics unit 600 is connected with picture acquiring unit 400, voice acquiring unit 500, coding of graphics unit 600 using voice document as the growth data block forecast of picture file in picture file.If acquisition is instant picture file, after record length arrives, using the voice document of generation as instant picture file growth data block forecast in instant picture file, can realize like this being recorded in mood when taking pictures.If what obtain is the picture file prestored, then to obtain the voice document got as the picture file growth data block forecast prestored in the picture file prestored, be specially coded data that the picture file that prestores decoding in buffer memory obtains and voice document and encode and produce newborn picture file.
Decoding unit 700 is connected with coding of graphics unit 600, and decoding unit 700 is play for carrying out decoding to picture file.After comprising the picture file synthesis of picture and voice data, this picture file preview can be play by equipment.Decoding unit 700 comprises detection module 710, playing module 720 and extraction module 730.
Whether detection module 710 has corresponding voice document for detecting described picture file.Using voice document as the growth data block forecast of picture file in the process in picture file, the success of each coding can not be ensured, there will be the situation that voice document is not encoded into picture file, therefore whether, in the process of decoding playing pictures file, first needing to detect picture file has corresponding voice document.
Playing module 720 is connected with extraction module 730, detection module 710, and playing module 720 is play for carrying out decoding to picture file and voice document.If detect picture file have corresponding voice document, then picture file decoding is play.Utilize the player of equipment to carry out picture and audio decoder to picture file, the content comprised by picture file presents.
Extraction module 730 is connected with detection module 710, playing module 720, and extraction module 730 extracts corresponding voice document when detection module 710 is detected as no.If detect picture file there is no corresponding voice document, then broadcasting of after extracting the corresponding voice document of picture file, both being decoded.In a preferred embodiment, the voice document got is saved to picture file same paths, therefore when detecting picture file and there is no a corresponding voice document by the corresponding voice document of searching route catalog extraction picture file after, playing module 730 is decoded to picture file and voice document respectively, and the content both comprised presents.In other embodiments, voice document can be set up and be kept at different route directory, so can search for after different route directory extracts the corresponding voice document of picture file and play.
The above-mentioned system realizing talking picture is passed through to obtain voice document and picture file, and using voice document as the growth data block forecast of picture file to described picture file in become a complete picture file, avoid after the voice notes file of the picture affix generated forms two files, in transfer process, easily occur the problem of File lose.Achieve the mood that can be recorded in when taking pictures simultaneously.In addition, if after occurring that situation that voice document is not encoded into picture file is by the corresponding voice document of searching route catalog extraction picture file, decoder module 700 is decoded to picture file and voice document respectively, and the content both comprised presents.
The above embodiment only have expressed several embodiment of the present invention, and it describes comparatively concrete and detailed, but therefore can not be interpreted as the restriction to the scope of the claims of the present invention.It should be pointed out that for the person of ordinary skill of the art, without departing from the inventive concept of the premise, can also make some distortion and improvement, these all belong to protection scope of the present invention.Therefore, the protection domain of patent of the present invention should be as the criterion with claims.