CN107404340A - Transmission method, device, terminal and the storage medium of Bluetooth audio frequency data - Google Patents

Transmission method, device, terminal and the storage medium of Bluetooth audio frequency data Download PDF

Info

Publication number
CN107404340A
CN107404340A CN201710757912.7A CN201710757912A CN107404340A CN 107404340 A CN107404340 A CN 107404340A CN 201710757912 A CN201710757912 A CN 201710757912A CN 107404340 A CN107404340 A CN 107404340A
Authority
CN
China
Prior art keywords
bluetooth protocol
voice data
protocol repertory
bluetooth
memory space
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201710757912.7A
Other languages
Chinese (zh)
Inventor
龚金华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201710757912.7A priority Critical patent/CN107404340A/en
Publication of CN107404340A publication Critical patent/CN107404340A/en
Pending legal-status Critical Current

Links

Classifications

    • H04B5/72

Abstract

The invention discloses a kind of transmission method, device, terminal and the storage medium of Bluetooth audio frequency data.This method includes:The first voice data is sent to bluetooth protocol repertory, and obtains the memory space state of the bluetooth protocol repertory;If the memory space state of the bluetooth protocol repertory is inadequate, first voice data is not write in the bluetooth protocol repertory;First voice data is retransmitted to the bluetooth protocol repertory.The transmission method of Bluetooth audio frequency data provided in an embodiment of the present invention, when the memory space state of bluetooth protocol repertory is inadequate, not by the write-in of the first voice data wherein, the first voice data is retransmitted to bluetooth protocol repertory, the loss of voice data can be avoided, so that audio plays smooth, the reliability of raising Bluetooth audio frequency data transfer.

Description

