Embodiment
According to the sample rate of described media player parameter, Playout delay and the first default time delay, television equipment sample delay, network transfer delay determination voice data in the embodiment of the present invention, make the audio data transmission of television equipment drop to minimum to the time delay of mobile terminal, meet the demand that user's smoothness uses.
The embodiment of the present invention goes for multiple systems framework, especially, be applicable to the system architecture that television equipment is connected with network access equipment respectively with mobile terminal, be particularly useful for the scene of the voice data of TV programme described in the video data of a kind of television equipment broadcasting TV programme, mobile terminal playing.Preferably, television equipment in the embodiment of the present invention can be one or more intelligent television equipment developed based on Linux or android system, mobile terminal in the embodiment of the present invention can be one or more intelligent mobile phone terminal based on Android or IOS system development, and the network access equipment in the embodiment of the present invention can for possessing the wireless routing of WiFi function; Meanwhile, the television equipment in the embodiment of the present invention can be connected with network access equipment by wired or wireless mode, and the mobile terminal in the embodiment of the present invention can wirelessly be connected with network access equipment.
It should be noted that, along with setting up improving constantly of this demand of family lan, generally, all network access equipment is provided with in family, such as router, equipment various in family can be linked together by wired or wireless mode by this network access equipment, composition local area network (LAN).In embodiments of the present invention, auxiliary equipment refers to the equipment except network access equipment, such as bluetooth earphone, USB transceiver; Main equipment comprises television equipment and mobile terminal.
Below in conjunction with Figure of description, the embodiment of the present invention is described in further detail.
Schematic flow sheet corresponding to a kind of audio-frequency processing method that Fig. 1 provides for the embodiment of the present invention, this audio-frequency processing method mainly comprises the steps 101 to step 103:
Step 101, the audio transmission request message that television equipment mobile terminal receive sends, media player parameter and Playout delay, described media player parameter comprises the minimum amount of audio data that media player carries out needed for audio frequency broadcasting;
Step 102, described television equipment is according to the sample rate of described media player parameter, Playout delay and the first default time delay, television equipment sample delay, network transfer delay determination voice data;
Step 103, described television equipment gathers the current voice data play according to the sample rate of described voice data, and the voice data collected is sent to described mobile terminal.
Concrete, described in the embodiment of the present invention, mobile terminal is mobile communication terminal, refers to the computer equipment that can use in movement, comprises mobile phone, panel computer and palm equipment for surfing the net etc.Described mobile terminal is communicated by wireless network with described television equipment.
Before step 101, the connection request message that the first mobile terminal receive of television equipment sends, and according to described connection request message, connect with described mobile terminal, be specially: television equipment creates socket, then carries out port binding, described port corresponds to the service to mobile terminal transmission of audio data, and carry out the initialization operation of data transmission, start the connection request message waiting standby communication terminal; Television equipment connects with described mobile terminal after receiving the connection request message of mobile terminal.
In a step 101, the audio data transmission request message of television equipment mobile terminal receive transmission; In a step 102, start perform sampling initial work, comprising: determine sample needed for cache size and determine sample rate; According to the sample rate of described media player parameter, Playout delay and the first default time delay, television equipment sample delay, network transfer delay determination voice data; In step 103, television equipment gathers the current voice data play according to described sample rate, and sends the voice data collected to network and then send to described mobile terminal.
Alternatively, after the sampling that television equipment starts to carry out voice data and transmission, even if tv state changes, such as: channel switch, the operation etc. of third-party application, all do not affect mobile terminal by the current audio frequency play of earphone receiving television equipment, that is: the change of tv state does not affect the audio transmission between television equipment and mobile terminal.
Alternatively, after the sampling that television equipment starts to carry out voice data and transmission, automatically will enter silent mode, user only listens to by earphone the audio frequency that television equipment is sent to mobile terminal simultaneously, otherwise mobile terminal will not play the voice data received; After television equipment stops sampling and/or stop to send voice data to described mobile terminal to the voice data of current broadcasting, by manual operation or restart television equipment to eliminate silent mode, export the voice data of current broadcasting.
Preferably, in a step 102, described television equipment according to described media player parameter and first preset time delay, television equipment sample delay, network transfer delay determination voice data sample rate comprise:
The minimal sampling time of described television equipment is obtained by following formula:
T≤t2 and T<t-t1-t3;
Wherein, T is the minimal sampling time of television equipment, and t is the first default time delay, and t1 is Playout delay, and t2 is television equipment sample delay, and t3 is network transfer delay;
The sample rate of described voice data comprises sampling bits rate, and the minimum value of described sampling bits rate is obtained by following formula:
Mmin=N/T
Wherein, M is sampling bits rate, and Mmin is the minimum value of sampling bits rate, and N carries out the minimum amount of audio data needed for audio frequency broadcasting for media player, and T is the minimal sampling time of television equipment.
Preferably, in a step 102, the sample rate of described voice data also comprises sample frequency, and the minimum value of described sample frequency is obtained by following formula:
fmin=Mmin/b
Wherein, f is sample frequency, and fmin is the minimum value of sample frequency, and Mmin is the minimum value of sampling bits rate, and b is the sampling resolution of described television equipment.
Concrete, such as one, it is t=100ms that time delay is preset in first of voice data process that what system requirements allowed carry out and transmission, according to the empirical value that data network is propagated, ignore the time that data copy consumes, the maximum sample delay that television equipment sampling allows is t2=30ms, and the maximum delay of Internet Transmission is t3=15ms, it is t1=35ms that the maximum delay allowed is play in mobile terminal, then the sampling duration T of one-period should be less than t-t2-t3 and T should be less than or equal to t1.That is:
T<t-t1-t3 and T≤t2
Due to t-t1-t3=50ms, t2=30ms, then T is maximum can be 30ms, i.e. 0.03s.Further, the minimum amount of audio data needed for can playing according to the media player of described mobile terminal, and sampling resolution, can obtain the sample rate that television equipment carries out sampling.Minimum amount of audio data needed for can playing when the media player of mobile terminal is 3KB (3000Byte), then the minimum value being met the sampling bits rate of condition according to Mmin=N/T is Mmin=0.8Mbps.If when the sampling resolution preset is 16bit, the minimum value being met the sample frequency of condition according to formula fmin=Mmin/b is fmin=50KHz.
Such as two, suppose that obtaining the allowed first default time delay of carrying out voice data process and transmission by user's setting is t=150ms, ignore the time that data copy consumes equally, suppose that the maximum delay that television equipment sampling allows is t2=t/3=50ms, the maximum delay of Internet Transmission is t3=t/3=50ms, it is t1=t/3=50ms that the maximum delay allowed is play in mobile terminal, then T should be less than or equal to t2, and then rule of thumb and test result, can determine the size of T, hypothesis determines T=40ms=0.04s herein.Further, the minimum amount of audio data needed for can playing when the media player of mobile terminal is 4KB, then the minimum value being met the sampling bits rate of condition according to Mmin=N/T is Mmin=0.8Mbps.If when the sampling resolution preset is 32bit, the minimum value being met the sample frequency of condition according to formula fmin=Mmin/b is fmin=25KHz.
Alternatively, after the data volume determining sampling per second and sampling bits rate, also can be adjusted the value of sample rate by the size adjusting sampling resolution.
Preferably, when the minimum value of sample frequency is greater than the first sample frequency preset, described sampling resolution heightened by described television equipment.
Particularly, assuming that the first sample frequency preset is 44.1KHz, minimum value for the sample frequency obtained in above-mentioned such as is 50KHz, be greater than the first sample frequency preset, then now television equipment can heighten sampling resolution, to reduce sample frequency, such as heighten as 24bit by sampling resolution from 16bit, then the minimum value of the sample frequency after can being adjusted is 33.3KHz.
Preferably, described when the minimum value of sample frequency is greater than the second sample frequency preset, described television equipment carries out process of frequency multiplication to the described voice data collected, and the sample frequency after described process of frequency multiplication is the half of the minimum value of described sample frequency.
Particularly, assuming that the second sample frequency preset is 44.1KHz, minimum value for the sample frequency obtained in above-mentioned such as is 50KHz, be greater than the second sample frequency preset, then now television equipment can carry out process of frequency multiplication to the described voice data collected, to reduce sample frequency, obtaining the sample frequency after process of frequency multiplication is 25KHz.
Preferably, described television equipment calculates described network transfer delay by sending test packet to described mobile terminal.
Preferably, in step 103, described the voice data collected is sent to mobile terminal, is specially:
According to the size of network transmission bandwidth determination packet; Size according to described packet is split the voice data collected or is merged, and obtains the packet of voice data; By the Packet Generation of described voice data to mobile terminal.
After step 103, namely described the voice data collected is sent to described mobile terminal after, also comprise: after described television equipment receives the audio data transmission termination messages of described mobile terminal transmission, stop sampling to the voice data of current broadcasting and/or stop to send voice data to described mobile terminal.
Concrete, television equipment sends the process of voice data as shown in Figure 2 to mobile terminal.According to the restriction of network transmission bandwidth, determine the size of packet; After television equipment reads the voice data in a sampling period, according to the size of packet, determine whether to split the voice data collected or to merge; If so, then voice data is split according to needing of sending or merges, if not, then direct data packet head file is added to voice data, comprise destination address, audio frequency correlated sampling parameter etc., and then to mobile terminal transmission packets of audio data; Then return the voice data continuing to read the next sampling period, if now television equipment receives the audio data transmission termination messages that mobile terminal sends, the then sampling work of stop tone audio data, stop sampling to the voice data of current broadcasting and/or stop to send voice data to described mobile terminal, and reclaim corresponding buffer memory.
In order to more clearly understand the embodiment of the present invention, in Fig. 3, particularly illustrate the overall architecture flow chart of the embodiment of the present invention.
The embodiment of the present invention mainly comprises three parts, is respectively: television equipment, wireless network, mobile phone.Television equipment is communicated by wireless network with mobile phone.Concrete, television equipment receives the connection request message that mobile phone sends, and connects according to described connection request message and mobile phone; After successful connection, television equipment receives the audio data transmission request message that mobile phone sends, and starts the collection carrying out voice data, is carried out splitting or merging by the voice data collected, and issue mobile phone by wireless network according to the size of packet; After mobile phone receives the packets of audio data that television equipment sent by wireless network, packets of audio data is resolved, and the minimum amount of audio data needed for can playing according to mobile media player is split the voice data parsed or is merged, segmentation or the voice data after merging are sent to mobile media player buffer memory, and then by the voice data in media player buffer memory described in media renderer plays.
For said method flow process, the embodiment of the present invention also provides a kind of television equipment, and the particular content of this television equipment can be implemented with reference to said method, does not repeat them here.
A kind of television equipment that the embodiment of the present invention provides, shown in Figure 4.Embodiment of the present invention audio frequency process television equipment comprises: control module 401 and audio processing modules 402;
Described control module 401, the audio transmission request message sent for mobile terminal receive, media player parameter and Playout delay, described media player parameter comprises the minimum amount of audio data that media player carries out needed for audio frequency broadcasting;
Described audio processing modules 402, for the sample rate according to described media player parameter, Playout delay and the first default time delay, television equipment sample delay, network transfer delay determination voice data; Sample rate according to described voice data gathers the current voice data play, and the voice data collected is sent to described mobile terminal.
Preferably, described audio processing modules 402 also for:
The minimal sampling time of described television equipment is obtained by following formula:
T≤t2 and T<t-t1-t3;
Wherein, T is the minimal sampling time of television equipment, and t is the first default time delay, and t1 is Playout delay, and t2 is television equipment sample delay, and t3 is network transfer delay;
The sample rate of described voice data comprises sampling bits rate, is obtained the minimum value of described sampling bits rate by following formula:
Mmin=N/T
Wherein, M is sampling bits rate, and Mmin is the minimum value of sampling bits rate, and N carries out the minimum amount of audio data needed for audio frequency broadcasting for media player, and T is the minimal sampling time of television equipment.
Preferably, described audio processing modules 402 also for:
The sample rate of described voice data also comprises sample frequency, is obtained the minimum value of described sample frequency by following formula:
fmin=Mmin/b
Wherein, f is sample frequency, and fmin is the minimum value of sample frequency, and Mmin is the minimum value of sampling bits rate, and b is the sampling resolution of described television equipment.
Preferably, the sampling resolution size of described television equipment is adjustable; Described audio processing modules 402 also for: when the minimum value of sample frequency is greater than the first sample frequency preset, described sampling resolution heightened by described television equipment.
Preferably, the sampling resolution size of described television equipment is adjustable; Described audio processing modules 402 also for: the sampling resolution size of described television equipment is adjustable, it is described when the minimum value of sample frequency is greater than the second sample frequency preset, described television equipment carries out process of frequency multiplication to the described voice data collected, and the sample frequency after described process of frequency multiplication is the half of the minimum value of described sample frequency.
Preferably, described audio processing modules 402 also for:
Described network transfer delay is calculated by sending test packet to described mobile terminal.
Preferably, described audio processing modules 402 also for:
According to the size of network transmission bandwidth determination packet;
Size according to described packet is split the voice data collected or is merged, and obtains the packet of voice data;
By the Packet Generation of described voice data to mobile terminal.
Preferably, described control module 401 also for:
After receiving the audio data transmission termination messages of described mobile terminal transmission, stop sampling to the voice data of current broadcasting and/or stop to send voice data to described mobile terminal.
Alternatively, in actual applications, the audio transmission request that some mobile terminals sends except can be used in indication TV equipment except these mobile terminal transmission of audio data, can also indication TV equipment to other mobile terminal transmission of audio data multiple.
The control module of television equipment, after the audio transmission request receiving one of them mobile terminal, carries out collection and the transmission of voice data according to audio transmission request indicative audio processing module; Audio processing modules gathers the voice data of the current broadcasting of television equipment, and the voice data collected is transferred to corresponding mobile terminal by connecting with the network between multiple mobile terminal.
Preferably, for dissimilar mobile terminal, in television equipment, multiple audio processing modules can be set, each audio processing modules is used for the voice data gathering the current broadcasting of television equipment for the mobile terminal of respective type, and by the voice data collected by being connected with the network between the mobile terminal of respective type the mobile terminal being transferred to respective type.
Two audio processing modules are such as set in television equipment, are respectively the first audio processing modules and the second audio processing modules.Wherein, the mobile terminal that first audio processing modules is corresponding is all by TCP (Transmission Control Protocol, transmission control protocol) connect with television equipment, and mobile terminal corresponding to the second audio processing modules is all by HTTP (Hypertext Transfer Protocol, HTML (Hypertext Markup Language)) connect with television equipment, two audio processing modules adopt different forms to encapsulate voice data when transmitting respectively.
Alternatively, the first audio processing modules and the second audio processing modules also can adopt different acquisition mode, with the mobile terminal required for different tonequality.When audio data collecting, the first audio processing modules and the second audio processing modules can set different sample rates, sampling precision and code check, to obtain the voice data of different tonequality.Such as, the sample format that first audio processing modules take sample rate as 48KHz, sampling precision is 16Bit, code check is no more than 200Kbps gathers, and the sample format that the second audio processing modules take sample rate as 96KHz, sampling precision is 32Bit, code check is no more than 400Kbps gathers.
It can be seen from the above:
The audio transmission request message that in the embodiment of the present invention, television equipment mobile terminal receive sends, media player parameter and Playout delay, described media player parameter comprises the minimum amount of audio data that media player carries out needed for audio frequency broadcasting; Described television equipment is according to the sample rate of described media player parameter, Playout delay and the first default time delay, television equipment sample delay, network transfer delay determination voice data; Described television equipment gathers the current voice data play according to the sample rate of described voice data, and the voice data collected is sent to described mobile terminal, achieve the media player parameter for mobile terminal, set sample rate intelligently, the propagation delay time of the voice data of transmitting terminal and receiving terminal is effectively reduced, meets the demand that user's smoothness uses.
Those skilled in the art should understand, embodiments of the invention can be provided as method, system or computer program.Therefore, the present invention can adopt the form of complete hardware embodiment, completely software implementation or the embodiment in conjunction with software and hardware aspect.And the present invention can adopt in one or more form wherein including the upper computer program implemented of computer-usable storage medium (including but not limited to magnetic disc store, CD-ROM, optical memory etc.) of computer usable program code.
The present invention describes with reference to according to the flow chart of the method for the embodiment of the present invention, equipment (system) and computer program and/or block diagram.Should understand can by the combination of the flow process in each flow process in computer program instructions realization flow figure and/or block diagram and/or square frame and flow chart and/or block diagram and/or square frame.These computer program instructions can being provided to the processor of all-purpose computer, special-purpose computer, Embedded Processor or other programmable data processing device to produce a machine, making the instruction performed by the processor of computer or other programmable data processing device produce device for realizing the function of specifying in flow chart flow process or multiple flow process and/or block diagram square frame or multiple square frame.
These computer program instructions also can be stored in can in the computer-readable memory that works in a specific way of vectoring computer or other programmable data processing device, the instruction making to be stored in this computer-readable memory produces the manufacture comprising command device, and this command device realizes the function of specifying in flow chart flow process or multiple flow process and/or block diagram square frame or multiple square frame.
These computer program instructions also can be loaded in computer or other programmable data processing device, make on computer or other programmable devices, to perform sequence of operations step to produce computer implemented process, thus the instruction performed on computer or other programmable devices is provided for the step realizing the function of specifying in flow chart flow process or multiple flow process and/or block diagram square frame or multiple square frame.
Although describe the preferred embodiments of the present invention, those skilled in the art once obtain the basic creative concept of cicada, then can make other change and amendment to these embodiments.So claims are intended to be interpreted as comprising preferred embodiment and falling into all changes and the amendment of the scope of the invention.
Obviously, those skilled in the art can carry out various change and modification to the present invention and not depart from the spirit and scope of the present invention.Like this, if these amendments of the present invention and modification belong within the scope of the claims in the present invention and equivalent technologies thereof, then the present invention is also intended to comprise these change and modification.