CN112333610A - Audio playing method and device of Bluetooth TWS equipment - Google Patents

Audio playing method and device of Bluetooth TWS equipment Download PDF

Info

Publication number
CN112333610A
CN112333610A CN202011236825.5A CN202011236825A CN112333610A CN 112333610 A CN112333610 A CN 112333610A CN 202011236825 A CN202011236825 A CN 202011236825A CN 112333610 A CN112333610 A CN 112333610A
Authority
CN
China
Prior art keywords
sample
bluetooth
bluetooth clock
audio
equipment
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.)
Granted
Application number
CN202011236825.5A
Other languages
Chinese (zh)
Other versions
CN112333610B (en
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.)
Actions Technology Co Ltd
Original Assignee
Actions Technology Co 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 Actions Technology Co Ltd filed Critical Actions Technology Co Ltd
Priority to CN202011236825.5A priority Critical patent/CN112333610B/en
Publication of CN112333610A publication Critical patent/CN112333610A/en
Application granted granted Critical
Publication of CN112333610B publication Critical patent/CN112333610B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04RLOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
    • H04R3/00Circuits for transducers, loudspeakers or microphones
    • H04R3/12Circuits for transducers, loudspeakers or microphones for distributing signals to two or more loudspeakers

Abstract

The main purpose of the embodiments of the present invention is to provide an audio playing method for a bluetooth TWS device, where the bluetooth TWS device includes a first device and a second device, and the method includes: the first equipment and the second equipment unpack the audio data packet into data frames with the same playing length; the first equipment acquires a Bluetooth clock t _ base required by data frame playing, and the second equipment acquires a Bluetooth clock t _ local required by data frame playing; the second equipment calculates the sample point deviation according to the difference between the Bluetooth clock t _ base and the Bluetooth clock t _ local; compensating the first device and/or the second device according to the sample point deviation. The embodiment of the invention also correspondingly provides audio playing of the Bluetooth TWS equipment. By adopting the technical scheme provided by the embodiment of the invention, the communication bandwidth consumption between the TWS equipment can be effectively reduced.

Description