Transmission method, device, terminal and the storage medium of Bluetooth audio frequency data
Technical field
The present embodiments relate to technical field of data transmission, more particularly to a kind of transmission method of Bluetooth audio frequency data, Device, terminal and storage medium.
Background technology
With the fast development of mobile communication technology and the popularization of intelligent terminal, mobile terminal device has become people Live in indispensable means of communication.Because most of mobile terminal devices support Bluetooth function, some and terminal device The bluetooth equipment to match also arises at the historic moment, such as bluetooth earphone, Baffle Box of Bluetooth and intelligent wearable device.
When playing audio using bluetooth equipment, mobile terminal transmits data, bluetooth association by Bluetooth protocol to bluetooth equipment View belongs to wireless transmission protocol, when the interference by surrounding environment and bluetooth equipment reason itself are influenceed, it may appear that data The situation of loss so that audio broadcasting is not smooth, and reliability is not high.
The content of the invention
The present invention provides a kind of transmission method, device, terminal and the storage medium of Bluetooth audio frequency data, can improve bluetooth The reliability of voice data transmission.
In a first aspect, the embodiments of the invention provide a kind of transmission method of Bluetooth audio frequency data, this method includes:
The first voice data is sent to bluetooth protocol repertory, and obtains the memory space state of the bluetooth protocol repertory;
If the memory space state of the bluetooth protocol repertory is inadequate, not by described in first voice data write-in In bluetooth protocol repertory;
First voice data is retransmitted to the bluetooth protocol repertory.
Second aspect, the embodiment of the present invention additionally provide a kind of transmission method of Bluetooth audio frequency data, and this method includes:
It is determined that currently it is sent to the first voice data of bluetooth protocol repertory;
Obtain the memory space state of the bluetooth protocol repertory;
If the memory space state of the bluetooth protocol repertory is inadequate, suspend to described in bluetooth protocol repertory transmission First voice data.
The third aspect, the embodiment of the present invention additionally provide a kind of transmitting device of Bluetooth audio frequency data, and the device includes:
First voice data sending module, for sending the first voice data to bluetooth protocol repertory, and obtain the bluetooth The memory space state of protocol stack;
First voice data writing module, if the memory space state for the bluetooth protocol repertory is inadequate, no First voice data is write in the bluetooth protocol repertory;
First voice data retransmits module, for retransmitting first voice data to the bluetooth protocol repertory.
Fourth aspect, the embodiment of the present invention additionally provide a kind of transmitting device of Bluetooth audio frequency data, and the device includes:
First voice data determining module, for determining currently to be sent to the first voice data of bluetooth protocol repertory;
Memory space state acquisition module, for obtaining the memory space state of the bluetooth protocol repertory;
First voice data sending module, if the memory space state for the bluetooth protocol repertory is inadequate, temporarily Stop sending first voice data to the bluetooth protocol repertory.
5th aspect, the embodiment of the present invention additionally provide a kind of terminal, including memory, processor and are stored in described deposit On reservoir and the computer program that can run on the processor, realized such as during computer program described in the computing device The transmission method of Bluetooth audio frequency data described in first aspect or second aspect.
6th aspect, the embodiment of the present invention additionally provide a kind of storage medium, are stored thereon with computer program, the program The transmission method of the Bluetooth audio frequency data as described in first aspect or second aspect is realized when being executed by processor.
The transmission plan of Bluetooth audio frequency data provided in an embodiment of the present invention, the first audio number is sent to bluetooth protocol repertory According to and the memory space state of bluetooth protocol repertory being obtained, if the memory space state of bluetooth protocol repertory is inadequate, not by the In one voice data write-in bluetooth protocol repertory, the first voice data is retransmitted to bluetooth protocol repertory.The embodiment of the present invention by using Above-mentioned technical proposal, when the memory space state of bluetooth protocol repertory is inadequate, not by the write-in of the first voice data wherein, Xiang Lan Tooth protocol stack retransmits the first voice data, can avoid the loss of voice data so that audio plays smooth, raising Bluetooth audio frequency number According to the reliability of transmission.
Brief description of the drawings
Fig. 1 is a kind of flow chart of the transmission method of Bluetooth audio frequency data in the embodiment of the present invention;
Fig. 2 is the flow chart of the transmission method of another Bluetooth audio frequency data in the embodiment of the present invention;
Fig. 3 is the flow chart of the transmission method of another Bluetooth audio frequency data in the embodiment of the present invention;
Fig. 4 is a kind of structural representation of the transmitting device of Bluetooth audio frequency data in the embodiment of the present invention;
Fig. 5 is the structural representation of the transmitting device of another Bluetooth audio frequency data in the embodiment of the present invention;
Fig. 6 is a kind of structural representation of terminal in the embodiment of the present invention;
Fig. 7 is a kind of structural representation of terminal in the embodiment of the present invention.
Embodiment
The present invention is described in further detail with reference to the accompanying drawings and examples.It is understood that this place is retouched The specific embodiment stated is used only for explaining the present invention, rather than limitation of the invention.It also should be noted that in order to just Part related to the present invention rather than entire infrastructure are illustrate only in description, accompanying drawing.
By Bluetooth protocol by voice data transmit to bluetooth equipment play when, because Bluetooth protocol is wireless protocols, meeting Interference and bluetooth equipment itself reason by surrounding environment is influenceed, it may appear that data retransmit so that in bluetooth protocol repertory Data can not timely be sent out and heap comes.In correlation technique, excessively cause not having when the data in bluetooth protocol repertory overstock When having the new data that enough space receiving terminals are sent, the data in bluetooth protocol repertory are all lost or part is lost to connect New data is received, serious slack phenomenon occurs so as to cause audio to play.
Fig. 1 is a kind of flow chart of the transmission method of Bluetooth audio frequency data provided in an embodiment of the present invention, and the present embodiment can Suitable for the situation using Bluetooth protocol transmission voice data, this method can be by the Bluetooth audio frequency data with bluetooth module Transmitting device is performed, and the device can be integrated in the terminals such as mobile phone or tablet personal computer.As shown in figure 1, this method is specifically wrapped Include following steps:
Step 110, the first voice data is sent to bluetooth protocol repertory, and obtains the memory space state of bluetooth protocol repertory.
Wherein, bluetooth protocol repertory can include multilayer Bluetooth protocol, and each layer protocol defines completed function and use The packet format of data, to ensure the interoperability between bluetooth equipment.The transmission of Bluetooth audio frequency data by Bluetooth protocol realize, Bluetooth protocol uses hierarchy, and bluetooth protocol repertory is formd from bottom to high level.Agreement in Bluetooth protocol system is according to should It is divided into core protocol, cable replacement with the degree of concern of layer control protocol (Session Initiation Protocol, SIG) Agreement, transtelephonic control protocol and from agreement.Wherein, the bluetooth specific agreement that bluetooth core agreement is formulated by SIG forms, Including baseband protocol, connection management agreement (Link Manager Protocol, LMP), logical link control and adaptation protocol (Logical Link Control and Adaptation Protocol, L2CAP) and service discovery protocol (Service Discovery Protocol, SDP).Wherein, base band and link control layers ensure each bluetooth equipment in piconet in baseband protocol The physical connection being made up of between unit radio frequency.LMP is responsible for establishment of connection between each bluetooth equipment, by the initiation of connection, hands over Change and examine and carry out authentication and encryption, determine base band data packet size through consultation, control the power supply mould of wireless device Formula and in work period, and piconet unit connection status.L2CAP is the upper-layer protocol of base band, with the parallel works of LMP Make.SDP plays crucial effect in Bluetooth technology framework, and it is the basis of all user models.It can be looked into using SDP Facility information and service type are ask, so as to establish corresponding connection between bluetooth equipment.
Exemplary, the voice data in bluetooth protocol repertory is typically stored in caching (buffer), bluetooth protocol repertory Memory space state can be specifically the memory space state for being used to store the caching of voice data in bluetooth protocol repertory.Storage is empty Between state can include it is sufficient or inadequate.Optionally, obtaining the process of the memory space state of bluetooth protocol repertory can be, lead to The size of bluetooth module detection current Bluetooth protocol stack residual memory space is crossed, by the size of residual memory space and the first audio The size that data are taken up space is compared, if the size of residual memory space is taken up space more than or equal to the first voice data Size, then memory space state for abundance, if the size of residual memory space taken up space less than the first voice data it is big Small, then memory space state is inadequate.Optionally, the process for obtaining the memory space state of bluetooth protocol repertory is also possible that The size of current Bluetooth protocol stack residual memory space is detected by bluetooth module, by the size of residual memory space and default threshold Value is compared, if the size of residual memory space is more than or equal to predetermined threshold value, memory space state is abundance, if remaining The size of memory space is less than predetermined threshold value, then memory space state is inadequate.Wherein, predetermined threshold value can be fixed value or Variable value.When predetermined threshold value is fixed value, such as it could be arranged to the arbitrary value between 50-100KB.When predetermined threshold value is can During variate, the average speed that can transmit data to bluetooth equipment according to terminal device dynamically adjusts, if predetermined threshold value is average The preset multiple of speed.Assuming that preset multiple is 1, the average speed that present terminal equipment transmits data to bluetooth equipment is 80KB/S, then predetermined threshold value can be adjusted to 80KB.Judging whether the operation of abundance can be performed by audio system, also can be by indigo plant Tooth module directly feeds back memory space state from bluetooth module to complete to audio system.
Specifically, after terminal device and bluetooth equipment establish bluetooth connection, pass through bluetooth equipment playing terminal equipment During audio, terminal device can obtain the first voice data by audio system (Audio System) call function, and to bluetooth Protocol stack sends the first voice data, the size and Bluetooth protocol that bluetooth module is taken up space the first voice data sent Stack residual memory space size is compared, and obtains the memory space state of current Bluetooth protocol stack, and bluetooth module is by acquisition Memory space feedback of status is to audio system.
Step 120, if the memory space state of bluetooth protocol repertory is inadequate, the first voice data bluetooth is not write into In protocol stack.
Specifically, if the memory space state of current Bluetooth protocol stack is inadequate, the first voice data is not write , can be by the first voice data jettisoning in bluetooth protocol repertory.Meanwhile bluetooth protocol repertory can also be unsuccessfully received by bluetooth module The result of one voice data feeds back to audio system.Due to the first voice data is not write in bluetooth protocol repertory, then bluetooth Original do not send to the voice data of bluetooth equipment is unaffected in protocol stack, and will not be extruded or abandon, and can protect Card is not in the situation that voice data is lost.
Step 130, the first voice data is retransmitted to bluetooth protocol repertory.
Exemplary, due to not writing the first voice data in bluetooth protocol repertory, in order to ensure the continuous of voice data Property, it is smooth to ensure that audio plays, the first voice data can be retransmitted to bluetooth protocol repertory on suitable opportunity.It is specific to send opportunity The embodiment of the present invention is not construed as limiting.
Optionally, when audio system receives the result of bluetooth module feedback to be unsuccessfully received the first voice data, Audio system retransmits the first voice data according to the feedback information to bluetooth protocol repertory.Under this application scene, the first sound is retransmitted Frequency can continue to determine whether the first voice data is successfully written bluetooth protocol repertory, if the first voice data does not still have after Bluetooth protocol repertory is successfully written, then continues to retransmit, until the first voice data is successfully written in bluetooth protocol repertory.
The transmission method of Bluetooth audio frequency data provided in an embodiment of the present invention, the first audio number is sent to bluetooth protocol repertory According to and the memory space state of bluetooth protocol repertory being obtained, if the memory space state of bluetooth protocol repertory is inadequate, not by the In one voice data write-in bluetooth protocol repertory, the first voice data is retransmitted to bluetooth protocol repertory.By using above-mentioned technical proposal, When the memory space state of bluetooth protocol repertory is inadequate, not by the write-in of the first voice data wherein, retransmitted to bluetooth protocol repertory First voice data, the loss of voice data can be avoided so that audio plays smoothness, improves the reliable of Bluetooth audio frequency data transfer Property.
Optionally, this method also includes:If the memory space state of bluetooth protocol repertory is abundance, by the first voice data Write in bluetooth protocol repertory, the voice data to be sent behind the first voice data is sent to bluetooth protocol repertory.
Specifically, if the memory space state of current Bluetooth protocol stack is abundance, the first voice data is write into bluetooth In protocol stack, meanwhile, the result that bluetooth protocol repertory can be successfully received the first voice data by bluetooth module feeds back to audio system System, audio system can continue to Bluetooth protocol after receiving bluetooth protocol repertory and being successfully received the feedback of the first voice data Stack sends the voice data to be sent behind the first voice data.So setting is advantageous in that, it is ensured that data transfer Efficiency, it is further ensured that the smoothness that audio plays.
Optionally, after the first voice data being write into bluetooth protocol repertory, bluetooth module detection current Bluetooth protocol stack remains The size of the remaining space of bluetooth protocol repertory and bluetooth protocol repertory are successfully received by the size of remaining memory space, bluetooth module The result of one voice data feeds back to audio system together, and audio system is according to the size of the remaining space of bluetooth protocol repertory to indigo plant Tooth protocol stack sends voice data to be sent behind the first voice data.Wherein, voice data to be sent is taken up space Size can be less than or equal to the size of the remaining space of bluetooth protocol repertory.Advantage of this is that so that audio to be sent Data disposably can be successfully written in bluetooth protocol repertory, reduce the sending times of voice data, so as to reduce because sending data Caused power consumption.
Optionally, step 130 can be implemented by following manner:Whether that second audio data is successful detect bluetooth protocol repertory Send to bluetooth equipment, if being successfully transmitted, retransmit the first voice data to bluetooth protocol repertory, second audio data is assisted for bluetooth Discuss the voice data in stack.
Wherein, bluetooth equipment can be Baffle Box of Bluetooth, bluetooth earphone etc..Bluetooth protocol repertory sends the second sound to bluetooth equipment Frequency is after, if bluetooth equipment is successfully received second audio data, can be successfully received second to bluetooth protocol repertory feedback The information of voice data, it can continue to send out to bluetooth equipment if second audio data is successfully transmitted to bluetooth equipment, bluetooth protocol repertory Send the voice data to be sent behind second audio data.Whether detection bluetooth protocol repertory is successfully transmitted second audio data Method to bluetooth equipment can be that the audio system in terminal device is by detecting whether bluetooth protocol repertory receives bluetooth equipment The information for being successfully received second audio data of feedback;Or whether receive bluetooth protocol repertory and sent to audio system Success sends second audio data to the information of bluetooth equipment.
Specifically, when the audio system in terminal device detect bluetooth protocol repertory by second audio data be successfully transmitted to During bluetooth equipment, audio system retransmits the first voice data to bluetooth protocol repertory.This is because, work as bluetooth protocol repertory by the second sound Frequency is according to when being successfully transmitted to bluetooth equipment, and the residual memory space of bluetooth protocol repertory can increase so that memory space state is very Abundance may be reverted to, now, audio system retransmits the first voice data to bluetooth protocol repertory, and the first voice data has more general Rate is successfully written in bluetooth protocol repertory.The technical scheme of the present embodiment, when detecting bluetooth protocol repertory by second audio data When being successfully transmitted to bluetooth equipment, the first voice data is retransmitted to bluetooth protocol repertory, advantage of this is that, ensure data transfer Efficiency, and the first voice data of this repeating transmission is likely to be successfully written bluetooth protocol repertory, reduces the sending times of voice data, So as to reduce power consumption.
Optionally, whether detection bluetooth protocol repertory is successfully transmitted second audio data to bluetooth equipment, if failed hair Send, then send the second audio to default spare storage space, the first voice data is retransmitted to bluetooth protocol repertory.
Wherein, presetting spare storage space can be used for caching is failed to send to the second audio data of bluetooth equipment, can The caching increased newly in bluetooth protocol repertory on the basis of original caching.Specifically, when the spatiality of bluetooth protocol repertory is deficiency When, whether detection bluetooth protocol repertory is successfully transmitted second audio data to bluetooth equipment, if not sending success, by the second sound Frequency is cached according to transmission to default spare storage space, and the second audio is retransmitted to bluetooth equipment from default spare storage space Data.Failed send to the second audio data of bluetooth equipment is sent to default spare storage space in bluetooth protocol repertory After row caching, the residual memory space of bluetooth protocol repertory can increase so that and memory space state is likely to revert to abundance, this When, audio system retransmits the first voice data to bluetooth protocol repertory, and the first voice data has greater probability to be successfully written to bluetooth In protocol stack.The technical scheme of the present embodiment, failed send to the second audio data of bluetooth equipment is sent to pre- equipment After memory space, the first voice data is retransmitted, advantage of this is that, ensure data transmission efficiency, while sound can be reduced The sending times of frequency evidence, reduce power consumption.
Optionally, step 130 can also be implemented by following manner:The memory space state of bluetooth protocol repertory is monitored, works as indigo plant When the memory space state of tooth protocol stack recovers sufficient, the first voice data is retransmitted to bluetooth protocol repertory.
Monitoring the mode of the memory space state of bluetooth protocol repertory can be, receive the bluetooth protocol repertory that bluetooth module is sent Memory space state.Under this application scene, bluetooth module detects the memory space state of bluetooth protocol repertory in real time, and will detection To memory space state send to audio system, audio system is timely got the memory space of current Bluetooth protocol stack State.Specifically, when the spatiality of bluetooth protocol repertory is insufficient, the storage that audio system continues to monitor bluetooth protocol repertory is empty Between state, when bluetooth protocol repertory memory space state recover it is sufficient when, audio system to bluetooth protocol repertory retransmit the first audio Data.The technical scheme of the present embodiment, when the memory space state of bluetooth protocol repertory recovers sufficient, the is retransmitted to bluetooth protocol repertory One voice data, advantage of this is that, ensure data transmission efficiency, while the first voice data that can ensure to retransmit can It is successfully written in bluetooth protocol repertory, reduces the number that voice data is retransmitted, reduces power consumption.
Optionally, step 130 can also be implemented by following manner:After preset time period, retransmitted to bluetooth protocol repertory First voice data.
Wherein, the concrete numerical value embodiment of the present invention of preset time period does not limit, for example, could be arranged to the 0.6-1 seconds it Between random time, be such as arranged to 0.8 second.Specifically, when the memory space state deficiency of bluetooth protocol repertory, audio system is not The first voice data can be retransmitted to bluetooth protocol repertory immediately, but after preset time period, the is retransmitted to bluetooth protocol repertory One voice data.This is due in preset time period, and the memory space state of bluetooth protocol repertory can revert to abundance, now The first voice data is retransmitted to bluetooth protocol repertory, the success rate of the first voice data write-in bluetooth protocol repertory can be improved, so as to The number of the first voice data repeating transmission is reduced, reduces power consumption.
Optionally, step 110 can be implemented by following manner:First audio is sent to bluetooth protocol repertory by audio system Data, and obtain the memory space state of the Bluetooth audio frequency mode A2DP frame buffer queues in bluetooth protocol repertory.
Wherein, Bluetooth audio frequency mode (Advanced Audio Distribution Profile, A2DP) can be adopted With chip stack data, sound is set to reach fine definition.A2DP by Bluetooth transmission layer and peer device, voice data stream from Audio sources are distributed to audio sink, and the agreement that the framework includes is also classified into Audio Source and Audio Sink two Part.A2DP agreements are divided into 3 modules:A2DP modules, universal audio/video distribution agreement (Generic Audio/Video Distribution Protocol, GAVDP) module and audio/video transmission agreement (Audio/Video Distribution Transport Protocol, AVDTP) module.Wherein, A2DP modules realize manages flow endpoint structure by GAVDP (Stream End Point, SEP) and SEP abilities function, and be audio stream text between audio sources and audio sink This setting and it is configured with circulation road.GAVDP modules manage the note of local SEP and SEP abilities from multiple user's angles Volume, handle the discovery inquiry request sent from remote equipment and obtain capability requests, while the SEP information based on user's registration, It is automatic to send response.AVDTP modules are responsible for establishing an AVDTP signalling path for arriving remote Bluetooth devices, and by means of AVDTP Agreement sends all signaling commands, while establishes transmission channel for Media Stream.Interaction between A2DP protocol layers passes through message Pass through mechanism realizes that wherein request message is the request that upper-layer protocol is actively sent to lower-layer protocols;Confirmation message is upper strata Each request message that agreement is sent, can all receive the confirmation that lower-layer protocols are put forward;Instruction message is lower-layer protocols to upper strata The instruction that agreement is actively initiated;Response message is the instruction message actively put forward for each lower-layer protocols, and upper-layer protocol is all This message is responded.
Specifically, when terminal device sends the first voice data by audio system to bluetooth protocol repertory, bluetooth is obtained The memory space shape of Bluetooth audio frequency mode A2DP frame buffer queues (a2dp frame buffer queue) in protocol stack State.
Accordingly, step 120 can pass through following manner embodiment:If the memory space state of A2DP frame buffer queues is not Abundance, then the first voice data is not write in A2DP frame buffer queues.
Specifically, when A2DP frame buffer queues memory space state for it is inadequate when, can by the first voice data jettisoning, It is not written into A2DP frame buffer queues, bluetooth module returns to false to audio system, and false represents the first voice data , it is necessary to retransmit in failed write-in A2DP frame buffer queues.
Accordingly, step 130 can be implemented by following manner:Audio System are notified to retransmit first to bluetooth protocol repertory Voice data.
Audio system knows that the first voice data is not successfully written bluetooth when it is false to receive function return value Protocol stack, then audio system, can be until the function return value of audio system reception to bluetooth protocol repertory the first voice data of repeating transmission For true when, no longer retransmit the first voice data.
Optionally, if the memory space state of A2DP frame buffer queues is abundance, the first voice data is write into A2DP In frame buffer queue.Meanwhile bluetooth module returns to true to audio system, audio system is true receiving function return value When, know that the first voice data is successfully written to bluetooth protocol repertory, continue to send follow-up voice data to bluetooth protocol repertory.
The technical scheme of the present embodiment, when the memory space state of A2DP frame buffer queues is inadequate, not by first In voice data write-in A2DP frame buffer queues, audio system retransmits the first voice data to bluetooth protocol repertory, can avoid audio The loss of data so that audio plays smooth, the reliability of raising Bluetooth audio frequency data transfer.
Fig. 2 is the flow chart of the transmission method of another Bluetooth audio frequency data provided in an embodiment of the present invention.Such as Fig. 2 institutes Show, this method includes:
Step 210, the first voice data is sent to bluetooth protocol repertory, and obtains the memory space state of bluetooth protocol repertory.
Step 220, if the memory space state of bluetooth protocol repertory is inadequate, the remaining storage for obtaining bluetooth protocol repertory is empty Between size.
Wherein, obtaining the mode of the size of the residual memory space of bluetooth protocol repertory can be, receive bluetooth module and send The information on bluetooth protocol repertory residual memory space size.In the present embodiment, bluetooth module can detect bluetooth protocol repertory The size of current residual memory space, then bluetooth module the size of the bluetooth protocol repertory residual memory space detected is sent out Deliver to audio system.Specifically, when the memory space state of bluetooth protocol repertory is inadequate, can by the first voice data jettisoning, It is not written into bluetooth protocol repertory, while the size of the residual memory space by audio system acquisition bluetooth protocol repertory.
Step 230, the first voice data is split according to the size of residual memory space, obtains the first sub-audio According to the second sub-audio data, the size that the first sub-audio data is taken up space is less than or equal to the size of residual memory space.
In the present embodiment, when voice data passes through Bluetooth transmission, it is transmitted in the form of packet, each time packet Being typically of size of for being taken up space is unfixed.When the spatiality of bluetooth protocol repertory is inadequate, show that current Bluetooth is assisted The size for discussing the residual memory space of stack is less than the size that the first voice data is taken up space so that the first voice data can not be write Enter in bluetooth protocol repertory.The first voice data is split according to residual memory space, obtains the first sub-audio data and the Two sub-audio datas, the size that the first sub-audio data obtained after segmentation is taken up space is set to be less than or equal to residual memory space Size.It is exemplary, it is assumed that the residual memory space size of current Bluetooth protocol stack is 100KB, shared by the first voice data Space size is 230KB, and now, the first voice data can not be write in bluetooth protocol repertory, then is divided into the first voice data 100KB and 130KB, the space shared by the first sub-audio data are 100KB.
Step 240, the first sub-audio data is write in bluetooth protocol repertory.
In the present embodiment, by the size that the first sub-audio data is taken up space is less than or equal to the big of residual memory space It is small, thus can be successfully written in bluetooth protocol repertory.
Step 250, the second sub-audio data is retransmitted to bluetooth protocol repertory.
The mode of the second word voice data is retransmitted to bluetooth protocol repertory to be, by the second sub-audio data separately as one Individual packet is retransmitted, or the second sub-audio data voice data follow-up with the first voice data combined to be formed it is new Packet is sent to bluetooth protocol repertory.
The technical scheme of the present embodiment, when the memory space state of bluetooth protocol repertory is inadequate, stored according to residue The size in space is split to the first voice data, and it is big less than or equal to residual memory space to obtain taken up space size The first small sub-audio data, the first sub-audio data is write in bluetooth protocol repertory.The number of retransmitted audio data can be reduced According to amount, lower power consumption.
Fig. 3 is the flow chart of the transmission method of another Bluetooth audio frequency data provided in an embodiment of the present invention.The present embodiment The situation using Bluetooth protocol transmission voice data is applicable to, this method can be by the Bluetooth audio frequency data with bluetooth module Transmitting device perform, the device can be integrated in the terminals such as mobile phone or tablet personal computer.As shown in figure 3, this method is specific Comprise the following steps:
Step 310, it is determined that current the first voice data for being sent to bluetooth protocol repertory.
When voice data passes through Bluetooth transmission, it is transmitted in the form of packet, when a data coating is successfully transmitted To bluetooth protocol repertory, audio system may proceed to send follow-up packet., it is necessary to first determine current to be sent in the present embodiment To the first voice data of bluetooth protocol repertory.It is determined that being currently sent to the first voice data of bluetooth protocol repertory can be included really The size that fixed first voice data is taken up space.
Step 320, the memory space state of bluetooth protocol repertory is obtained.
Exemplary, the voice data in bluetooth protocol repertory is typically stored in caching (buffer), as previously described A2DP frame buffer queues, the memory space state of bluetooth protocol repertory can be specifically to be used to store voice data in bluetooth protocol repertory Caching memory space state.Memory space state can include sufficient or inadequate.The storage for obtaining bluetooth protocol repertory is empty Between the process of state can be that bluetooth module sends the size of the current Bluetooth protocol stack residual memory space detected to sound The size of residual memory space is compared with the size that the first voice data is taken up space for display system, audio system, if surplus The size of remaining memory space is more than or equal to the size that the first voice data is taken up space, then memory space state is abundance, if The size of residual memory space is less than the size that the first voice data is taken up space, then memory space state is inadequate.The mistake Journey can also be completed by bluetooth module, and directly feed back memory space state to audio system from bluetooth module.Specifically, bluetooth Module enters the size that the size of the current Bluetooth protocol stack residual memory space detected is taken up space with the first voice data Row compares, if the size of residual memory space is more than or equal to the size that the first voice data is taken up space, memory space shape State is abundance, if the size of residual memory space is less than the size that the first voice data is taken up space, memory space state is It is inadequate, memory space state is sent to audio system for sufficient or insufficient information.
Step 330, if the memory space state of bluetooth protocol repertory is inadequate, suspend to bluetooth protocol repertory and send first Voice data.
Specifically, if the memory space state of bluetooth protocol repertory is inadequate, audio system is suspended to be sent out to bluetooth protocol repertory The first voice data is sent, avoids existing voice data in bluetooth protocol repertory from being affected.
The transmission method of Bluetooth audio frequency data provided in an embodiment of the present invention, to bluetooth protocol repertory send voice data it Before, first judge whether the memory space state of bluetooth protocol repertory is sufficient, if inadequate, pause sends voice data, so treats The voice data of transmission will not be written into bluetooth protocol repertory, then original in bluetooth protocol repertory not send to bluetooth equipment Voice data is unaffected, and will not be extruded or be abandoned, it is ensured that is not in the situation that voice data is lost.This Outside, judged before sending, can also avoid throwing the voice data of transmission because the memory space of bluetooth protocol repertory is inadequate Fall, cause the waste of resource and the loss of energy.
Optionally, this method also includes:If the memory space state of bluetooth protocol repertory recovers sufficient, to bluetooth protocol repertory The first voice data is sent, and the first voice data is write in bluetooth protocol repertory.
Specifically, when the memory space state of bluetooth protocol repertory recovers sufficient, audio system is sent to bluetooth protocol repertory First voice data, and the first voice data is write in Bluetooth protocol.
Optionally, when the memory space state of bluetooth protocol repertory is inadequate, suspend to bluetooth protocol repertory and send first Voice data, after preset time period, the first voice data is sent to bluetooth protocol repertory.
Optionally, when the memory space state of bluetooth protocol repertory is inadequate, the residue of current Bluetooth protocol stack is obtained The size of memory space, the first voice data is split according to the size of residual memory space, obtains the first sub-audio According to the second sub-audio data, the size that the first sub-audio data is taken up space is less than or equal to the size of residual memory space, The first sub-audio data is sent to bluetooth protocol repertory, and the first sub-audio data is write in bluetooth protocol repertory.
Optionally, when the memory space state of bluetooth protocol repertory is inadequate, suspend to bluetooth protocol repertory and send first Voice data, whether detection bluetooth protocol repertory is successfully transmitted second audio data to bluetooth equipment, if being successfully transmitted, to indigo plant Tooth protocol stack sends the first voice data, and second audio data is the voice data in bluetooth protocol repertory.
Fig. 4 is a kind of structural representation of the transmitting device of Bluetooth audio frequency data provided in an embodiment of the present invention.Such as Fig. 4 institutes Show, the device includes:First voice data sending module 410, the first voice data writing module 420 and the first voice data weight Send out module 430.
First voice data sending module 410, for sending the first voice data to bluetooth protocol repertory, and obtain bluetooth association Discuss the memory space state of stack;
First voice data writing module 420, if the memory space state for bluetooth protocol repertory is inadequate, will not In first voice data write-in bluetooth protocol repertory;
First voice data retransmits module 430, for retransmitting the first voice data to bluetooth protocol repertory.
The transmitting device of Bluetooth audio frequency data provided in an embodiment of the present invention, when bluetooth protocol repertory memory space state not When sufficient, not by the write-in of the first voice data wherein, the first voice data retransmitted to bluetooth protocol repertory, voice data can be avoided Lose so that audio plays smooth, the reliability of raising Bluetooth audio frequency data transfer.
Optionally, the first voice data writing module 420 is additionally operable to:
If the memory space state of bluetooth protocol repertory is abundance, the first voice data is write in bluetooth protocol repertory, to Bluetooth protocol repertory sends the voice data to be sent behind the first voice data.
Optionally, the first voice data retransmits module 430, is additionally operable to:
Whether detection bluetooth protocol repertory is successfully transmitted second audio data to bluetooth equipment, if being successfully transmitted, to indigo plant Tooth protocol stack retransmits the first voice data, and second audio data is the voice data in bluetooth protocol repertory;Or,
The memory space state of bluetooth protocol repertory is monitored, when the memory space state of bluetooth protocol repertory recovers sufficient, to Bluetooth protocol repertory retransmits the first voice data;Or,
After preset time period, the first voice data is retransmitted to bluetooth protocol repertory.
Optionally, the first voice data retransmits module 430, is additionally operable to:
If failed send, the second audio is sent to default spare storage space, first is retransmitted to bluetooth protocol repertory Voice data.
Optionally, the first voice data writing module 420, is additionally operable to:
If the memory space state of bluetooth protocol repertory to be inadequate, obtains the big of the residual memory space of bluetooth protocol repertory It is small;
The first voice data is split according to the size of residual memory space, obtains the first sub-audio data and second Sub-audio data, the size that the first sub-audio data is taken up space are less than or equal to the size of residual memory space;
First sub-audio data is write in bluetooth protocol repertory;
The second sub-audio data is retransmitted to bluetooth protocol repertory.
Optionally, the first voice data sending module 410, is additionally operable to:
First voice data is sent to bluetooth protocol repertory by audio system Audio System, and obtains bluetooth protocol repertory In Bluetooth audio frequency mode A2DP frame buffer queues memory space state;
First voice data writing module 420, is additionally operable to:
If the memory space state of A2DP frame buffer queues is inadequate, the first voice data write-in A2DP frames are not delayed Deposit in queue;
First voice data retransmits module 430, is additionally operable to:
Audio System are notified to retransmit the first voice data to bluetooth protocol repertory.
Fig. 5 is the structural representation of the transmitting device of another Bluetooth audio frequency data provided in an embodiment of the present invention.Such as Fig. 5 Shown, the device includes:First voice data determining module 510, the voice data of memory space state acquisition module 520 and first Sending module 530.
First voice data determining module 510, for determining currently to be sent to the first voice data of bluetooth protocol repertory;
Memory space state acquisition module 520, for obtaining the memory space state of bluetooth protocol repertory;
First voice data sending module 530, for when the memory space state of bluetooth protocol repertory is inadequate, suspending The first voice data is sent to bluetooth protocol repertory.
The transmitting device of Bluetooth audio frequency data provided in an embodiment of the present invention, to bluetooth protocol repertory send voice data it Before, first judge whether the memory space state of bluetooth protocol repertory is sufficient, if inadequate, pause sends voice data, so treats The voice data of transmission will not be written into bluetooth protocol repertory, then original in bluetooth protocol repertory not send to bluetooth equipment Voice data is unaffected, and will not be extruded or be abandoned, it is ensured that is not in the situation that voice data is lost.This Outside, judged before sending, can also avoid throwing the voice data of transmission because the memory space of bluetooth protocol repertory is inadequate Fall, cause the waste of resource and the loss of energy.
Optionally, in addition to the first voice data writing module, for when the memory space state recovery of bluetooth protocol repertory When sufficient, the first voice data is sent to bluetooth protocol repertory, and the first voice data is write in bluetooth protocol repertory.
Fig. 6 is a kind of structural representation of terminal provided in an embodiment of the present invention, as shown in fig. 6, the terminal can include: Housing (not shown), first memory 601, the first central processing unit (Central Processing Unit, CPU) 602 (also known as first processor, hereinafter referred to as CPU), it is stored on first memory 601 and can be run on first processor 602 Computer program, circuit board (not shown) and power circuit (not shown).The circuit board is placed in the housing The interior volume surrounded;The CPU602 and the first memory 601 are arranged on the circuit board;The power circuit, For each circuit or the device power supply for the terminal;The first memory 601, for storing executable program code; The CPU602 is run and the executable journey by reading the executable program code stored in the first memory 601 Program corresponding to sequence code.
The terminal also includes:Peripheral Interface 603, RF (Radio Frequency, radio frequency) circuit 605, voicefrequency circuit 606th, loudspeaker 611, power management chip 608, input/output (I/O) subsystem 609, touch-screen 612, other input/controls Equipment 610 and outside port 604, these parts are communicated by one or more communication bus or signal wire 607.
It should be understood that graphic terminal 600 is only an example of terminal, and terminal 600 can have than figure Shown in more or less parts, two or more parts can be combined, or can have different portions Part configures.Various parts shown in figure can be including one or more signal transactings and/or application specific integrated circuit Hardware, software or hardware and software combination in realize.
The terminal of the transmission for Bluetooth audio frequency data provided below with regard to the present embodiment is described in detail, the terminal By taking smart mobile phone as an example.
First memory 601, the first memory 601 can be accessed by CPU602, Peripheral Interface 603 etc., and described One memory 601 can include high random access first memory, can also include non-volatile first memories, such as one Individual or multiple disk first memory parts, flush memory device or other volatile solid-state first memory parts.
The input of equipment and output peripheral hardware can be connected to CPU602 and the by Peripheral Interface 603, the Peripheral Interface 603 One memory 601.
I/O subsystems 609, the I/O subsystems 609 can be by the input/output peripherals in equipment, such as touch-screen 612 With other input/control devicess 610, Peripheral Interface 603 is connected to.I/O subsystems 609 can include the He of display controller 6091 For controlling one or more input controllers 6092 of other input/control devicess 610.Wherein, one or more input controls Device 6092 processed receives electric signal from other input/control devicess 610 or sends electric signal to other input/control devicess 610, Other input/control devicess 610 can include physical button (pressing button, rocker buttons etc.), dial, slide switch, behaviour Vertical pole, click on roller.What deserves to be explained is input controller 6092 can with it is following any one be connected:Keyboard, infrared port, The instruction equipment of USB interface and such as mouse.
Wherein, according to touch-screen operation principle and transmission information medium classification, touch-screen 612 can be resistance-type, Capacitor induction type, infrared-type or surface acoustic wave type.Classify according to mounting means, touch-screen 612 can be:It is external hanging type, built-in Formula or monoblock type.Classify according to technical principle, touch-screen 612 can be:Vector pressure sensing technology touch-screen, resistive technologies are touched Touch screen, capacitance technology touch-screen, infrared technology touch-screen or surface acoustic wave technique touch-screen.
Touch-screen 612, the touch-screen 612 are the input interface and output interface between user terminal and user, can It can include figure, text, icon, video etc. to user, visual output depending on output display.Optionally, touch-screen 612 is by user The electric signal (electric signal of such as contact surface) triggered on touch screen curtain, is sent to first processor 602.
Display controller 6091 in I/O subsystems 609 receives electric signal from touch-screen 612 or sent out to touch-screen 612 Electric signals.Touch-screen 612 detects the contact on touch-screen, and the contact detected is converted to and shown by display controller 6091 The interaction of user interface object on touch-screen 612, that is, realize man-machine interaction, the user interface being shown on touch-screen 612 Icon that object can be the icon of running game, be networked to corresponding network etc..What deserves to be explained is equipment can also include light Mouse, light mouse is not show the touch sensitive surface visually exported, or the extension of the touch sensitive surface formed by touch-screen.
RF circuits 605, it is mainly used in establishing the communication of intelligent sound box and wireless network (i.e. network side), realizes intelligent sound box Data receiver and transmission with wireless network.Such as transmitting-receiving short message, Email etc..
Voicefrequency circuit 606, it is mainly used in receiving voice data from Peripheral Interface 603, the voice data is converted into telecommunications Number, and the electric signal is sent to loudspeaker 611.
Loudspeaker 611, for the voice signal for receiving intelligent sound box from wireless network by RF circuits 605, it is reduced to Sound simultaneously plays the sound to user.
Power management chip 608, the hardware for being connected by CPU602, I/O subsystem and Peripheral Interface are powered And power management.
In the present embodiment, central first processor 602 is used for:
The first voice data is sent to bluetooth protocol repertory, and obtains the memory space state of the bluetooth protocol repertory;
If the memory space state of the bluetooth protocol repertory is inadequate, not by described in first voice data write-in In bluetooth protocol repertory;
First voice data is retransmitted to the bluetooth protocol repertory.
Further, in addition to:
If the memory space state of the bluetooth protocol repertory is abundance, first voice data is write into the bluetooth In protocol stack, the voice data to be sent behind first voice data is sent to the bluetooth protocol repertory.
Further, it is described to retransmit first voice data to the bluetooth protocol repertory, including:
Detect whether the bluetooth protocol repertory is successfully transmitted second audio data to bluetooth equipment, if being successfully transmitted, First voice data is retransmitted to the bluetooth protocol repertory, the second audio data is the audio in the bluetooth protocol repertory Data;Or,
The memory space state of the bluetooth protocol repertory is monitored, when the memory space state of the bluetooth protocol repertory is recovered to fill When sufficient, first voice data is retransmitted to the bluetooth protocol repertory;Or,
After preset time period, first voice data is retransmitted to the bluetooth protocol repertory.
Further, detect whether the bluetooth protocol repertory is successfully transmitted second audio data to bluetooth equipment, Also include:
If failed send, second audio is sent to default spare storage space, to the bluetooth protocol repertory Retransmit first voice data.
Further, if the memory space state of the bluetooth protocol repertory is inadequate, not by the first audio number According to writing in the bluetooth protocol repertory, first voice data is retransmitted to the bluetooth protocol repertory, including:
If the memory space state of the bluetooth protocol repertory is inadequate, the remaining storage for obtaining the bluetooth protocol repertory is empty Between size;
First voice data is split according to the size of the residual memory space, obtains the first sub-audio According to the second sub-audio data, the size that first sub-audio data is taken up space is less than or equal to the residual memory space Size;
First sub-audio data is write in the bluetooth protocol repertory;
Second sub-audio data is retransmitted to the bluetooth protocol repertory.
Further:It is described to send the first voice data to bluetooth protocol repertory, and obtain the storage of the bluetooth protocol repertory Spatiality, including:
First voice data is sent to bluetooth protocol repertory by audio system Audio System, and obtains the bluetooth association Discuss the memory space state of the Bluetooth audio frequency mode A2DP frame buffer queues in stack;
If the memory space state of the bluetooth protocol repertory is inadequate, first voice data is not write In the bluetooth protocol repertory, including:
If the memory space state of the A2DP frame buffer queues is inadequate, first voice data is not write In the A2DP frame buffer queues;
It is described to retransmit first voice data to the bluetooth protocol repertory, including:
The Audio System are notified to retransmit first voice data to the bluetooth protocol repertory.
The embodiment of the present invention also provides a kind of storage medium for including terminal device executable instruction, and the terminal device can Execute instruction is when by terminal device computing device for performing a kind of transmission method of Bluetooth audio frequency data.This method bag Include:
The first voice data is sent to bluetooth protocol repertory, and obtains the memory space state of the bluetooth protocol repertory;
If the memory space state of the bluetooth protocol repertory is inadequate, not by described in first voice data write-in In bluetooth protocol repertory;
First voice data is retransmitted to the bluetooth protocol repertory.
The computer-readable storage medium of the embodiment of the present invention, any of one or more computer-readable media can be used Combination.Computer-readable medium can be computer-readable signal media or computer-readable recording medium.It is computer-readable Storage medium for example may be-but not limited to-the system of electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor, device or Device, or any combination above.The more specifically example (non exhaustive list) of computer-readable recording medium includes:Tool There are the electrical connections of one or more wires, portable computer diskette, hard disk, random access memory (RAM), read-only storage (ROM), erasable programmable read only memory (EPROM or flash memory), optical fiber, portable compact disc read-only storage (CD- ROM), light storage device, magnetic memory device or above-mentioned any appropriate combination.In this document, computer-readable storage Medium can be any includes or the tangible medium of storage program, the program can be commanded execution system, device or device Using or it is in connection.
Computer-readable signal media can include in a base band or as carrier wave a part propagation data-signal, Wherein carry computer-readable program code.The data-signal of this propagation can take various forms, including but unlimited In electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal media can also be that computer can Any computer-readable medium beyond storage medium is read, the computer-readable medium, which can send, propagates or transmit, to be used for By instruction execution system, device either device use or program in connection.
The program code included on computer-readable medium can be transmitted with any appropriate medium, including --- but it is unlimited In wireless, electric wire, optical cable, RF etc., or above-mentioned any appropriate combination.
It can be write with one or more programming languages or its combination for performing the computer that operates of the present invention Program code, programming language include object oriented program language-such as Java, Smalltalk, C++, also wrapped Include conventional procedural programming language-such as " C " language or similar programming language.Program code can be complete Ground is performed, partly performed on the user computer on the user computer, the software kit independent as one performs, partly existed Subscriber computer upper part is performed or performed completely on remote computer or server on the remote computer.It is being related to In the situation of remote computer, remote computer can pass through the network of any kind --- including LAN (LAN) or wide area Net (WAN)-be connected to subscriber computer, or, it may be connected to outer computer (such as utilize ISP To pass through Internet connection).
Certainly, a kind of storage medium for including computer executable instructions that the embodiment of the present invention is provided, its computer The transmission method operation for the Bluetooth audio frequency data that executable instruction is not limited to the described above, it can also carry out any implementation of the invention Associative operation in the transmission method for the Bluetooth audio frequency data that example is provided.
Fig. 7 is a kind of structural representation of terminal provided in an embodiment of the present invention, as shown in fig. 7, the terminal can include: Housing (not shown), second memory 701, central second processor (Central Processing Unit, CPU) 702 (also known as second processor, hereinafter referred to as CPU), it is stored on second memory 701 and can be run in second processor 702 Computer program, circuit board (not shown) and power circuit (not shown).The circuit board is placed in the housing The interior volume surrounded;The CPU702 and the second memory 701 are arranged on the circuit board;The power circuit, For each circuit or the device power supply for the mobile terminal;The second memory 701, for storing executable program generation Code;The CPU702 is held by reading the executable program code stored in the second memory 701 to run with described Program corresponding to line program code.
The terminal also includes:Peripheral Interface 703, RF (Radio Frequency, radio frequency) circuit 705, voicefrequency circuit 706th, loudspeaker 711, power management chip 707, input/output (I/O) subsystem 709, touch-screen 712, other input/controls Equipment 710 and outside port 704, these parts are communicated by one or more communication bus or signal wire 707.
It should be understood that graphic terminal 700 is only an example of mobile terminal, and terminal 700 can have Than more or less parts shown in figure, two or more parts can be combined, or there can be difference Part configuration.Various parts shown in figure can be including one or more signal transactings and/or application specific integrated circuit Realized in the combination of hardware inside, software or hardware and software.
It is used to realize that the transmission terminal of Bluetooth audio frequency data to be described in detail with regard to what the present embodiment provided below, the end End is by taking mobile phone as an example.
Second memory 701, the second memory 701 can be accessed by CPU702, Peripheral Interface 703 etc., and described Two memories 701 can include high random access second memory, can also include non-volatile second memory, such as one Individual or multiple disk second memory parts, flush memory device or other volatile solid-state second memory parts.
The input of equipment and output peripheral hardware can be connected to CPU702 and the by Peripheral Interface 703, the Peripheral Interface 703 Two memories 701.
I/O subsystems 709, the I/O subsystems 709 can be by the input/output peripherals in equipment, such as touch-screen 712 With other input/control devicess 710, Peripheral Interface 703 is connected to.I/O subsystems 709 can include the He of display controller 7091 For controlling one or more input controllers 7092 of other input/control devicess 710.Wherein, one or more input controls Device 7092 processed receives electric signal from other input/control devicess 710 or sends electric signal to other input/control devicess 710, Other input/control devicess 710 can include physical button (pressing button, rocker buttons etc.), dial, slide switch, behaviour Vertical pole, click on roller.What deserves to be explained is input controller 7092 can with it is following any one be connected:Keyboard, infrared port, The instruction equipment of USB interface and such as mouse.
Wherein, according to touch-screen operation principle and transmission information medium classification, touch-screen 712 can be resistance-type, Capacitor induction type, infrared-type or surface acoustic wave type.Classify according to mounting means, touch-screen 712 can be:It is external hanging type, built-in Formula or monoblock type.Classify according to technical principle, touch-screen 712 can be:Vector pressure sensing technology touch-screen, resistive technologies are touched Touch screen, capacitance technology touch-screen, infrared technology touch-screen or surface acoustic wave technique touch-screen.
Touch-screen 712, the touch-screen 712 are the input interface and output interface between user terminal and user, can It can include figure, text, icon, video etc. to user, visual output depending on output display.Optionally, touch-screen 712 is by user The electric signal (electric signal of such as contact surface) triggered on touch screen curtain, is sent to second processor 702.
Display controller 7091 in I/O subsystems 709 receives electric signal from touch-screen 712 or sent out to touch-screen 712 Electric signals.Touch-screen 712 detects the contact on touch-screen, and the contact detected is converted to and shown by display controller 7091 The interaction of user interface object on touch-screen 712, that is, realize man-machine interaction, the user interface being shown on touch-screen 712 Icon that object can be the icon of running game, be networked to corresponding network etc..What deserves to be explained is equipment can also include light Mouse, light mouse is not show the touch sensitive surface visually exported, or the extension of the touch sensitive surface formed by touch-screen.
RF circuits 705, it is mainly used in establishing the communication of mobile phone and wireless network (i.e. network side), realizes mobile phone and wireless network The data receiver of network and transmission.Such as transmitting-receiving short message, Email etc..
Voicefrequency circuit 706, it is mainly used in receiving voice data from Peripheral Interface 703, the voice data is converted into telecommunications Number, and the electric signal is sent to loudspeaker 711.
Loudspeaker 711, for the voice signal for receiving mobile phone from wireless network by RF circuits 705, it is reduced to sound And play the sound to user.
Power management chip 708, the hardware for being connected by CPU702, I/O subsystem and Peripheral Interface are powered And power management.
In the present embodiment, central second processor 702 is used for:
It is determined that currently it is sent to the first voice data of bluetooth protocol repertory;
Obtain the memory space state of the bluetooth protocol repertory;
If the memory space state of the bluetooth protocol repertory is inadequate, suspend to described in bluetooth protocol repertory transmission First voice data.
Further, suspend described to after bluetooth protocol repertory transmission first voice data, in addition to:
If the memory space state of the bluetooth protocol repertory recovers sufficient, described first is sent to the bluetooth protocol repertory Voice data, and first voice data is write in the bluetooth protocol repertory.
The embodiment of the present invention also provides a kind of storage medium for including terminal device executable instruction, and the terminal device can Execute instruction is when by terminal device computing device for performing a kind of transmission method of Bluetooth audio frequency data.This method bag Include:
It is determined that currently it is sent to the first voice data of bluetooth protocol repertory;
Obtain the memory space state of the bluetooth protocol repertory;
If the memory space state of the bluetooth protocol repertory is inadequate, suspend to described in bluetooth protocol repertory transmission First voice data.
The detail of the computer-readable storage medium of the embodiment of the present invention is similar to computer-readable storage medium recited above, Here is omitted.
The transmitting device for the Bluetooth audio frequency data that the executable foregoing all embodiments of the present invention of said apparatus are provided, terminal And storage medium, possess and perform the corresponding functional module of the above method and beneficial effect.Not detailed description in the present embodiment Ins and outs, reference can be made to the method that the foregoing all embodiments of the present invention are provided.
Pay attention to, above are only presently preferred embodiments of the present invention and institute's application technology principle.It will be appreciated by those skilled in the art that The invention is not restricted to specific embodiment described here, can carry out for a person skilled in the art various obvious changes, Readjust and substitute without departing from protection scope of the present invention.Therefore, although being carried out by above example to the present invention It is described in further detail, but the present invention is not limited only to above example, without departing from the inventive concept, also Other more equivalent embodiments can be included, and the scope of the present invention is determined by scope of the appended claims.

