CN112333610B - 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
CN112333610B
CN112333610B CN202011236825.5A CN202011236825A CN112333610B CN 112333610 B CN112333610 B CN 112333610B CN 202011236825 A CN202011236825 A CN 202011236825A CN 112333610 B CN112333610 B CN 112333610B
Authority
CN
China
Prior art keywords
sample
bluetooth
bluetooth clock
base
sample point
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.)
Active
Application number
CN202011236825.5A
Other languages
Chinese (zh)
Other versions
CN112333610A (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

Landscapes

  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Otolaryngology (AREA)
  • Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Acoustics & Sound (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)

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 are completely independent and generally called as TWS (True Wireless Stereo) earphones, that is, wired connection is not needed between the two earphones, each earphone is an independent Wireless earphone, and technically, the mobile phone is connected with a master earphone, and then the master earphone is connected with a slave earphone in a bluetooth Wireless manner, so that real bluetooth left and right sound channels are wirelessly separated for use. When the slave earphone is not connected, the master earphone returns to the mono sound 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 determined, the prior art may cause interaction between two bluetooth devices too frequently, which may affect 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 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, where the first device and the second device unpack the audio packet into data frames with the same play length, so as to use a bluetooth clock as a play reference, for example, a data frame is 3000us, corresponding to the bluetooth clock is 2800us, the bluetooth clock has an accuracy of 1us, and split the audio packet into at least one audio frame according to the number of frames in the audio packet and the frame length, 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 (8)

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;
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; calculating a sample point deviation sample _ diff according to the Bluetooth clock deviation t _ diff and a Bluetooth clock t _ sample corresponding to the sample point of the single audio frame; 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.
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 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.
5. 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.
6. The audio playing method according to any one of claims 1 to 5, wherein the first device is a TWS master device and the second device is a TWS slave device.
7. 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;
the compensation device is used for compensating the first equipment and/or the second equipment according to the sample point deviation;
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;
the sample point deviation calculating device is used for 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;
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.
8. The audio playback apparatus of a bluetooth TWS device according to claim 7, wherein the audio playback apparatus further comprises: a sending device, configured to send the t _ base to the second device by the first device.
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 CN112333610A (en) 2021-02-05
CN112333610B true 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 (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106373600A (en) * 2016-10-08 2017-02-01 广东欧珀移动通信有限公司 Audio synchronous play method, audio synchronous play device, audio synchronous play system and terminal
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

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB0423696D0 (en) * 2004-10-26 2004-11-24 M I E Medical Res Ltd Apparatus and method for transmitting data by radio
TWI360309B (en) * 2008-06-25 2012-03-11 Ind Tech Res Inst Transmission method and transmission system
JP5852311B2 (en) * 2011-02-02 2016-02-03 株式会社日立国際電気 Audio frame timing correction method and radio
CN106559735B (en) * 2015-09-28 2019-06-07 展讯通信(上海)有限公司 Blue-teeth data sending control method and device
CN108415685B (en) * 2018-07-12 2018-12-14 恒玄科技(上海)有限公司 Wireless Bluetooth headsets realize the method being precisely played simultaneously

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106373600A (en) * 2016-10-08 2017-02-01 广东欧珀移动通信有限公司 Audio synchronous play method, audio synchronous play device, audio synchronous play system and terminal
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无线组网技术的时间校准系统;廖文彬;《智库时代》;20191231;第240、253页 *

Also Published As

Publication number Publication date
CN112333610A (en) 2021-02-05

Similar Documents

Publication Publication Date Title
CN109906613B (en) Multi-mode synchronized rendering of audio and video
JP7230008B2 (en) Systems and methods for providing real-time audio and data
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
WO2015000328A1 (en) Method and system for simultaneously outputting audio
CN101827271B (en) Audio and video synchronized method and device as well as data receiving terminal
CN109168059B (en) Lip sound synchronization method for respectively playing audio and video on different devices
US20220038769A1 (en) Synchronizing bluetooth data capture to data playback
US10587954B2 (en) Packet based delivery of multi-channel audio over wireless links
US9679610B2 (en) Methods and devices for distributed audio/video synchronization and playback using an A/V orchestrator
US11503405B2 (en) Capturing and synchronizing data from multiple sensors
US20230216910A1 (en) Audio synchronization in wireless systems
CN111629158A (en) Audio stream and video stream synchronous switching method and device
CN112333610B (en) Audio playing method and device of Bluetooth TWS equipment
WO2005119452A1 (en) Video and audio synchronization
CN112449233A (en) Method for decoding an incoming audio/video system
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
WO2023273591A1 (en) Audio synchronization method, audio playing device and storage medium
JP5598001B2 (en) Reception device, audio signal transmission method, and audio signal transmission system
Ok et al. A synchronized playback method with dynamic buffering time awareness for media streaming
Kim et al. Precise synchronization mechanism in wireless devices
CN115883711A (en) Bluetooth voice communication system and storage circuit
JP2013516910A (en) Application layer modification to enable transmission gap
JP2016146586A (en) Synchronous control system, synchronous control method and program

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