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, be fully described by, it is clear that described embodiment be only a part of embodiment of the present invention rather than
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 the embodiment of the present invention, terminal unit can include but not limited to: PC(Personal Computer, individual
People's computer), panel computer, mobile phone, smart mobile phone, the equipment such as notebook computer.Client can include
But it is not limited to: IM client, SNS client side etc..Wherein, client is installed in terminal unit, visitor
Family end belongs to the client modules in terminal unit, and terminal unit belongs to client place terminal unit.
Below in conjunction with accompanying drawing 1-accompanying drawing 4, the audio frequency transmission method providing the embodiment of the present invention is situated between in detail
Continue.
Refer to Fig. 1, for the flow chart of a kind of audio frequency transmission method that the embodiment of the present invention provides;The method can
Comprise the following steps S101-step S104.
S101, client detects when audio transmission is asked, and calls the record of described client place terminal unit
Sound application carries out the recording operation of audio file.
Wherein, the recording application of described client place terminal unit, can be the operation of described terminal unit
The recording application of system, such as: with Android(Android, a kind of mobile phone operating system) it is operating system
Terminal unit, its recording application can be the recording application of android system.In the embodiment of the present invention, client
End can provide one for initiate audio transmission request button, when this button is in pressed state, then can send out
Play audio transmission request, such as: client can provide " pin and a speak " function button, and user pins
This function button, client then can detect that audio transmission is asked, and now user can input voice to client
Data.In this step, client detects when audio transmission is asked, can be by calling described client place
The API(Application Programming Interface of the recording application of terminal unit, application programming
Interface) interface, with call described terminal unit recording application to user input speech data record,
And the recording operation of audio file is carried out according to the speech data of user's input.
In actual application, the recording operation process that the recording application of described terminal unit carries out audio file is permissible
The speech data of simulation user inputted including the recording application of: described terminal unit carry out analog digital conversion,
Sampling, quantization etc. process, and form at least one frame audio frame number evidence, and this at least one frame audio frame number is according to forming
PCM(Pulse-code modulation, pulse code modulation) audio file of form.
S102, described client gathers the current described audio frequency recorded from the recording application of described terminal unit
The audio frame number evidence of file.
As described in front step S101, the recording application of described terminal unit carries out the recording operation mistake of audio file
Cheng Zhong, can form audio frame number evidence one by one;In this step, described client is from described terminal unit
Recording application in gather the audio frame number evidence of the current described audio file recorded, particularly as follows: whenever described
Forming a frame audio frame number evidence in the recording application of terminal unit, described client is then from described terminal unit
In recording application by this frame audio frame data acquisition out.
S103, the audio frame number evidence of the described audio file of described current recording is encoded by described client.
Wherein, coded system can be AMR(Adaptive Multi-Rate, a kind of audio format) coded system,
Including fixed point coded system and floating-point code mode.In this step, described client preferably employs AMR coding
Mode, encodes the audio frame number evidence of the described audio file of described current recording;The most described client
Often collect a frame audio frame number evidence, then use AMR coded system to this frame audio frame number according to encoding.
S104, described client by the audio frame number after described coding according to transmission to server.
In this step, by the audio frame number after described coding according to transmission to server, then achieve audio frequency literary composition
Part carries out the process that recording limit, limit sends.A kind of feasible embodiment of this step is: can preset every time
The amount threshold of audio frame number evidence after the described coding of transmission, after coding described in described client-cache extremely
A few frame audio frame number evidence, when the data volume of the audio frame number evidence after the described coding of caching arrives predetermined number
During threshold value, by the audio frame number after the described coding of the predetermined number threshold value of this caching according to transmission to server.
The embodiment that the another kind of this step is feasible is: can preset the audio frame after the described coding of transmission every time
The duration of data, at least one frame audio frame number evidence after coding described in described client-cache, when the institute of caching
When stating total frame length arrival preset duration of each frame audio frame number evidence after coding, by the preset duration of this caching
Audio frame number after described coding is according to transmitting to server.
In the embodiment of the present invention, client can call client place when detecting that audio transmission is asked
The recording application of terminal unit carries out the recording of audio file, and the audio file gathering current recording is compiled
Code transmission process, it is achieved thereby that audio file carries out the process that recording limit, limit sends, preferably reduces
Audio transmission time delay, improves audio transmission efficiency effectively, meets user's reality to audio transmission time delay
Demand.
Refer to Fig. 2, for the flow chart of the another kind of audio frequency transmission method that the embodiment of the present invention provides;The method
S201-step S208 can be comprised the following steps.
S201, client detects when audio transmission is asked, and calls the record of described client place terminal unit
Sound application carries out the recording operation of audio file.
S202, described client gathers the current described audio frequency recorded from the recording application of described terminal unit
The audio frame number evidence of file.
Step S201-step S202 of the present embodiment can be found in the step S101-step of embodiment illustrated in fig. 1
S102, is not repeated herein.
S203, described client determines the coded system suitable with described terminal unit.
Wherein, coded system can be AMR coded system, including fixed point coded system and floating-point code mode.
Fixed point coded system possess take CPU(Central Processing Unit, central processing unit) resource is few, meter
Calculate simple, the feature that fidelity is relatively low;Floating-point code mode possesses that to take cpu resource many, calculates complexity,
The feature that fidelity is higher.This step can determine and described terminal according to the cpu performance of described terminal unit
The coded system that equipment is suitable, such as: if the cpu performance of described terminal unit is relatively low (such as: CPU provides
Source is less and computing capability is relatively low), this step can determine that fixed point coded system is for suitable with described terminal unit
Coded system;For another example: if the cpu performance of described terminal unit is higher (such as: resource is more and calculates energy
Power is higher), this step can determine that floating-point code mode is the coded system suitable with described terminal unit.
S204, described client according to determined by coded system, to the described audio frequency of described current recording literary composition
The audio frame number of part is according to encoding.
In this step, described client, according to the coded system suitable with described terminal unit, is worked as described
The audio frame number of the described audio file of front recording, according to encoding, can promote code efficiency effectively, it is ensured that
Coded reliability.
Step S203-step S204 of the present embodiment can be the concrete of step S103 of embodiment illustrated in fig. 1
Refinement step.
S205, the audio frame number evidence after coding described in described client-cache.
S206, described client detects whether to there is transmission trigger event, if testing result is yes, proceeds to step
Rapid S207;Otherwise, step S206 is continued.
Wherein, transmission trigger event includes: the data volume of the audio frame number evidence after the described coding cached reaches
To predetermined number threshold value;Or, when the frame length of the audio frame number evidence after the described coding cached reaches to preset
Long.
S207, described client extracts the audio frame number evidence after the described coding cached.
S208, the audio frame number after the described coding that described client will be extracted is according to transmitting to server.
In this step, by the audio frame number after described coding according to transmission to server, then achieve audio frequency literary composition
Part carries out the process that recording limit, limit sends.
In the embodiment of the present invention, client can call client place when detecting that audio transmission is asked
The recording application of terminal unit carries out the recording of audio file, and the audio file gathering current recording is compiled
Code transmission process, it is achieved thereby that audio file carries out the process that recording limit, limit sends, preferably reduces
Audio transmission time delay, improves audio transmission efficiency effectively, meets user's reality to audio transmission time delay
Demand.
Refer to Fig. 3, for the flow chart of another audio frequency transmission method that the embodiment of the present invention provides;The method
S301-step S310 can be comprised the following steps.
S301, client detects when audio transmission is asked, and calls the record of described client place terminal unit
Sound application carries out the recording operation of audio file.
S302, described client gathers the current described audio frequency recorded from the recording application of described terminal unit
The audio frame number evidence of file.
Step S301-step S302 of the present embodiment can be found in the step S101-step of embodiment illustrated in fig. 1
S102, is not repeated herein.
S303, described client judges when averagely the encoding of audio frame number evidence of the described audio file recorded
Between whether more than preset time threshold;If the determination result is YES, step S304 is proceeded to;Otherwise, step is proceeded to
S305。
In the embodiment of the present invention, apply due to the recording of described terminal unit and often record formation one frame audio frame number
According to, described client then gathers this frame audio frame number evidence, and to this frame audio frame number according to encoding;When needing
Before encoding the current audio frame number recorded evidence, in this step, described client judges to record
The average coding time of audio frame number evidence of described audio file whether more than preset time threshold, i.e. described
Client judges whether the average coding time of encoded audio frame number evidence is more than preset time threshold, and this is pre-
If time threshold can be set according to practical situation, such as: may be set to 1s, 2s etc..If sentenced
Disconnected result is yes, shows to encode the consuming time longer, further demonstrates that the cpu performance of described terminal unit relatively
Difference, then can proceed to step S304.If it is judged that be no, show to encode the consuming time shorter, further
Show that the cpu performance of described terminal unit is higher, step S305 can be proceeded to.
S304, fixed point coded system is defined as the coding staff suitable with described terminal unit by described client
Formula;Proceed to step S306 afterwards.
S305, floating-point code mode is defined as the coding staff suitable with described terminal unit by described client
Formula.
S306, described client according to determined by coded system, to the described audio frequency of described current recording literary composition
The audio frame number of part is according to encoding.
In this step, described client, according to the coded system suitable with described terminal unit, is worked as described
The audio frame number of the described audio file of front recording, according to encoding, can promote code efficiency effectively, it is ensured that
Coded reliability.
S307, the audio frame number evidence after coding described in described client-cache.
S308, whether the data volume of the audio frame number evidence after the described coding that the detection of described client has cached reaches
To predetermined number threshold value, if testing result is yes, proceed to step S309;Otherwise, step S308 is continued.
Wherein, predetermined number threshold value can be set according to practical situation, such as: can set according to the network bandwidth
Putting predetermined number threshold value is 2K, 3K etc..In the embodiment of the present invention, due to the recording of described terminal unit
Application is often recorded and is formed a frame audio frame number evidence, and described client then gathers this frame audio frame number evidence, to this frame
Audio frame number is according to encoding, and the audio frame number evidence described in caching;It is described that this step then judges to have cached
Whether the data volume of the audio frame number evidence after coding reaches predetermined number threshold value, such as: after assuming a frame coding
The data volume of audio frame number evidence be 1K, predetermined number threshold value is 2K, then when described client-cache two frame
Audio frame number after coding according to time, this step can detect that the audio frame number evidence after the described coding cached
Data volume reaches predetermined number threshold value.
S309, described client extracts the audio frame number evidence after the described coding cached.
Illustrating according to the example in step S308, this step extracts the audio frequency after the two frame codings cached
Frame data, i.e. extract the audio frame number evidence after the described coding that this data volume cached is 2K.Need explanation
, while the audio frame number evidence after extracting the described coding cached of the client described in this step,
Audio frame number after the described coding being extracted from the spatial cache of described client is according to deleting.
S310, the audio frame number after the described coding that described client will be extracted is according to transmitting to server.
Step S310 of the present embodiment can be found in step S208 of embodiment illustrated in fig. 2, is not repeated herein.
The idiographic flow of the audio frequency transmission method of the present embodiment will be described with an instantiation below.
Assuming that terminal unit is mobile phone, client is the IM client in mobile phone.IM client provides and is used for
Initiate " pin and speak " function button of audio transmission request.Simultaneously, it is assumed that the number of a frame audio frame number evidence
Being 1K according to amount, predetermined number threshold value is 2K, and preset time threshold is 1s.
When user pins " pin and speak " function button that IM client provides, IM client detects sound
Keeping pouring in defeated request, user can input speech data to IM client.The recording of IM client call mobile phone should
Record with the speech data that user is inputted, and formed at least according to the language data process of user's input
One frame audio frame number evidence, this at least one frame audio frame number is according to forming audio file.
Assuming that audio file comprises 10 frame audio frame number evidences altogether, formation the 1st has been recorded in the recording application of mobile phone
Frame is to the 3rd frame audio frame number evidence, and gathered by IM client, coded treatment is, and IM client slow
Deposit and space cached the 3rd frame audio frame number evidence, it is assumed that the scramble time of the 1st frame audio frame number evidence is 0.2s,
The scramble time of the 2nd frame audio frame number evidence is 0.8s, and the scramble time of the 3rd frame audio frame number evidence is 0.2s.Hands
The current recording of recording application of machine forms the 4th frame audio frame number evidence, and the recording of mobile phone is applied the 4th frame sound
Frequently frame data are sent to IM client, and IM client gathers this frame audio frame number evidence.IM client has calculated
The average coding time of the 1st frame to the 3rd frame audio frame number evidence recorded is (0.2+0.8+0.2)/3=0.4s, little
Determine that floating-point code mode is the coded system suitable with mobile phone in preset time threshold 1s, IM client.
IM client uses floating-point code mode to current the 4th frame audio frame number recorded according to encoding, IM
The 4th frame audio frame number evidence after client-cache coding, comprises coding altogether in the spatial cache of IM client
After the 3rd frame audio frame number evidence and the 4th frame audio frame number evidence, IM client judges these two frame sounds cached
Frequently the data volume size of frame data is 2K, has reached predetermined number threshold value 2K, and IM client is then extracted the most slow
This 2K audio frame number deposited is according to transmitting to server.
In the embodiment of the present invention, client can call client place when detecting that audio transmission is asked
The recording application of terminal unit carries out the recording of audio file, and the audio file gathering current recording is compiled
Code transmission process, it is achieved thereby that audio file carries out the process that recording limit, limit sends, preferably reduces
Audio transmission time delay, improves audio transmission efficiency effectively, meets user's reality to audio transmission time delay
Demand.
Refer to Fig. 4, for the flow chart of another audio frequency transmission method that the embodiment of the present invention provides;The method
S401-step S410 can be comprised the following steps.
S401, client detects when audio transmission is asked, and calls the record of described client place terminal unit
Sound application carries out the recording operation of audio file.
S402, described client gathers the current described audio frequency recorded from the recording application of described terminal unit
The audio frame number evidence of file.
S403, described client judges when averagely the encoding of audio frame number evidence of the described audio file recorded
Between whether more than preset time threshold;If the determination result is YES, step S404 is proceeded to;Otherwise, step is proceeded to
S405。
S404, fixed point coded system is defined as the coding staff suitable with described terminal unit by described client
Formula;Proceed to step S406 afterwards.
S405, floating-point code mode is defined as the coding staff suitable with described terminal unit by described client
Formula.
S406, described client according to determined by coded system, to the described audio frequency of described current recording literary composition
The audio frame number of part is according to encoding.
S407, the audio frame number evidence after coding described in described client-cache.
Step S401-step S407 of the present embodiment can be found in the step S301-step of embodiment illustrated in fig. 3
S306, is not repeated herein.
S408, whether the frame length of the audio frame number evidence after the described coding that the detection of described client has cached reaches
Preset duration, if testing result is yes, proceeds to step S409;Otherwise, step S408 is continued.
Wherein, preset duration can be set according to practical situation, such as: can arrange preset duration be 2s,
3s etc..In the embodiment of the present invention, apply due to the recording of described terminal unit and often record formation one frame audio frequency
Frame data, described client then gathers this frame audio frame number evidence, to this frame audio frame number according to encoding, and
Audio frame number evidence described in caching;This step then judges the frame of the audio frame number evidence after the described coding cached
Long whether reach preset duration, such as: the frame length assuming the audio frame number evidence after a frame coding is 1s, presets
Amount threshold is 2s, then when described client-cache two frame encode after audio frame number according to time, this step can be examined
The frame length measuring the audio frame number evidence after the described coding cached reaches preset duration.
S409, described client extracts the audio frame number evidence after the described coding cached.
Illustrating according to the example in step S408, this step extracts the audio frequency after the two frame codings cached
Frame data, i.e. extract the audio frame number evidence after the described coding that the total frame length cached is 2s.Need explanation
It is, while the audio frame number evidence after extracting the described coding cached of the client described in this step, from
Audio frame number after the described coding being extracted in the spatial cache of described client is according to deleting.
S410, the audio frame number after the described coding that described client will be extracted is according to transmitting to server.
Step S410 of the present embodiment can be found in step S208 of embodiment illustrated in fig. 2, is not repeated herein.
The idiographic flow of the audio frequency transmission method of the present embodiment will be described with an instantiation below.
Assuming that terminal unit is mobile phone, client is the IM client in mobile phone.IM client provides and is used for
Initiate " pin and speak " function button of audio transmission request.Simultaneously, it is assumed that the frame of a frame audio frame number evidence
A length of 1s, preset duration is 2s, and preset time threshold is 1s.
When user pins " pin and speak " function button that IM client provides, IM client detects sound
Keeping pouring in defeated request, user can input speech data to IM client.The recording of IM client call mobile phone should
Record with the speech data that user is inputted, and formed at least according to the language data process of user's input
One frame audio frame number evidence, this at least one frame audio frame number is according to forming audio file.
Assuming that audio file comprises 10 frame audio frame number evidences altogether, formation the 1st has been recorded in the recording application of mobile phone
Frame is to the 3rd frame audio frame number evidence, and gathered by IM client, coded treatment is, and IM client slow
Deposit and space cached the 3rd frame audio frame number evidence, it is assumed that the scramble time of the 1st frame audio frame number evidence is 0.2s,
The scramble time of the 2nd frame audio frame number evidence is 0.8s, and the scramble time of the 3rd frame audio frame number evidence is 0.2s.Hands
The current recording of recording application of machine forms the 4th frame audio frame number evidence, and the recording of mobile phone is applied the 4th frame sound
Frequently frame data are sent to IM client, and IM client gathers this frame audio frame number evidence.IM client has calculated
The average coding time of the 1st frame to the 3rd frame audio frame number evidence recorded is (0.2+0.8+0.2)/3=0.4s, little
Determine that floating-point code mode is the coded system suitable with mobile phone in preset time threshold 1s, IM client.
IM client uses floating-point code mode to current the 4th frame audio frame number recorded according to encoding, IM
The 4th frame audio frame number evidence after client-cache coding, comprises coding altogether in the spatial cache of IM client
After the 3rd frame audio frame number evidence and the 4th frame audio frame number evidence, IM client judges these two frame sounds cached
Frequently total frame length of frame data is 2s, has reached preset duration 2s, and IM client then extracts this total frame cached
The audio frame number of long 2s is according to transmitting to server.
In the embodiment of the present invention, client can call client place when detecting that audio transmission is asked
The recording application of terminal unit carries out the recording of audio file, and the audio file gathering current recording is compiled
Code transmission process, it is achieved thereby that audio file carries out the process that recording limit, limit sends, preferably reduces
Audio transmission time delay, improves audio transmission efficiency effectively, meets user's reality to audio transmission time delay
Demand.
Below in conjunction with accompanying drawing 5-accompanying drawing 10, the structure of the client that the embodiment of the present invention provides is carried out in detail
Introduce.It should be noted that the client shown in accompanying drawing 5-accompanying drawing 10, it is used for performing Fig. 1-Fig. 4 of the present invention
The method of illustrated embodiment, for convenience of description, illustrate only the part relevant to the embodiment of the present invention, tool
Body technique details does not discloses, and refer to the embodiment shown in Fig. 1-Fig. 4 of the present invention.
Refer to Fig. 5, for the structural representation of a kind of client that the embodiment of the present invention provides;This client can
Including: calling module 101, acquisition module 102, coding module 103 and transport module 104.
Calling module 101, for when detecting that audio transmission is asked, calls described client place terminal and sets
Standby recording application carries out the recording operation of audio file.
Wherein, the recording application of described client place terminal unit, can be the operation of described terminal unit
The recording application of system, such as: the terminal unit with Android as operating system, its recording application can be
The recording application of android system.In the embodiment of the present invention, client can provide one to pass for initiating audio frequency
The button of defeated request, when this button is in pressed state, then can initiate audio transmission request, such as: client
End can provide " pin and a speak " function button, and user pins this function button, and client then can detect
Asking to audio transmission, now user can input speech data to client.When detecting that audio transmission is asked
Time, described calling module 101 can be by calling the API of the recording application of described client place terminal unit
Interface, the speech data inputted user to call the recording application of described terminal unit is recorded, and root
The recording operation of audio file is carried out according to the speech data of user's input.
In actual application, the recording operation process that the recording application of described terminal unit carries out audio file is permissible
The speech data of simulation user inputted including the recording application of: described terminal unit carry out analog digital conversion,
Sampling, quantization etc. process, and form at least one frame audio frame number evidence, and this at least one frame audio frame number is according to forming
The audio file of PCM format.
Acquisition module 102, for gathering the current described audio frequency recorded from the recording application of described terminal unit
The audio frame number evidence of file.
During carrying out the recording operation of audio file due to the recording application of described terminal unit, one can be formed
The audio frame number evidence of frame one frame, described acquisition module 102 gathers from the recording of described terminal unit is applied works as
The audio frame number evidence of the described audio file of front recording, particularly as follows: whenever the recording of described terminal unit is applied
Middle formation one frame audio frame number evidence, described acquisition module 102 then will from the recording of described terminal unit is applied
This frame audio frame data acquisition is out.
Coding module 103, for encoding the audio frame number of the described audio file of described current recording evidence.
Wherein, coded system can be AMR coded system, including fixed point coded system and floating-point code mode.
Described coding module 103 preferably employs AMR coded system, to the described audio file of described current recording
Audio frame number is according to encoding;The most described coding module 103 often collects a frame audio frame number evidence, then use
This frame audio frame number evidence is encoded by AMR coded system.
Transport module 104, is used for the audio frame number after described coding according to transmitting to server.
Described transport module 104 is by the audio frame number after described coding according to transmitting to server, then it is right to achieve
Audio file carries out the process that recording limit, limit sends.The one of the transmitting procedure of described transport module 104 is feasible
Embodiment be: the amount threshold of the audio frame number evidence after the described coding of every time transmission, institute can be preset
Stating transport module 104 can be at least one frame audio frame number evidence after coding described in described client-cache, when slow
When the data volume of the audio frame number evidence after the described coding deposited arrives predetermined number threshold value, described transport module 104
By the audio frame number after the described coding of the predetermined number threshold value of this caching according to transmission to server.Described transmission
The embodiment that the another kind of the transmitting procedure of module 104 is feasible is: can preset the described volume of transmission every time
The duration of the audio frame number evidence after Ma, described transport module 104 can be after coding described in described client-cache
At least one frame audio frame number evidence, when caching described coding after each frame audio frame number evidence total frame length arrive
During preset duration, described transport module 104 is by the audio frame number after the described coding of the preset duration of this caching
According to transmission to server.
In the embodiment of the present invention, client can call client place when detecting that audio transmission is asked
The recording application of terminal unit carries out the recording of audio file, and the audio file gathering current recording is compiled
Code transmission process, it is achieved thereby that audio file carries out the process that recording limit, limit sends, preferably reduces
Audio transmission time delay, improves audio transmission efficiency effectively, meets user's reality to audio transmission time delay
Demand.
Refer to Fig. 6, for the structural representation of the another kind of client that the embodiment of the present invention provides;Calling module
101, acquisition module 102, coding module 103, transport module 104, cache module 105, detection trigger mould
Block 106 and data extraction module 107.
Cache module 105, the audio frame number evidence after caching described coding.
, for detecting whether there is transmission trigger event in detection trigger module 106.
Wherein, transmission trigger event includes: the data volume of the audio frame number evidence after the described coding cached reaches
To predetermined number threshold value;Or, when the frame length of the audio frame number evidence after the described coding cached reaches to preset
Long.
, if for there is transmission trigger event, then after extracting the described coding cached in data extraction module 107
Audio frame number evidence, and notify described transport module will extract described coding after audio frame number according to transmission extremely
Server.
Wherein, the described data extraction module 107 audio frame number evidence after extracting the described coding that cached
Meanwhile, the audio frame number after the described coding being extracted from the spatial cache of described client is according to carrying out
Delete.
In the embodiment of the present invention, client can call client place when detecting that audio transmission is asked
The recording application of terminal unit carries out the recording of audio file, and the audio file gathering current recording is compiled
Code transmission process, it is achieved thereby that audio file carries out the process that recording limit, limit sends, preferably reduces
Audio transmission time delay, improves audio transmission efficiency effectively, meets user's reality to audio transmission time delay
Demand.
Below in conjunction with accompanying drawing 7-accompanying drawing 10, each module in above-mentioned client is described in detail.
Refer to Fig. 7, for the structural representation of embodiment of the coding module that the embodiment of the present invention provides;This volume
Code module 103 comprises the steps that mode determines unit 1301 and coding unit 1302.
Mode determines unit 1301, for determining the coded system suitable with described terminal unit.
Wherein, coded system can be AMR coded system, including fixed point coded system and floating-point code mode.
Fixed point coded system possesses that to take cpu resource few, calculates simple, the feature that fidelity is relatively low;Floating-point code
Mode possesses that to take cpu resource many, calculates complexity, the feature that fidelity is higher.Described mode determines unit
1301 can determine the coded system suitable with described terminal unit according to the cpu performance of described terminal unit,
Such as: if the cpu performance of described terminal unit relatively low (such as: cpu resource is less and computing capability is relatively low),
Described mode determines that unit 1301 can determine that fixed point coded system is the coding staff suitable with described terminal unit
Formula;For another example: if the cpu performance of described terminal unit higher (such as: resource is more and computing capability is higher),
Described mode determines that unit 1301 can determine that floating-point code mode is the coding staff suitable with described terminal unit
Formula.
Coding unit 1302, for according to determined by coded system, the described audio frequency to described current recording
The audio frame number of file is according to encoding.
Described coding unit 1302 is according to the coded system suitable with described terminal unit, to described current record
The audio frame number of the described audio file of system, according to encoding, can promote code efficiency effectively, it is ensured that coding
Reliability.
Referring to Fig. 8, the mode provided for the embodiment of the present invention determines the structural representation of embodiment of unit;
Which determines that unit 1301 comprises the steps that judgment sub-unit 1311 and determines subelement 1312.
Judgment sub-unit 1311, for judging that the average of the audio frame number evidence of the described audio file recorded is compiled
Whether the code time is more than preset time threshold.
Applying often to record due to the recording of described terminal unit and form a frame audio frame number evidence, described client is then
Gather this frame audio frame number evidence, and to this frame audio frame number according to encoding;When needing the current sound recorded
Frequently, before frame data encode, described judgment sub-unit 1311 judges the sound of the described audio file recorded
Frequently whether the average coding time of frame data is more than preset time threshold, and the most described judgment sub-unit 1311 judges
Whether the average coding time of encoded audio frame number evidence is more than preset time threshold, this preset time threshold
Can be set according to practical situation, such as: may be set to 1s, 2s etc..If it is judged that be yes,
Show to encode the consuming time longer, further demonstrate that the cpu performance of described terminal unit is poor.If it is determined that
Result is no, shows to encode the consuming time shorter, further demonstrates that the cpu performance of described terminal unit is higher.
Determining subelement 1312, the average of audio frame number evidence of the described audio file for ought record encodes
When time is more than preset time threshold, fixed point coded system is defined as the volume suitable with described terminal unit
Code mode;Or, little for the average coding time of the audio frame number evidence of the described audio file that ought have recorded
In or equal to preset time threshold time, floating-point code mode is defined as the volume suitable with described terminal unit
Code mode.
Refer to Fig. 9, for the structural representation of an embodiment of the detection trigger module that the embodiment of the present invention provides
Figure;This detection trigger module 106 comprises the steps that data amount detection unit 1601 and first determines unit 1602.
Data amount detection unit 1601, the data of the audio frame number evidence after the described coding that detection has cached
Whether amount reaches predetermined number threshold value.
Wherein, predetermined number threshold value can be set according to practical situation, such as: can set according to the network bandwidth
Putting predetermined number threshold value is 2K, 3K etc..In the embodiment of the present invention, due to the recording of described terminal unit
Application is often recorded and is formed a frame audio frame number evidence, and described client then gathers this frame audio frame number evidence, to this frame
Audio frame number is according to encoding, and the audio frame number evidence described in caching;Described data amount detection unit 1601 is examined
Whether the data volume surveying the audio frame number evidence after the described coding cached reaches predetermined number threshold value, such as:
Assuming that the data volume of audio frame number evidence after a frame coding is 1K, predetermined number threshold value is 2K, then when described
Client-cache two frame coding after audio frame number according to time, described data amount detection unit 1601 can detect that
The data volume of the audio frame number evidence after the described coding of caching reaches predetermined number threshold value.
First determines unit 1602, for the data of the audio frame number evidence after the described described coding cached
When amount reaches predetermined number threshold value, determine existence transmission trigger event, and notify that described transport module is by described
Audio frame number after coding is according to transmitting to server.
Refer to Figure 10, for the structure of another embodiment of the detection trigger module that the embodiment of the present invention provides
Schematic diagram;This detection trigger module 106 comprises the steps that frame length detector unit 1611 and second determines unit 1612.
Frame length detector unit 1611, the frame length of the audio frame number evidence after the described coding that detection has cached is
No reach preset duration.
Wherein, preset duration can be set according to practical situation, such as: can arrange preset duration be 2s,
3s etc..In the embodiment of the present invention, apply due to the recording of described terminal unit and often record formation one frame audio frequency
Frame data, described client then gathers this frame audio frame number evidence, to this frame audio frame number according to encoding, and
Audio frame number evidence described in caching;After described frame length detector unit 1611 then detects the described coding cached
Whether the frame length of audio frame number evidence reaches preset duration, such as: assume the audio frame number evidence after a frame coding
Frame length is 1s, and predetermined number threshold value is 2s, then the audio frame number evidence after described client-cache two frame encodes
Time, described frame length detector unit 1611 can detect that the frame length of the audio frame number evidence after the described coding cached
Reach preset duration.
Second determines unit 1612, for the frame length of the audio frame number evidence after the described described coding cached
When reaching preset duration, determine existence transmission trigger event, and notify that described transport module is by after described coding
Audio frame number according to transmission to server.
In the embodiment of the present invention, client can call client place when detecting that audio transmission is asked
The recording application of terminal unit carries out the recording of audio file, and the audio file gathering current recording is compiled
Code transmission process, it is achieved thereby that audio file carries out the process that recording limit, limit sends, preferably reduces
Audio transmission time delay, improves audio transmission efficiency effectively, meets user's reality to audio transmission time delay
Demand.
The embodiment of the invention also discloses a kind of terminal unit, this terminal unit comprises client, this client
The 26S Proteasome Structure and Function of end can be found in the associated description of Fig. 5-embodiment illustrated in fig. 10, is not repeated herein.Need
Bright, the terminal unit of the present embodiment can apply in the method shown in Fig. 1-Fig. 4.
By the description of above-described embodiment, in the embodiment of the present invention, client can detect audio transmission
During request, the recording application calling client place terminal unit carries out the recording of audio file, and collection is worked as
The audio file of front recording carries out coding transmission process, sends out it is achieved thereby that audio file carries out recording limit, limit
The process sent, preferably reduces audio transmission time delay, effectively improves audio transmission efficiency, meets and uses
The family actual demand to audio transmission time delay.
One of ordinary skill in the art will appreciate that all or part of flow process realizing in above-described embodiment method,
Can be by computer program and complete to instruct relevant hardware, described program can be stored in a calculating
In machine read/write memory medium, this program is upon execution, it may include such as the flow process of the embodiment of above-mentioned each method.
Wherein, described storage medium can be magnetic disc, CD, read-only store-memory body (Read-Only Memory,
Or random store-memory body (Random Access Memory, RAM) etc. ROM).
Above disclosed be only present pre-ferred embodiments, certainly can not with this limit the present invention it
Interest field, the equivalent variations therefore made according to the claims in the present invention, still belong to the scope that the present invention is contained.