Claims (12)

  1. A kind of 1. transmission method of Bluetooth audio frequency data, it is characterised in that including:
    The first voice data is sent to bluetooth protocol repertory, and obtains the memory space state of the bluetooth protocol repertory;
    If the memory space state of the bluetooth protocol repertory is inadequate, first voice data bluetooth is not write into In protocol stack;
    First voice data is retransmitted to the bluetooth protocol repertory.
  2. 2. according to the method for claim 1, it is characterised in that also include:
    If the memory space state of the bluetooth protocol repertory is abundance, first voice data is write into the Bluetooth protocol In stack, the voice data to be sent behind first voice data is sent to the bluetooth protocol repertory.
  3. 3. according to the method for claim 1, it is characterised in that described to retransmit first audio to the bluetooth protocol repertory Data, including:
    Detect whether the bluetooth protocol repertory is successfully transmitted second audio data to bluetooth equipment, if being successfully transmitted, to institute State bluetooth protocol repertory and retransmit first voice data, the second audio data is the audio number in the bluetooth protocol repertory According to;Or,
    The memory space state of the bluetooth protocol repertory is monitored, when the memory space state of the bluetooth protocol repertory recovers sufficient When, retransmit first voice data to the bluetooth protocol repertory;Or,
    After preset time period, first voice data is retransmitted to the bluetooth protocol repertory.
  4. 4. according to the method for claim 3, it is characterised in that whether detect the bluetooth protocol repertory by second audio data It is successfully transmitted to bluetooth equipment, in addition to:
    If failed send, second audio is sent to default spare storage space, retransmitted to the bluetooth protocol repertory First voice data.
  5. 5. according to the method for claim 1, it is characterised in that if the memory space state of the bluetooth protocol repertory is not fill Foot, then first voice data is not write in the bluetooth protocol repertory, first sound is retransmitted to the bluetooth protocol repertory Frequency evidence, including:
    If the memory space state of the bluetooth protocol repertory is inadequate, the residual memory space of the bluetooth protocol repertory is obtained Size;
    First voice data is split according to the size of the residual memory space, obtain the first sub-audio data and Second sub-audio data, the size that first sub-audio data is taken up space are less than or equal to the big of the residual memory space It is small;
    First sub-audio data is write in the bluetooth protocol repertory;
    Second sub-audio data is retransmitted to the bluetooth protocol repertory.
  6. 6. according to the method for claim 1, it is characterised in that:
    It is described to send the first voice data to bluetooth protocol repertory, and the memory space state of the bluetooth protocol repertory is obtained, including:
    First voice data is sent to bluetooth protocol repertory by audio system Audio System, and obtains the bluetooth protocol repertory In Bluetooth audio frequency mode A2DP frame buffer queues memory space state;
    If the memory space state of the bluetooth protocol repertory is inadequate, not by described in first voice data write-in In bluetooth protocol repertory, including:
    If the memory space state of the A2DP frame buffer queues is inadequate, not by described in first voice data write-in In A2DP frame buffer queues;
    It is described to retransmit first voice data to the bluetooth protocol repertory, including:
    The Audio System are notified to retransmit first voice data to the bluetooth protocol repertory.
  7. A kind of 7. transmission method of Bluetooth audio frequency data, it is characterised in that including:
    It is determined that currently it is sent to the first voice data of bluetooth protocol repertory;
    Obtain the memory space state of the bluetooth protocol repertory;
    If the memory space state of the bluetooth protocol repertory is inadequate, suspends to the bluetooth protocol repertory and send described first Voice data.
  8. 8. according to the method for claim 7, it is characterised in that send described the in described suspend to the bluetooth protocol repertory After one voice data, in addition to:
    If the memory space state of the bluetooth protocol repertory recovers sufficient, first audio is sent to the bluetooth protocol repertory Data, and first voice data is write in the bluetooth protocol repertory.
  9. A kind of 9. transmitting device of Bluetooth audio frequency data, it is characterised in that including:
    First voice data sending module, for sending the first voice data to bluetooth protocol repertory, and obtain the Bluetooth protocol The memory space state of stack;
    First voice data writing module, if the memory space state for the bluetooth protocol repertory is inadequate, not by institute The first voice data is stated to write in the bluetooth protocol repertory;
    First voice data retransmits module, for retransmitting first voice data to the bluetooth protocol repertory.
  10. A kind of 10. transmitting device of Bluetooth audio frequency data, it is characterised in that including:
    First voice data determining module, for determining currently to be sent to the first voice data of bluetooth protocol repertory;
    Memory space state acquisition module, for obtaining the memory space state of the bluetooth protocol repertory;
    First voice data sending module, if the memory space state for the bluetooth protocol repertory to be inadequate, suspend to The bluetooth protocol repertory sends first voice data.
  11. 11. a kind of terminal, including memory, processor and it is stored on the memory and can runs on the processor Computer program, it is characterised in that realized described in the computing device during computer program such as any institute in claim 1-8 The transmission method for the Bluetooth audio frequency data stated.
  12. 12. a kind of storage medium, is stored thereon with computer program, it is characterised in that the program is realized when being executed by processor The transmission method of Bluetooth audio frequency data as described in any in claim 1-8.