Audio playing method and device of Bluetooth TWS equipment
Technical Field
The present application relates to the field of multimedia technologies, and in particular, to an audio playing method and apparatus for a bluetooth TWS device.
Background
With the advance of technology, wireless audio devices, such as wireless headsets, are becoming increasingly popular in the multimedia technology field. The most common of the Wireless earphones is the bluetooth earphone, and at present, two earphones which are completely independent are generally called as TWS (True Wireless Stereo) earphones, that is, the two earphones do not need to be connected by wire, each earphone is an independent Wireless earphone, technically, the mobile phone is connected with a main earphone, and then the main earphone is connected with a slave earphone by a bluetooth Wireless mode, so that the real bluetooth left and right sound channels are separated wirelessly for use. When the slave is not connected, the master returns to the mono tone quality.
When two earphones of a TWS device in the prior art start playing, because the bluetooth clocks of the master earphone device and the slave earphone device and the clocks of the audio module are not the same, playing information of a certain time point needs to be interacted at regular time, and whether a sample point deviation exists between the two devices is judged through the playing information. Because the total amount of communication bandwidth of bluetooth is certain, the prior art may cause the two bluetooth devices to interact too frequently, which affects normal bluetooth audio streaming. Therefore, a solution is needed to solve the problem of frequent information exchange between TWS bluetooth devices.
Disclosure of Invention
In view of this, an embodiment of the present invention provides an audio playing method for a bluetooth TWS device, which can effectively reduce communication bandwidth consumption between the TWS devices.
The embodiment of the invention is realized in such a way that an audio playing method of a Bluetooth TWS device comprises a first device and a second device, and the method comprises the following steps:
the first equipment and the second equipment unpack the audio data packet into data frames with the same playing length;
the first equipment acquires a Bluetooth clock t _ base required by data frame playing, and the second equipment acquires a Bluetooth clock t _ local required by data frame playing;
the second equipment calculates the sample point deviation according to the difference between the Bluetooth clock t _ base and the Bluetooth clock t _ local;
compensating the first device and/or the second device according to the sample point deviation.
Further, the first device sends the t _ base to the second device.
Further, the unpacking the audio data packets into data frames with the same playing length includes: and splitting the audio data packet into at least one audio frame according to the number of frames and the frame length in the audio data packet, wherein the length of each audio frame is consistent.
Further, the calculating the sample point deviation comprises:
calculating a Bluetooth clock t _ sample corresponding to the sample point of the single audio frame according to the Bluetooth clock t _ base and the sample point sample of the single audio frame;
calculating the Bluetooth clock deviation t _ diff of the first equipment and the second equipment according to the Bluetooth clock t _ base and the Bluetooth clock t _ local;
and calculating a sample point deviation sample _ diff according to the Bluetooth clock deviation t _ diff and the Bluetooth clock t _ sample corresponding to the sample point of the single audio frame.
Further, a bluetooth clock corresponding to the sample point of the single audio frame is t _ base/sample;
the bluetooth clock bias t _ diff ═ abs (t _ local-t _ base);
the sample point offset sample _ diff _ t _ sample.
Further, the compensating the first device and/or the second device according to the sample point deviation comprises:
if t _ local is greater than t _ base, then the second device discards sample _ diff sample points;
if t _ local is less than t _ base, the second device increments sample _ diff sample points.
Further, the method further comprises,
the first device and/or the second device compensate for increased sample points or missing sample points by sample rate tweaking.
Further, the first device is a TWS master device, and the second device is a TWS slave device.
According to another aspect of the embodiments of the present invention, an embodiment of the present invention further provides an audio playing apparatus for a bluetooth TWS device, which can effectively reduce communication bandwidth consumption between the TWS devices.
The embodiment of the present invention is implemented as follows, an audio playing apparatus of a bluetooth TWS device, where the bluetooth TWS device includes a first device and a second device, and the audio playing apparatus includes:
unpacking device to unpack the audio data package into data frames with the same playing length;
clock acquisition means, configured to acquire a bluetooth clock t _ base required for playing a data frame by the first device, and acquire a bluetooth clock t _ local required for playing a data frame by the second device;
calculating means for calculating a sample point deviation according to a difference between the bluetooth clock t _ base and the bluetooth clock t _ local;
and the compensating device is used for compensating the first equipment and/or the second equipment according to the sample point deviation.
Further, the audio playing device further comprises: and the sending device is used for the first equipment to send the t _ base to the second equipment.
Further, the computing device further comprises:
the Bluetooth clock calculation device is used for calculating the Bluetooth clock t _ sample corresponding to the sample point of the single audio frame according to the Bluetooth clock t _ base and the sample point sample of the single audio frame;
the Bluetooth clock deviation calculating device is used for calculating the Bluetooth clock deviation t _ diff of the first equipment and the second equipment according to the Bluetooth clock t _ base and the Bluetooth clock t _ local;
and the sample point deviation calculating device is used for calculating the sample point deviation sample _ diff according to the Bluetooth clock deviation t _ diff and the Bluetooth clock t _ sample corresponding to the sample point of the single audio frame.
According to the technical scheme, the embodiment of the invention has the following effects: the method can reduce the communication bandwidth consumption between the TWS devices, reduce the retransmission times, improve the anti-interference capability and finally realize the smoothness of a data flow channel, thereby reducing the time delay caused by blockage.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
fig. 1 shows a flowchart of an audio playing method of a bluetooth TWS device provided by the present application;
fig. 2 is a flowchart illustrating an audio playing method of the bluetooth TWS device according to another embodiment of the present disclosure.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the accompanying drawings in conjunction with embodiments, and the order of steps in the following embodiments is merely illustrative and can be modified without conflict.
As shown in fig. 1, an audio playing method of a bluetooth TWS device provided in an embodiment of the present invention is described, where the bluetooth TWS device includes a first device and a second device, and the method includes:
s101, the first device and the second device unpack the audio data packet into data frames with the same playing length;
s102, the first equipment acquires a Bluetooth clock t _ base required by data frame playing, and the second equipment acquires a Bluetooth clock t _ local required by data frame playing;
s103, calculating a sample point deviation by the second equipment according to the difference between the Bluetooth clock t _ base and the Bluetooth clock t _ local;
s104, compensating the first device and/or the second device according to the sample point deviation.
The above-described flow is described in detail with reference to fig. 2. Specifically, since the size of each audio packet is different, but the time for which each audio frame can be played is constant, we first perform an unpacking operation, and the first device and the second device unpack the audio packet into data frames with the same playing length, in order to use a bluetooth clock as a playing reference, for example, 3000us for one data frame, 2800us for a bluetooth clock, and split the audio packet into at least one audio frame according to the frame number and the frame length in the audio packet, where the length of each audio frame is the same. In the process of playing, one of the bluetooth devices, for example, the first device, in this embodiment, the TWS master device, sends the bluetooth clock t _ base consumed by playing a certain frame to another bluetooth device, that is, the second device, in this embodiment, the TWS slave device, and the second device monitors the bluetooth clock t _ local played by itself for each frame, and then compensates for the sample point deviation of the first device and/or the second device according to the difference between t _ local and t _ base. The compensation of the sample point deviation can be performed only on the first device, or can be performed only on the second device, and the first device and the second device are compensated at the same time according to requirements.
In another embodiment, as shown in fig. 2, a specific process for calculating the sample point deviation is as follows, a bluetooth clock t _ sample corresponding to a sample point of a single audio frame is calculated according to the bluetooth clock t _ base and the sample point sample of the single audio frame; calculating the Bluetooth clock deviation t _ diff of the first equipment and the second equipment according to the Bluetooth clock t _ base and the Bluetooth clock t _ local; and calculating a sample point deviation sample _ diff according to the Bluetooth clock deviation t _ diff and the Bluetooth clock t _ sample corresponding to the sample point of the single audio frame. In this embodiment, the first device and the second device are a host and a secondary of the TWS, respectively, where the first device is the host and the second device is the secondary, specifically, if the sample point of each frame is sample, the bluetooth clock corresponding to a single sample point is t _ sample _ base/sample, the bluetooth clock offset of the primary and secondary is t _ diff _ abs (t _ local-t _ base), the corresponding sample point offset is sample _ diff _ t _ sample, if t _ local is greater than t _ base, the secondary needs to drop sample _ diff sample points, if t _ local is less than t _ base, the secondary needs to add sample _ diff sample points, and only one time of information interaction between the primary and secondary is needed, and subsequent adjustment is performed by itself, that is, the added sample point or the lack of sample point is compensated by single-sided fine adjustment. The audio stream is composed of a plurality of sample points, the sample points have different precisions, for example, 16 bits constitute one sample point, and 32 bits constitute one sample point.
In the foregoing process, after calculating the sample point deviation, the first device and/or the second device compensates for the added sample point or the missing sample point by fine-tuning the sampling rate. Compensating for the sample point deviation of the first device and/or the second device may be performed according to the following procedure, and if t _ local is greater than t _ base, the second device discards sample _ diff sample points; if t _ local is less than t _ base, the second device increments sample _ diff sample points.
According to another aspect of the embodiments of the present invention, an embodiment of the present invention further provides an audio playing apparatus of a bluetooth TWS device, where the bluetooth TWS device includes a first device and a second device, and the audio playing apparatus includes:
unpacking device to unpack the audio data package into data frames with the same playing length;
clock acquisition means, configured to acquire a bluetooth clock t _ base required for playing a data frame by the first device, and acquire a bluetooth clock t _ local required for playing a data frame by the second device;
calculating means for calculating a sample point deviation according to a difference between the bluetooth clock t _ base and the bluetooth clock t _ local;
and the compensating device is used for compensating the first equipment and/or the second equipment according to the sample point deviation.
Further, the audio playing device further comprises: and the sending device is used for the first equipment to send the t _ base to the second equipment.
Further, the computing device further comprises:
the Bluetooth clock calculation device is used for calculating the Bluetooth clock t _ sample corresponding to the sample point of the single audio frame according to the Bluetooth clock t _ base and the sample point sample of the single audio frame;
the Bluetooth clock deviation calculating device is used for calculating the Bluetooth clock deviation t _ diff of the first equipment and the second equipment according to the Bluetooth clock t _ base and the Bluetooth clock t _ local;
and the sample point deviation calculating device is used for calculating the sample point deviation sample _ diff according to the Bluetooth clock deviation t _ diff and the Bluetooth clock t _ sample corresponding to the sample point of the single audio frame.
Since the technical solution of the audio playing apparatus of the bluetooth TWS device corresponds to the audio playing method of the bluetooth TWS device, this embodiment is not described in detail.
The above description is only a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be appreciated by a person skilled in the art that the scope of the invention as referred to in the present application is not limited to the embodiments with a specific combination of the above-mentioned features, but also covers other embodiments with any combination of the above-mentioned features or their equivalents without departing from the inventive concept. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.