CN201710757912.7A 2017-08-29 2017-08-29 Transmission method, device, terminal and the storage medium of Bluetooth audio frequency data Pending CN107404340A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710757912.7A CN107404340A (en) 2017-08-29 2017-08-29 Transmission method, device, terminal and the storage medium of Bluetooth audio frequency data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710757912.7A CN107404340A (en) 2017-08-29 2017-08-29 Transmission method, device, terminal and the storage medium of Bluetooth audio frequency data

Publications (1)

Publication Number Publication Date
CN107404340A true CN107404340A (en) 2017-11-28

Family

ID=60398072

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710757912.7A Pending CN107404340A (en) 2017-08-29 2017-08-29 Transmission method, device, terminal and the storage medium of Bluetooth audio frequency data

Country Status (1)

Country Link
CN (1) CN107404340A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107889092A (en) * 2017-11-30 2018-04-06 广东欧珀移动通信有限公司 Bluetooth devices control method, device, terminal device and storage medium
CN108563468A (en) * 2018-03-30 2018-09-21 深圳市冠旭电子股份有限公司 A kind of method, apparatus and Baffle Box of Bluetooth of Baffle Box of Bluetooth data processing
CN109151194A (en) * 2018-08-14 2019-01-04 Oppo广东移动通信有限公司 Data transmission method, device, electronic equipment and storage medium
CN110022189A (en) * 2019-04-02 2019-07-16 惠州Tcl移动通信有限公司 Data transmission method, device, terminal and storage medium
CN111031437A (en) * 2019-12-27 2020-04-17 恒玄科技(北京)有限公司 Wireless earphone assembly and communication method thereof

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020028658A1 (en) * 2000-09-01 2002-03-07 Kabushiki Kaisha Toshiba Broadcast type service system using bluetooth type radio network
CN101877604A (en) * 2010-06-22 2010-11-03 中兴通讯股份有限公司 Method and system for transmitting files
CN103905300A (en) * 2012-12-25 2014-07-02 华为技术有限公司 Data message sending method, device and system
CN105472377A (en) * 2015-11-24 2016-04-06 深圳创维-Rgb电子有限公司 Television debugging method and apparatus thereof
CN106571894A (en) * 2016-11-10 2017-04-19 深圳市民德电子科技股份有限公司 Bluetooth information sending and receiving methods

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020028658A1 (en) * 2000-09-01 2002-03-07 Kabushiki Kaisha Toshiba Broadcast type service system using bluetooth type radio network
CN101877604A (en) * 2010-06-22 2010-11-03 中兴通讯股份有限公司 Method and system for transmitting files
CN103905300A (en) * 2012-12-25 2014-07-02 华为技术有限公司 Data message sending method, device and system
CN105472377A (en) * 2015-11-24 2016-04-06 深圳创维-Rgb电子有限公司 Television debugging method and apparatus thereof
CN106571894A (en) * 2016-11-10 2017-04-19 深圳市民德电子科技股份有限公司 Bluetooth information sending and receiving methods

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107889092A (en) * 2017-11-30 2018-04-06 广东欧珀移动通信有限公司 Bluetooth devices control method, device, terminal device and storage medium
CN107889092B (en) * 2017-11-30 2021-03-12 Oppo广东移动通信有限公司 Bluetooth device communication control method, device, terminal device and storage medium
CN108563468A (en) * 2018-03-30 2018-09-21 深圳市冠旭电子股份有限公司 A kind of method, apparatus and Baffle Box of Bluetooth of Baffle Box of Bluetooth data processing
CN108563468B (en) * 2018-03-30 2021-09-21 深圳市冠旭电子股份有限公司 Bluetooth sound box data processing method and device and Bluetooth sound box
US11199893B2 (en) 2018-03-30 2021-12-14 Shenzhen Grandsun Electronic Co., Ltd. Method, device for processing data of bluetooth speaker, and bluetooth speaker
CN109151194A (en) * 2018-08-14 2019-01-04 Oppo广东移动通信有限公司 Data transmission method, device, electronic equipment and storage medium
CN110022189A (en) * 2019-04-02 2019-07-16 惠州Tcl移动通信有限公司 Data transmission method, device, terminal and storage medium
CN111031437A (en) * 2019-12-27 2020-04-17 恒玄科技(北京)有限公司 Wireless earphone assembly and communication method thereof

Similar Documents

Publication Publication Date Title
CN107404340A (en) Transmission method, device, terminal and the storage medium of Bluetooth audio frequency data
CN110336720B (en) Equipment control method and equipment
US11057376B2 (en) Method, apparatus, and system for controlling intelligent device, and storage medium
CN106789562B (en) Virtual article sending method, virtual article receiving method, virtual article sending device, virtual article receiving device and virtual article sending system
WO2021114952A1 (en) Data processing method, terminal device, bluetooth device, and storage medium
US9526071B2 (en) Method and apparatus for operating wake on WLAN
CN107332976B (en) Karaoke method, device, equipment and system
CN104635501A (en) Intelligent home control method and system
CN107274902A (en) Phonetic controller and method for household electrical appliances
CN108024128B (en) Control method and device for Bluetooth music playing, terminal equipment and storage medium
CN105491135B (en) Establish the method and device of data connection
CN108243481A (en) Document transmission method and device
CN103634717A (en) Method, device and terminal equipment utilizing earphone to control
WO2021228131A1 (en) Information transmission method and apparatus, and electronic device
CN109495573A (en) Data transmission method, device, storage medium and terminal
CN108494639A (en) Network access method and mobile terminal
WO2019033532A1 (en) Method and apparatus for establishing bearer
CN107743096A (en) Network optimized approach, device, terminal and storage medium
CN107395473A (en) Network-building method, device and the terminal device of household electrical appliance
WO2022135157A1 (en) Page display method and apparatus, and electronic device and readable storage medium
CN107205075A (en) A kind of smart projector of achievable handset program speech control
CN107809742A (en) Processing method, device, storage medium and the terminal of location information
CN106027738B (en) A kind of synchronous method of message registration, device and mobile terminal
CN205545653U (en) Visual wireless doorbell intelligence machine of talkbacking in internet
CN106874131A (en) Broadcast queue's method of adjustment, device and terminal device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20171128