Claims (11)

1. An audio playing method of a bluetooth TWS device, the bluetooth TWS device comprising a first device and a second device, the method comprising:
the first equipment and the second equipment unpack the audio data packet into data frames with the same playing length;
the first equipment acquires a Bluetooth clock t _ base required by data frame playing, and the second equipment acquires a Bluetooth clock t _ local required by data frame playing;
the second equipment calculates the sample point deviation according to the difference between the Bluetooth clock t _ base and the Bluetooth clock t _ local;
compensating the first device and/or the second device according to the sample point deviation.
2. The audio playing method according to claim 1, wherein the method further comprises: and the first equipment sends the t _ base to the second equipment.
3. The audio playing method of claim 1, wherein the unpacking the audio data packets into data frames with the same playing length comprises: and splitting the audio data packet into at least one audio frame according to the number of frames and the frame length in the audio data packet, wherein the length of each audio frame is consistent.
4. The audio playing method according to claim 1, wherein the calculating the sample point deviation comprises:
calculating a Bluetooth clock t _ sample corresponding to the sample point of the single audio frame according to the Bluetooth clock t _ base and the sample point sample of the single audio frame;
calculating the Bluetooth clock deviation t _ diff of the first equipment and the second equipment according to the Bluetooth clock t _ base and the Bluetooth clock t _ local;
and calculating a sample point deviation sample _ diff according to the Bluetooth clock deviation t _ diff and the Bluetooth clock t _ sample corresponding to the sample point of the single audio frame.
5. The audio playback method according to claim 4,
the Bluetooth clock corresponding to the sample point of the single audio frame is t _ base/sample;
the bluetooth clock bias t _ diff ═ abs (t _ local-t _ base);
the sample point offset sample _ diff _ t _ sample.
6. The audio playing method according to claim 4, wherein the compensating the first device and/or the second device according to the sample point deviation comprises:
if t _ local is greater than t _ base, then the second device discards sample _ diff sample points;
if t _ local is less than t _ base, the second device increments sample _ diff sample points.
7. The audio playing method according to claim 1, wherein the method further comprises,
the first device and/or the second device compensate for increased sample points or missing sample points by sample rate tweaking.
8. The audio playing method according to any one of claims 1 to 7, wherein the first device is a TWS master device, and the second device is a TWS slave device.
9. An audio playing apparatus of a bluetooth TWS device, the bluetooth TWS device comprising a first device and a second device, the audio playing apparatus comprising:
unpacking device to unpack the audio data package into data frames with the same playing length;
clock acquisition means, configured to acquire a bluetooth clock t _ base required for playing a data frame by the first device, and acquire a bluetooth clock t _ local required for playing a data frame by the second device;
calculating means for calculating a sample point deviation according to a difference between the bluetooth clock t _ base and the bluetooth clock t _ local;
and the compensating device is used for compensating the first equipment and/or the second equipment according to the sample point deviation.
10. The audio playback apparatus of a bluetooth TWS device according to claim 9, wherein the audio playback apparatus further comprises: and the sending device is used for the first equipment to send the t _ base to the second equipment.
11. The audio playback apparatus of a bluetooth TWS device according to claim 9, wherein the computing apparatus further comprises:
the Bluetooth clock calculation device is used for calculating the Bluetooth clock t _ sample corresponding to the sample point of the single audio frame according to the Bluetooth clock t _ base and the sample point sample of the single audio frame;
the Bluetooth clock deviation calculating device is used for calculating the Bluetooth clock deviation t _ diff of the first equipment and the second equipment according to the Bluetooth clock t _ base and the Bluetooth clock t _ local;
and the sample point deviation calculating device is used for calculating the sample point deviation sample _ diff according to the Bluetooth clock deviation t _ diff and the Bluetooth clock t _ sample corresponding to the sample point of the single audio frame.
CN202011236825.5A 2020-11-06 2020-11-06 Audio playing method and device of Bluetooth TWS equipment Active CN112333610B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011236825.5A CN112333610B (en) 2020-11-06 2020-11-06 Audio playing method and device of Bluetooth TWS equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011236825.5A CN112333610B (en) 2020-11-06 2020-11-06 Audio playing method and device of Bluetooth TWS equipment

Publications (2)

Publication Number Publication Date
CN112333610A true CN112333610A (en) 2021-02-05
CN112333610B CN112333610B (en) 2022-06-10

Family

ID=74316842

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011236825.5A Active CN112333610B (en) 2020-11-06 2020-11-06 Audio playing method and device of Bluetooth TWS equipment

Country Status (1)

Country Link
CN (1) CN112333610B (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2006046015A1 (en) * 2004-10-26 2006-05-04 M.I.E. Medical Research Ltd. Apparatus and method for transmitting data by radio
US20090325492A1 (en) * 2008-06-25 2009-12-31 Industrial Technology Research Institute Transmission method and transmission system
US20130317832A1 (en) * 2011-02-02 2013-11-28 Hitachi Kokusai Electric Inc. Audio frame timing correction method and wireless device
CN106373600A (en) * 2016-10-08 2017-02-01 广东欧珀移动通信有限公司 Audio synchronous play method, audio synchronous play device, audio synchronous play system and terminal
CN106559735A (en) * 2015-09-28 2017-04-05 展讯通信(上海)有限公司 Blue-teeth data sending control method and device
CN108415685A (en) * 2018-07-12 2018-08-17 恒玄科技(上海)有限公司 Wireless Bluetooth headsets realize the method being precisely played simultaneously
CN110769347A (en) * 2019-12-27 2020-02-07 恒玄科技(北京)有限公司 Synchronous playing method of earphone assembly and earphone assembly
CN110838854A (en) * 2018-08-19 2020-02-25 原睿科技股份有限公司 Bluetooth wireless device and method for using the same
WO2020107466A1 (en) * 2018-11-30 2020-06-04 华为技术有限公司 Point to multi-point data transmission method and device
CN111817811A (en) * 2020-06-22 2020-10-23 芯原微电子(上海)股份有限公司 TWS earphone audio frequency synchronous playing method and system, TWS earphone

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2006046015A1 (en) * 2004-10-26 2006-05-04 M.I.E. Medical Research Ltd. Apparatus and method for transmitting data by radio
US20090325492A1 (en) * 2008-06-25 2009-12-31 Industrial Technology Research Institute Transmission method and transmission system
US20130317832A1 (en) * 2011-02-02 2013-11-28 Hitachi Kokusai Electric Inc. Audio frame timing correction method and wireless device
CN106559735A (en) * 2015-09-28 2017-04-05 展讯通信(上海)有限公司 Blue-teeth data sending control method and device
CN106373600A (en) * 2016-10-08 2017-02-01 广东欧珀移动通信有限公司 Audio synchronous play method, audio synchronous play device, audio synchronous play system and terminal
CN108415685A (en) * 2018-07-12 2018-08-17 恒玄科技(上海)有限公司 Wireless Bluetooth headsets realize the method being precisely played simultaneously
CN110838854A (en) * 2018-08-19 2020-02-25 原睿科技股份有限公司 Bluetooth wireless device and method for using the same
WO2020107466A1 (en) * 2018-11-30 2020-06-04 华为技术有限公司 Point to multi-point data transmission method and device
CN110769347A (en) * 2019-12-27 2020-02-07 恒玄科技(北京)有限公司 Synchronous playing method of earphone assembly and earphone assembly
CN111817811A (en) * 2020-06-22 2020-10-23 芯原微电子(上海)股份有限公司 TWS earphone audio frequency synchronous playing method and system, TWS earphone

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
廖文彬: "基于2.4G无线组网技术的时间校准系统", 《智库时代》 *

Also Published As

Publication number Publication date
CN112333610B (en) 2022-06-10

Similar Documents

Publication Publication Date Title
JP7230008B2 (en) Systems and methods for providing real-time audio and data
JP7120997B2 (en) Multi-mode synchronous rendering of audio and video
CN111918261B (en) Bluetooth audio equipment synchronous playing method and system and Bluetooth audio master and slave equipment
RU2510587C2 (en) Synchronising remote audio with fixed video
KR101655456B1 (en) Ad-hoc adaptive wireless mobile sound system and method therefor
US8345681B2 (en) Method and system for wireless communication of audio in wireless networks
CN101827271B (en) Audio and video synchronized method and device as well as data receiving terminal
US20220038769A1 (en) Synchronizing bluetooth data capture to data playback
US11503405B2 (en) Capturing and synchronizing data from multiple sensors
US20230216910A1 (en) Audio synchronization in wireless systems
US20160196851A1 (en) Methods and devices for distributed audio/video synchronization and playback using an a/v orchestrator
CN112333610B (en) Audio playing method and device of Bluetooth TWS equipment
EP1759292A1 (en) Video and audio synchronization
KR102048685B1 (en) Method for judging the time synchronization of a media transmission device in a vehicle avb network
JP2008028599A (en) Reproduction method of multimedia data, and main communication apparatus, sub-communication apparatus, and program for execution of the method
US20230102871A1 (en) Bluetooth voice communication system and related computer program product for generating stereo voice effect
JP5591954B2 (en) Method and apparatus for quieting a transmitter in a white space device
CN115549832A (en) Audio synchronization method, audio playing device and storage medium
Ok et al. A synchronized playback method with dynamic buffering time awareness for media streaming
CN112367584A (en) Audio playing method and device of Bluetooth TWS equipment
CN112235685A (en) Sound box networking method and sound box system
JP2013516909A (en) Transport layer modification to enable transmission gap

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
GR01 Patent grant
GR01 Patent grant