Synchronous playback recovery method, wireless earphone, earphone and storage medium
By receiving the synchronization detection message in the wireless headset and comparing the data packet identification, the recovery strategy is determined, which solves the problem of out-of-synchronization of TWS headset playback, achieves efficient synchronous playback recovery, and improves the intelligence and playback effect of the headset.
Patent Information
- Application Number
- CN202011112022.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-10-16
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2040-10-16
AI Technical Summary
When existing TWS headsets play out of sync, the audio needs to be interrupted to restart playback. Although controlling the playback speed avoids interruption, the processing efficiency is low, resulting in reduced intelligence and unsatisfactory playback effects.
By using the preset detection strategy in the wireless headset to receive the synchronization detection message, comparing the data packet identification, determining the recovery strategy and playing the target data packet when the data packet playback is completed, the recovery of synchronous playback is achieved.
It effectively restores the synchronous playback of the wireless earphones, improves the intelligence and playback effect of the wireless earphones, and solves the problem of low processing efficiency in the existing technology.
Smart Images

Figure CN114390404B
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of terminal technology, and in particular to a synchronous playback recovery method, wireless headphones, headphones, and storage medium. Background Art
[0002] With the continuous advancement and development of technology, True Wireless Stereo (TWS) earphones, which were spawned by TWS technology, have applied TWS technology to the field of Bluetooth wireless earphones. TWS earphones do not require cable connections and can work independently by wirelessly separating the left and right channels.
[0003] Since the left and right earphones of the TWS headset run as independent systems, there will be a situation where the playback is not synchronized. At this time, it is necessary to take timely recovery mechanisms to restore the synchronous playback. At present, common recovery mechanisms mainly include restarting the playback and controlling the playback speed. However, when solving the problem of asynchronous playback of TWS headsets, restarting the playback requires interrupting the audio. Although controlling the playback speed can avoid playback interruptions, the processing efficiency is low.
[0004] It can be seen that the effect of the recovery processing of synchronous playback using the existing recovery mechanism is not ideal, which greatly reduces the intelligence of the TWS headset and seriously affects the playback effect of the TWS headset. Summary of the invention
[0005] The embodiments of the present application provide a method for restoring synchronous playback, a wireless headset, a headset and a storage medium, which can effectively restore the synchronous playback of the wireless headset, greatly enhance the intelligence of the wireless headset, and improve the playback effect of the wireless headset.
[0006] The technical solution of the embodiment of the present application is implemented as follows:
[0007] In a first aspect, an embodiment of the present application provides a method for restoring synchronous playback, wherein the method for restoring synchronous playback is applied to a first earphone in a wireless earphone, wherein the first earphone is any earphone in the wireless earphone; the method comprises:
[0008] Based on a preset detection strategy, a first synchronization detection message sent by a second headset is received at time i; wherein the first synchronization detection message carries a first identifier of a data packet played by the second headset at time i; the second headset is another headset among the wireless headsets other than the first headset; and i is an integer greater than 0;
[0009] Determine a second identifier of the data packet played by the first headset at the i-th moment;
[0010] If the first identifier and the second identifier do not meet the synchronous playback condition, determining a recovery strategy according to the first identifier and the second identifier;
[0011] A target data packet is determined based on the recovery strategy, and when the data packet played at the i-th moment is finished playing, the target data packet is played to achieve synchronous playback with the second headset.
[0012] In a second aspect, an embodiment of the present application provides a method for restoring synchronous playback, wherein the method for restoring synchronous playback is applied to a second earphone in a wireless earphone, where the second earphone is another earphone in the wireless earphone other than the first earphone; the method comprises:
[0013] Based on a preset detection strategy, at the i-th moment, a first synchronization detection message is sent to the first headset, so as to achieve synchronized playback with the first headset through the first synchronization detection message; wherein the first synchronization detection message carries a first identifier of a data packet played by the second headset at the i-th moment; and i is an integer greater than 0;
[0014] When the data packet played at the i-th moment is finished, the next data packet continues to be played.
[0015] In a third aspect, an embodiment of the present application provides a first headset, the first headset is any one of wireless headsets, and the first headset includes: a receiving unit, a determining unit, and a first playing unit.
[0016] The receiving unit is used to receive, at the i-th moment, a first synchronization detection message sent by the second headset based on a preset detection strategy; wherein the first synchronization detection message carries a first identifier of a data packet played by the second headset at the i-th moment; and the second headset is another headset among the wireless headsets other than the first headset;
[0017] The determining unit is configured to determine a second identifier of the data packet played by the first earphone at the i-th moment; if the first identifier and the second identifier do not satisfy the synchronous playback condition, determine a recovery strategy according to the first identifier and the second identifier; and determine a target data packet based on the recovery strategy;
[0018] The first playing unit is used to play the target data packet when the data packet played at the i-th moment is completed, so as to achieve synchronous playback with the second headset.
[0019] In a fourth aspect, an embodiment of the present application provides a first headset, which is any wireless headset. The first headset includes: a first processor and a first memory storing executable instructions of the first processor. When the instructions are executed by the first processor, the method for restoring synchronous playback as described in the first aspect is implemented.
[0020] In a fifth aspect, an embodiment of the present application provides a second headset, wherein the first headset is another headset other than the first headset in a wireless headset, and the second headset comprises: a sending unit and a second playing unit,
[0021] The sending unit is configured to send a first synchronization detection message to the first headset at the i-th moment based on a preset detection strategy, so as to achieve synchronized playback with the first headset through the first synchronization detection message; wherein the first synchronization detection message carries a first identifier of a data packet played by the second headset at the i-th moment;
[0022] The second playing unit is used to continue playing the next data packet when the data packet played at the i-th moment is completed.
[0023] In a sixth aspect, an embodiment of the present application provides a second headset, wherein the first headset is a wireless headset other than the first headset, and the second headset comprises: a second processor and a second memory storing executable instructions of the second processor, and when the instructions are executed by the second processor, the method for restoring synchronous playback as described in the second aspect is implemented.
[0024] In a seventh aspect, an embodiment of the present application provides a wireless headset, comprising a first headset and a second headset, wherein the first headset is used to implement the method for restoring synchronous playback as described in the first aspect; and the second headset is used to implement the method for restoring synchronous playback as described in the second aspect.
[0025] In an eighth aspect, an embodiment of the present application provides a computer-readable storage medium having a first program stored thereon, which is applied to a first headset, and when the first program is executed by a first processor, the method for restoring synchronous playback as described in the first aspect is implemented.
[0026] In a ninth aspect, an embodiment of the present application provides a computer-readable storage medium having a second program stored thereon, which is applied to a second headset, and when the second program is executed by a second processor, the method for restoring synchronous playback as described in the second aspect is implemented.
[0027] The embodiment of the present application provides a method for recovering synchronous playback, a wireless headset, a headset and a storage medium, wherein the method for recovering synchronous playback is applied to a first headset in a wireless headset, wherein the first headset is any headset in the wireless headset; the method comprises: based on a preset detection strategy, receiving a first synchronous detection message sent by a second headset at an i-th moment; wherein the first synchronous detection message carries a first identifier of a data packet played by the second headset at an i-th moment; the second headset is another headset in the wireless headset other than the first headset; i is an integer greater than 0; determining a second identifier of a data packet played by the first headset at an i-th moment; if the first identifier and the second identifier do not meet the condition for synchronous playback, determining a recovery strategy according to the first identifier and the second identifier; determining a target data packet based on the recovery strategy, and playing the target data packet when the data packet played at an i-th moment is completed, so as to achieve synchronous playback with the second headset. That is to say, in the present application, the first earphone in the wireless earphone can periodically receive the synchronization detection message carrying the first identifier sent by the second earphone according to the preset detection strategy. The first earphone determines whether the two earphones are playing synchronously by comparing the first identifier with the second identifier of the data packet played by itself at the same time. When it is determined that they are not synchronized, the recovery strategy and the target data packet can be further determined, and then the synchronous playback can be restored by playing the target data packet when the data packet played at the i-th time is completed. It can be seen that the wireless earphone in the present application can use the identifiers of the data packets played by the two earphones at the same time to adjust and control the data packets, so as to effectively restore the synchronous playback of the wireless earphones, which greatly improves the intelligence of the wireless earphones and improves the playback effect of the wireless earphones. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 Schematic diagram of the working state of TWS headset Figure 1 ;
[0029] Figure 2 Schematic diagram of the working state of TWS headset Figure 2 ;
[0030] Figure 3 Indication of recovery mechanism Figure 1 ;
[0031] Figure 4 Indication of recovery mechanism Figure 2 ;
[0032] Figure 5 This is a schematic diagram of the structure of a wireless headset;
[0033] Figure 6 Schematic diagram of the implementation process of the synchronous playback recovery method Figure 1 ;
[0034] Figure 7 Schematic diagram of the implementation process of the synchronous playback recovery method Figure 2 ;
[0035] Figure 8 Schematic diagram of the implementation process of the synchronous playback recovery method Figure 3 ;
[0036] Fig. 9 Schematic diagram of the implementation process of the synchronous playback recovery method Figure 4 ;
[0037] Fig.10 Schematic diagram of the implementation process of the synchronous playback recovery method Figure 5 ;
[0038] Fig.11 Schematic diagram of the implementation process of the synchronous playback recovery method Figure 6 ;
[0039] Fig.12 Indicates that the playback is out of sync Figure 1 ;
[0040] Fig.13 Indication for resuming synchronous playback Figure 1 ;;
[0041] Fig.14 Indicates that the playback is out of sync Figure 2 ;
[0042] Fig.15 Indication for resuming synchronous playback Figure 2 ;
[0043] Fig.16 Schematic diagram of the implementation process of the synchronous playback recovery method Figure 7 ;
[0044] Fig.17 Schematic diagram of the implementation process of the synchronous playback recovery method Figure 8 ;
[0045] Fig.18 Schematic diagram of the structure of the first earphone Figure 1 ;
[0046] Fig.19 Schematic diagram of the structure of the first earphone Figure 2 ;
[0047] Fig. 20 The structure of the second earphone is shown in FIG. Figure 1 ;
[0048] Fig.21 The structure of the second earphone is shown in FIG. Figure 2 . DETAILED DESCRIPTION
[0049] The following will be combined with the accompanying drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. It is understood that the specific embodiments described herein are only used to explain the related applications, rather than to limit the applications. It should also be noted that, for the convenience of description, only the parts related to the related applications are shown in the accompanying drawings.
[0050] With the continuous advancement of terminal technology, headphones are also constantly changing. Among them, TWS headphones, which are based on TWS technology, apply TWS technology to the field of Bluetooth wireless headphones. The left and right earplugs of wireless headphones such as TWS headphones do not need to be connected by cables, but can work independently by wirelessly separating the left and right channels.
[0051] Wireless headphones such as TWS headphones can completely get rid of the trouble of being bound by cables, allowing you to move more freely; at the same time, wireless headphones can be used in a variety of ways. They can be enjoyed alone, shared, or used as two headphones.
[0052] TWS headphones can include a main headphone and a sub-headphone. The working principle of TWS headphones is that the music device connects to the main headphone of the TWS headphones, and then the main headphone quickly connects to the sub-headphone wirelessly to achieve true wireless separation of the left and right channels of Bluetooth. In other words, the Bluetooth module in the main headphone of the TWS headphones is used to connect to the music device, while the sub-headphone is connected to the main headphone. It can be seen that the wireless signal transmission of the TWS headphones is actually divided into two ends, the music device to the main headphone, and the main headphone to the sub-headphone. However, there is now a direct connection solution between the main and sub-headphones based on Bluetooth 5.0, which means that TWS headphones no longer need to be divided into main and sub-headphones, and the left and right headphones can operate completely independently.
[0053] Generally speaking, TWS headphones need to rely on Bluetooth protocols, Wireless Fidelity (Wi-Fi) protocols and other transmission signals to connect to Bluetooth music devices (such as mobile phones and PCs). Figure 1 Schematic diagram of the working state of TWS headset Figure 1 ,like Figure 1 As shown, for TWS headphones that no longer distinguish between primary and secondary headphones, the left and right headphones are connected to the music device respectively, and the right two headphones need to communicate with the music device through audio signals. Figure 2 Schematic diagram of the working state of TWS headset Figure 2 ,like Figure 2 As shown, for a TWS headset that distinguishes between a primary headset and a secondary headset, the primary headset is connected to a music device via a Bluetooth module, and after receiving an audio signal, the audio signal is synchronized to the secondary headset.
[0054] Since the left and right earphones of TWS earphones operate as separate systems, when one or both earphone systems of the TWS earphones are abnormal (for example, interference causes sound interruption, or system overload causes playback jam, etc.), the left and right earphones are likely to play out of sync. It can be seen that ensuring the synchronous playback of the left and right earphones is crucial to the playback effect of TWS earphones, that is, it is necessary to ensure that there is no time difference when the TWS earphones play audio, or the time difference cannot be too large.
[0055] Once the TWS headset is out of sync, a recovery mechanism needs to be adopted in time to restore synchronous playback. Currently, there are mainly two ways to restore synchronous playback of TWS headsets:
[0056] Solution 1: Restart playback.
[0057] When the two earphones of the TWS headset are not playing synchronously, the current playback process can be stopped, and then the main earphone specifies a data packet as the starting playback data packet, requiring the secondary earphone to play the starting playback data packet at the same time at the specified time. After the two earphones reach synchronous playback at the same time, the subsequent data packets are played sequentially.
[0058] Figure 3 Indication of recovery mechanism Figure 1 ,like Figure 3 As shown in the figure, when playing the data packet D2, one of the earphones has an abnormality and can only play empty data. At this time, the earphone with the abnormality issues a restart instruction to make the two earphones play again. The next data packet played again is Dn. It can be seen that when the problem of asynchronous playback occurs, the asynchronous problem can be quickly corrected by restarting the playback and the synchronous playback can be restored.
[0059] Solution 2: Control the playback speed.
[0060] When the two earphones of a TWS headset are out of sync, the playback speed of one earphone can be adjusted to restore synchronization. Specifically, when the playback is ahead of the other earphone, the playback time difference is slowly reduced by slowing down the playback speed; when the playback lags behind the other earphone, the playback time difference is slowly reduced by speeding up the playback data.
[0061] Figure 4 Indication of recovery mechanism Figure 2 ,like Figure 4As shown, when playing data packet D2, earphone 1 becomes abnormal and can only play empty data. At this time, earphone 1 lags behind earphone 2 in playback. Then earphone 1 can send a restart command to earphone 2 to slow down the playback speed of earphone 2, so that the time t2 for earphone 2 to play an audio data packet is greater than the time t1 for earphone 1 to play another audio data packet. After a period of time, the playback difference between the two earphones gradually becomes smaller, and finally synchronization is achieved, that is, data packet D5 is played at the same time. It can be seen that when the problem of asynchronous playback occurs, the problem of asynchronous playback can be gradually corrected by controlling the playback speed, and synchronous playback can be restored. Compared with Solution 1, Solution 2 does not require interruption of playback, and can be corrected during playback, which provides a better experience.
[0062] However, when the TWS headset has a playback asynchronism problem, the above-mentioned solution 1 is used to restore the synchronous playback. It is necessary to stop the playback and then resume it, resulting in sound interruption, which will cause a very bad experience for the headset user, that is, solution 1 requires interrupting the audio playback; solution 2 requires slowly adjusting the deviation of the left and right earphones, which takes a long time. When the deviation between the left and right earphones is relatively large, it can be recognized by the human ear, and it takes a while to adjust before it can be restored. If the adjustment of the playback speed is too large, the sound will be out of tune. Therefore, solution 2 has limitations in the application process and is generally used for adjustments with small deviations. It can be seen that although solution 2 avoids the interruption of playback, the processing efficiency is low. In summary, the effect of using the existing recovery mechanism for the recovery processing of synchronous playback is not ideal, which greatly reduces the intelligence of TWS headsets and seriously affects the playback effect of TWS headsets.
[0063] In order to solve the problems existing in the prior art, in an embodiment of the present application, the first earphone in the wireless earphone can periodically receive the synchronization detection message carrying the first identifier sent by the second earphone according to the preset detection strategy. The first earphone determines whether the two earphones are playing synchronously by comparing the first identifier with the second identifier of the data packet played by itself at the same time. When it is determined that they are not synchronized, the recovery strategy and the target data packet can be further determined, and then the target data packet can be played when the data packet played at the i-th time is completed to complete the recovery of the synchronous playback. It can be seen that the wireless earphone in the present application can use the identifiers of the data packets played by the two earphones at the same time to adjust and control the data packets, so as to effectively restore the synchronous playback of the wireless earphone, which greatly improves the intelligence of the wireless earphone and improves the playback effect of the wireless earphone.
[0064] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.
[0065] An embodiment of the present application provides a method for restoring synchronous playback, and the method for restoring synchronous playback is applied to a first earphone in a wireless earphone, wherein the first earphone can be any earphone in the wireless earphone.
[0066] Exemplarily, in the present application, the wireless headset may be a TWS headset based on TWS technology. Specifically, Figure 5 Schematic diagram of the structure of wireless headphones, such as Figure 5 As shown, in an embodiment of the present application, the wireless headset 10 may include a first headset 11 and a second headset 12, wherein if the wireless headset 10 distinguishes between a primary headset and a secondary headset, the first headset 11 may be the primary headset and the second headset 12 may be the secondary headset; the first headset 11 may also be the secondary headset and the second headset 12 may be the primary headset.
[0067] It can be understood that in the embodiments of the present application, any one of the wireless headphones, namely the first headphone and the second headphone, can be configured with a sound emitting module, a sound receiving module and a power supply module.
[0068] Specifically, the sound module is mainly a module used to emit sound signals, such as a speaker and other sound-generating devices. Among them, the speaker, also known as a "horn", is a very commonly used electroacoustic transducer. The speaker is a transducer that converts electrical signals into sound signals. The performance of the speaker has a great impact on the sound quality. The speaker is the weakest device in the audio equipment, but it is also the most important component for the sound effect. There are many types of speakers, and the prices vary greatly. Audio electrical energy vibrates the cone or diaphragm through electromagnetic, piezoelectric or electrostatic effects and resonates (resonates) with the surrounding air to produce sound.
[0069] Specifically, the sound receiving module is mainly a module for receiving sound signals, such as microphones and other sound transmission devices. Among them, the scientific name of microphone is microphone, also known as microphone and micro-phone. Microphone is an energy conversion device that converts sound signals into electrical signals. Specifically, it can be divided into dynamic type, capacitor type, electret and the recently emerging silicon micro-microphone, in addition to liquid microphones and laser microphones. Most microphones are electret capacitor microphones, and their working principle is to use a polymer material vibration membrane with permanent charge isolation.
[0070] Specifically, the power module may include a power supply circuit, and further, the power module may also include a charging circuit.
[0071] Furthermore, in the implementation of the present application, if the first earphone and the second earphone in the wireless earphone distinguish between the main earphone and the auxiliary earphone, then as the main earphone, the first earphone (or the second earphone) can also be configured with a Bluetooth module, wherein the Bluetooth module can be used to establish a wireless connection with the music device, thereby receiving the audio data packets transmitted by the music device. As the auxiliary earphone, the second earphone (or the first earphone) can receive the audio data packets synchronized with the main earphone, thereby achieving synchronous playback of the main and auxiliary earphones.
[0072] Furthermore, in the implementation of the present application, if the first earphone and the second earphone in the wireless earphones do not distinguish between the primary and secondary earphones, then whether it is the primary earphone or the secondary earphone, the first earphone and the second earphone are respectively configured with a Bluetooth module, so that they can simultaneously receive audio data packets transmitted by the music device to achieve synchronous playback of the two earphones.
[0073] It is understandable that in the embodiments of the present application, the music device may be any device with communication and storage functions, such as tablet computers, mobile phones, e-readers, remote controllers, personal computers (PCs), laptops, vehicle-mounted devices, network televisions, wearable devices, and the like.
[0074] Figure 6 Schematic diagram of the implementation process of the synchronous playback recovery method Figure 1 ,like Figure 6 As shown, the method for resuming synchronous playback of the first earphone in the wireless earphone may include the following steps:
[0075] Step 101: Based on a preset detection strategy, a first synchronization detection message sent by a second headset is received at the i-th moment; wherein the first synchronization detection message carries a first identifier of a data packet played by the second headset at the i-th moment; the second headset is a wireless headset other than the first headset, and i is an integer greater than 0.
[0076] In an embodiment of the present application, a first earphone in a wireless earphone receives, at time i, a first synchronization detection message sent by a second earphone in a wireless earphone for detecting whether the first earphone and the second earphone are playing synchronously according to a preset detection strategy. The first earphone is any earphone in the wireless earphone, and the second earphone is another earphone in the wireless earphone that is different from the first earphone.
[0077] It can be understood that, in the embodiment of the present application, the first earphone can receive the first synchronization detection message sent by the second earphone at the i-th moment, where i is an integer greater than 0.
[0078] It should be noted that, in the embodiment of the present application, the preset detection strategy is used to periodically check whether the first earphone and the second earphone are playing synchronously.
[0079] Exemplarily, in the present application, based on a preset detection strategy, the first earphone can receive a first synchronization detection message sent by the second earphone at a preset time interval. That is, the second earphone can send a detection signal for detecting whether synchronous playback is performed, i.e., the first synchronization detection message, to the first earphone at a certain time interval (preset time interval).
[0080] Exemplarily, in the present application, based on a preset detection strategy, the first earphone can receive the first synchronization detection message sent by the second earphone according to the preset number of data packets. That is, every time the second earphone plays or decodes a certain number of data packets (preset number of data packets), it can send a detection signal for detecting whether synchronous playback is performed, i.e., the first synchronization detection message, to the first earphone.
[0081] That is, in the present application, the preset detection strategy can be used to receive and / or send the first synchronization detection message according to a preset time interval; or, the preset detection strategy can be used to receive and / or send the first synchronization detection message according to a preset number of data packets. It can be seen that the synchronization detection based on the preset detection strategy is performed every period of time (preset time interval) or every time a certain number of data packets (preset number of data packets) are played or decoded.
[0082] Further, in an embodiment of the present application, the first synchronization detection message received by the first headset may carry an identifier of a data packet. Specifically, the first synchronization detection message carries a first identifier of a data packet played by the second headset at the i-th moment.
[0083] It should be noted that, in the embodiment of the present application, the first synchronization detection message may be a detection signal generated when the wireless headset performs synchronization detection. It can be seen that the first synchronization detection message may be used to detect whether the first headset and the second headset are playing synchronously.
[0084] Exemplarily, in an embodiment of the present application, the first identifier may be the serial number of the data packet played by the second earphone at the i-th moment. Specifically, after receiving at least one audio data packet, the second earphone may decode and play each audio data packet in sequence. In the order of decoding, each data packet has a corresponding sequence number, i.e., a serial number. Accordingly, the second earphone may also play the data packets in sequence according to the serial numbers of the data packets. For example, after decoding the first data packet D1, the second earphone plays the first data packet D1 at the first moment, then decodes the next data packet D2, and plays the data packet D2 at the second moment. By analogy, the second earphone may play the data packet Dk at the k-th moment, where k is an integer greater than 0.
[0085] It can be understood that in the present application, the first earphone and the second earphone can mark each received data packet and generate an identifier corresponding to each data packet, that is, the first earphone generates the second identifier and the second earphone generates the first identifier, so that the data packets can be played according to the order of the identifiers corresponding to each data packet.
[0086] It should be noted that, in an embodiment of the present application, if the first earphone is the main earphone of the wireless earphone, then the identifier of each data packet can be generated by the first earphone, and then the first earphone synchronizes the data packet and the corresponding identifier to the second earphone; correspondingly, if the second earphone is the main earphone of the wireless earphone, then the identifier of each data packet can be generated by the second earphone, and then the second earphone synchronizes the data packet and the corresponding identifier to the first earphone.
[0087] Step 102: Determine a second identifier of a data packet played by the first headset at time i.
[0088] In an embodiment of the present application, based on a preset detection strategy, after receiving the first synchronization detection message carrying the first flag sent by the second headset at the i-th moment, the first headset can further determine the second identifier of the data packet played by itself at the i-th moment.
[0089] It should be noted that, in an embodiment of the present application, the second identifier may be the serial number of the data packet played by the first earphone at the i-th moment. Specifically, after receiving at least one audio data packet, the first earphone may decode and play each audio data packet in sequence. In the order of decoding, each data packet has a corresponding sequence number, i.e., a serial number. Accordingly, the first earphone may also play the data packets in sequence according to the serial numbers of the data packets. For example, after decoding the first data packet D1, the first earphone plays the first data packet D1 at the first moment, then decodes the next data packet D2, and plays the data packet D2 at the second moment. By analogy, the first earphone may play the data packet Dk at the k-th moment.
[0090] It can be understood that in the embodiments of the present application, the first earphone and the second earphone in the wireless earphone follow the same Bluetooth protocol, Wi-Fi protocol, etc. to establish a connection with the music device. Therefore, under ideal conditions, the process of decoding and playing data packets by the first earphone and the second earphone should be synchronized, that is, the first earphone and the second earphone maintain synchronized playback.
[0091] Accordingly, in the present application, if the first earphone and the second earphone are playing synchronously, then at the i-th moment, the second identifier of the data packet played by the first earphone and the first identifier of the data packet played by the second earphone should be the same. For example, at the fifth moment, if the first identifier corresponding to the second earphone is sequence number 5 and the second identifier corresponding to the first earphone is also sequence number 5, then the first earphone and the second earphone are playing synchronously.
[0092] Further, in an embodiment of the present application, after determining the second identifier of the data packet played by the first headset at the i-th moment, that is, after step 102, and if the first identifier and the second identifier do not meet the synchronous playback condition, before determining the recovery strategy according to the first identifier and the second identifier, that is, before step 103, the method for restoring the synchronous playback of the first headset may further include the following steps:
[0093] Step 105: When the first identifier and the second identifier are the same, it is determined that the synchronous playback condition is met.
[0094] Step 106: When the first identifier and the second identifier are different, it is determined that the synchronous playback condition is not met.
[0095] In an embodiment of the present application, after the first earphone obtains the first identifier corresponding to the second earphone at the i-th moment through the first synchronization detection message and determines its own second identifier corresponding to the i-th moment, the first earphone can compare the first identifier with the second identifier, so as to determine whether the first earphone and the second earphone meet the conditions for synchronous playback.
[0096] Specifically, in the present application, after the first earphone compares the first identifier and the second identifier, if the first identifier is the same, that is, the first earphone and the second earphone play the same audio data at the i-th moment, then it can be determined that the first earphone and the second earphone are playing synchronously, and the first identifier and the second identifier meet the conditions for synchronous playback.
[0097] Accordingly, in the present application, after the first earphone compares the first identifier and the second identifier, if the first identifier and the second identifier are different, that is, the first earphone and the second earphone play different audio data at the i-th moment, then it can be determined that the first earphone and the second earphone are not played synchronously, and the first identifier and the second identifier do not meet the conditions for synchronous playback.
[0098] Step 103: If the first identifier and the second identifier do not meet the synchronous playback condition, a recovery strategy is determined according to the first identifier and the second identifier.
[0099] In an embodiment of the present application, after the first earphone obtains the first identifier and the second identifier respectively, if the first identifier and the second identifier do not meet the conditions for synchronous playback, the first earphone needs to resume synchronous playback. Therefore, the first earphone can further determine the synchronous playback recovery strategy based on the first identifier and the second identifier.
[0100] It should be noted that, in the present application, when the first earphone and the second earphone are not playing synchronously, one possible situation is that the playing progress of the first earphone is faster than that of the second earphone, and another possible situation is that the playing progress of the first earphone is slower than that of the second earphone. Accordingly, for the above two situations of asynchronous playing, the recovery strategy determined by the first earphone can also include two different recovery methods.
[0101] Exemplarily, in the present application, in order to solve the problem that the playback progress of the first earphone is slower than that of the second earphone, the first earphone may choose to resume synchronous playback with the second earphone through a recovery strategy of discarding data packets.
[0102] Exemplarily, in the present application, in order to solve the problem that the playback progress of the first earphone is faster than that of the second earphone, the first earphone can choose to restore the synchronous playback with the second earphone by inserting a recovery strategy of a data packet.
[0103] That is to say, in an embodiment of the present application, when the first earphone determines the recovery strategy according to the first identifier and the second identifier, if the first identifier is greater than the second identifier, then it can be determined that the playback progress of the first earphone is slower than the playback progress of the second earphone. Therefore, in order to "catch up" with the playback progress of the second earphone, the first earphone can choose to discard part of the data packets, that is, the recovery strategy can be determined to discard the data packets.
[0104] Accordingly, in the present application, when the first earphone determines the recovery strategy based on the first identifier and the second identifier, if the first identifier is smaller than the second identifier, then it can be determined that the playback progress of the first earphone is faster than that of the second earphone. Therefore, in order to "wait" for the playback progress of the second earphone, the first earphone can choose to insert a part of empty data packets, that is, the recovery strategy can be determined as inserting data packets.
[0105] Step 104: determine the target data packet based on the recovery strategy, and play the target data packet when the data packet played at the i-th moment is completed, so as to achieve synchronous playback with the second headset.
[0106] In the implementation of the present application, after the first earphone uses the first identifier and the second identifier to determine the recovery strategy for resuming synchronous playback, it can further determine the target data packet to be played at the next moment based on the recovery strategy, and then play the target data packet when the data packet played at the i-th moment is completed, thereby achieving synchronous playback with the second earphone.
[0107] It is understandable that, in the present application, if the first earphone determines to use the recovery strategy of inserting a data packet to restore the synchronous playback with the second earphone, then the first earphone can directly determine the empty data packet as the target data packet. Accordingly, at the next moment, that is, the (i+1)th moment, the first earphone does not play the next data packet in the data packet queue, but directly plays the inserted empty data packet.
[0108] It should be noted that, in the embodiment of the present application, the i-th moment refers to the moment of receiving the synchronization detection information, and the (i+1)-th moment is the playback time of the next data packet after the playback of the data packet at the i-th moment is completed.
[0109] Furthermore, in the implementation of the present application, if the first earphone determines to adopt a recovery strategy of discarding data packets to restore synchronous playback with the second earphone, the first earphone can first determine which data packets need to be discarded, and then determine the target data packets to be played at the next moment after the discarded data packets.
[0110] Optionally, in the present application, for the packet discarding strategy, the first earphone can determine the target data packet based on the first identifier and the second identifier. Specifically, the first earphone can first determine the difference m between the first identifier and the second identifier; then, after discarding m data packets according to the difference m, the target data packet to be played at the next moment can be determined. Wherein, m is an integer greater than 0.
[0111] For example, if the sequence number of the data packet played by the first earphone at the i-th moment is 5, that is, the corresponding second identifier is 5, and the sequence number of the data packet played by the second earphone at the i-th moment is 7, that is, the corresponding first identifier is 7, it can be determined that the playback progress of the first earphone is slower than that of the second earphone, and therefore the recovery strategy adopted by the first earphone is to discard the data packets. Furthermore, the first earphone can discard the two data packets with sequence numbers 6 and 7, and determine the data packet with sequence number 8 as the target data packet, so that the target data packet can be played when the data packet played at the i-th moment is completed. It can be seen that at the (i+1)-th moment, the first earphone and the second earphone both play the data packet with sequence number 8, thereby achieving synchronous playback between the first earphone and the second earphone.
[0112] Furthermore, in the implementation of the present application, if the first earphone determines to use a recovery strategy of discarding data packets to restore synchronous playback with the second earphone, the first earphone may first determine the third identifier of the data packet to be played by the second earphone at the next moment, and then further determine the target data packet to be played by the first earphone at the next moment based on the third identifier, and also determine which data packets need to be discarded.
[0113] Optionally, in the present application, for the packet discarding strategy, the first earphone can determine the target data packet based on the first identifier. Specifically, the first earphone can determine the third identifier of the data packet to be played by the second earphone at the next moment based on the first identifier; then use the third identifier to determine the target data packet to be played at the next moment, and determine the data packet with an identifier less than the third identifier as the data packet to be discarded.
[0114] For example, if the sequence number of the data packet played by the first earphone at the i-th moment is 5, that is, the corresponding second identifier is 5, and the sequence number of the data packet played by the second earphone at the i-th moment is 7, that is, the corresponding first identifier is 7, it can be determined that the playback progress of the first earphone is slower than that of the second earphone, and therefore the recovery strategy adopted by the first earphone is to discard the data packet. Further, the first earphone can determine that the sequence number of the data packet played by the second earphone at the (i+1)th moment is 8, that is, the third identifier is 8, then the first earphone can determine the data with the same identifier as the third identifier as the target data packet to be played at the (i+1)th moment, that is, the data packet with the sequence number 8 is determined as the target data packet, and at the same time, the data packet with the sequence number less than the third identifier can be discarded, that is, the two data packets with the sequence numbers 6 and 7 are discarded. It can be seen that at the (i+1)th moment, the first earphone and the second earphone both play the data packet with the sequence number 8, thereby achieving synchronous playback between the first earphone and the second earphone.
[0115] In an embodiment of the present application, further, if the first headset determines to use a recovery strategy of inserting a data packet to restore synchronous playback with the second headset, then before determining a target data packet based on the recovery strategy and playing the target data packet when the data packet played at the i-th moment is completed to achieve synchronous playback with the second headset, that is, before step 104, the method for restoring synchronous playback with the first headset may further include the following steps:
[0116] Step 107: Determine a difference n between the second identifier and the first identifier; wherein n is an integer greater than 0.
[0117] In an embodiment of the present application, if the playback progress of the first earphone is faster than that of the second earphone, and the first identifier is smaller than the second identifier, the first earphone may determine that it is necessary to insert data packets to restore the synchronous playback, and then the first earphone needs to first determine how many empty data packets need to be inserted. Specifically, the first earphone may first determine the difference n between the second identifier and the first identifier, where n is an integer greater than 0.
[0118] Further, in the implementation of the present application, if the first earphone determines to adopt a recovery strategy of inserting data packets to restore synchronous playback with the second earphone, the first earphone may first determine how many empty data packets need to be inserted.
[0119] Optionally, in the present application, for the data packet insertion strategy, the first headset can determine the number of empty data packets to be inserted based on the first identifier and the second identifier. Specifically, the first headset can first determine the difference n between the second identifier and the first identifier, so as to determine that the number of empty data packets is n.
[0120] For example, if the sequence number of the data packet played by the first earphone at the i-th moment is 8, that is, the corresponding second identifier is 8, and the sequence number of the data packet played by the second earphone at the i-th moment is 4, that is, the corresponding first identifier is 4, it can be determined that the playback progress of the first earphone is faster than that of the second earphone, and therefore the recovery strategy adopted by the first earphone is to insert the data packet. Furthermore, the first earphone can determine that the target data packet is an empty data packet, and at the same time, according to the difference between the second identifier and the first identifier, it can be determined that the number of empty data packets to be inserted is 4, so that the empty data packets can be played at the next 4 moments. It can be seen that at the (i+5) moment, the first earphone and the second earphone both play the data packet with the sequence number 9, thereby achieving synchronous playback between the first earphone and the second earphone.
[0121] In an embodiment of the present application, further, if the difference n between the second identifier and the first identifier is greater than 1, that is, the first earphone needs to insert multiple empty data packets, then, when the data packet played by the first earphone at the i-th moment is completed, after playing the target data packet, that is, after step 104, the method for resuming synchronous playback by the first earphone may further include the following steps:
[0122] Step 108: Continue to play the empty data packet at the next (n-1) time points to achieve synchronous playback with the second headset.
[0123] In an embodiment of the present application, if the recovery strategy is to insert data packets, then after the first earphone determines the number n of empty data packets that need to be inserted, it can continuously play n empty data packets in n consecutive moments after the ith moment, that is, when the data packet played at the ith moment is completed, after playing the target data packet, the first earphone continues to play the empty data packets at the next (n-1) moments, thereby resuming synchronous playback with the second earphone.
[0124] In the embodiments of the present application, further, Figure 7 Schematic diagram of the implementation process of the synchronous playback recovery method Figure 2 ,like Figure 7 As shown, if the first identifier and the second identifier do not meet the synchronous playback condition, before determining the recovery strategy according to the first identifier and the second identifier, that is, before step 103, the method for the first earphone to recover the synchronous playback may further include the following steps:
[0125] Step 109: Based on a preset detection strategy, send a second synchronization detection message to the second headset at the i-th moment.
[0126] In the embodiment of the present application, based on a preset detection strategy, the first headset may also send a second synchronization detection message to the second headset at the i-th moment.
[0127] Exemplarily, in the present application, based on a preset detection strategy, the first headset can send a second synchronization detection message to the second headset at a preset time interval. That is, the first headset can send a detection signal for detecting whether synchronous playback is performed, i.e., a second synchronization detection message, to the second headset every certain period of time (preset time interval).
[0128] Exemplarily, in the present application, based on a preset detection strategy, the first headset can send a second synchronization detection message to the second headset according to a preset number of data packets. That is, every time the first headset plays or decodes a certain number of data packets (preset number of data packets), it can send a detection signal for detecting whether synchronous playback is performed, i.e., a second synchronization detection message, to the second headset.
[0129] That is to say, in the present application, the synchronization detection message used to detect whether the first earphone and the second earphone are synchronized can be sent from the first earphone to the second earphone, or from the second earphone to the first earphone, and the present application does not make any specific limitation.
[0130] Furthermore, in an embodiment of the present application, if the executor for sending the synchronization detection message and the executor for performing the synchronization playback recovery are both the first earphone (or the second earphone), then the synchronization detection message sent by the first earphone (or the second earphone) may not carry the identifier of the data packet played by itself at the i-th moment.
[0131] It should be noted that, in the embodiment of the present application, the second synchronization detection message may be a detection signal generated when the wireless headset performs synchronization detection. It can be seen that the second synchronization detection message may be used to detect whether the first headset and the second headset are playing synchronously.
[0132] Step 1010: Receive a response message sent by a second headset to respond to a second synchronization detection message; wherein the response message carries a first identifier.
[0133] In an embodiment of the present application, after the first earphone sends a second synchronization detection message to the second earphone for determining whether to play synchronously, the first earphone can receive a response message sent by the second earphone in response to the second synchronization detection message. Specifically, the response message carries a first identifier of the data packet played by the second earphone at time i.
[0134] That is to say, in the present application, after receiving the second synchronization detection message at the i-th moment, the second earphone can send the serial number of the data packet played by itself at the i-th moment to the first earphone, so that the first earphone can determine whether to play synchronously based on the serial number.
[0135] Step 1011: determine the second identifier, and determine whether the first identifier and the second identifier meet the synchronous playback condition.
[0136] In an embodiment of the present application, after receiving a response message sent by the second earphone to respond to the second synchronization detection message, the first earphone can determine the second identifier of the data packet played by itself at the i-th moment, and at the same time, can further determine whether the first identifier and the second identifier meet the conditions for synchronous playback.
[0137] It can be understood that in an embodiment of the present application, if the first identifier and the second identifier are the same, it is determined that the first identifier and the second identifier meet the conditions for synchronous playback; if the first identifier and the second identifier are different, it is determined that the first identifier and the second identifier do not meet the conditions for synchronous playback.
[0138] In summary, in the present application, through the synchronous playback recovery method proposed in step 101 to step 1011, the first earphone in the wireless earphone can realize the recovery of synchronous playback by calibrating the sequence numbers of the data packets played by the two earphones at the same time. Specifically, when there is a sequence number deviation, that is, when the first earphone and the second earphone play out of sync, the first earphone can quickly correct the deviation of the playback of the two earphones by discarding the data packet or inserting the data packet, thereby restoring the synchronous playback of the two earphones.
[0139] That is to say, the present application proposes a recovery mechanism for synchronous playback of two earphones. The first earphone can discard and supplement audio data packets during audio playback, so that the sequence numbers of the played data packets are synchronized in a jumpy manner, and the data packets played by the two earphones can be quickly restored to consistency without interrupting the audio playback.
[0140] It can be seen that when the synchronous playback recovery scheme proposed in the present application is used to restore the synchronous playback, on the one hand, there is no need for the audio data in the terminal playback, only the selection of the audio data packet needs to be adjusted, and the requirement of playing the same data packet at the same time can be met; on the other hand, based on the preset detection mechanism, the wireless headphones can periodically detect whether the playback is synchronous, so that when it is found that the playback is not synchronized, the synchronous playback of the two headphones can be restored within just tens of milliseconds, that is, the recovery process is fast, and even if there is a large deviation between the two headphones, the calibration can be completed quickly to restore the synchronous playback.
[0141] It should be noted that the synchronous playback recovery method proposed in the present application can be applied not only in wireless headset scenarios that distinguish between primary and secondary headsets, but also in wireless scenarios that do not distinguish between primary and secondary headsets.
[0142] Furthermore, in a wireless headset scenario that distinguishes between a primary headset and a secondary headset, a synchronization detection message may be sent to the primary headset, and the secondary headset performs a synchronization playback recovery process; or a synchronization detection message may be sent to the secondary headset, and the primary headset performs a synchronization playback recovery process.
[0143] It can be understood that in the embodiments of the present application, the same earphone can be used to both send a synchronous detection message and resume synchronous playback; or both earphones can be used to send a synchronous detection message and resume synchronous playback.
[0144] That is to say, in the present application, the recovery process of synchronous playback (step 103 and step 104) can be executed by the earphone that sends the synchronous detection information; the recovery process of synchronous playback (step 103 and step 104) can also be executed by the earphone that receives the synchronous detection information; the recovery process of synchronous playback (step 103 and step 104) can also be executed simultaneously by two earphones that send the synchronous detection information and receive the synchronous detection information. For example, when the two earphones play music with a difference of multiple data packets, the two earphones respectively execute the recovery process of synchronous playback to improve the recovery efficiency.
[0145] It should be noted that the synchronous playback recovery method proposed in this application can be used in a multi-audio device system that requires synchronous playback, and is not limited to any type of wireless headphones such as TWS headphones. In other words, the method for quickly correcting the asynchronous playback of two headphones proposed in this application can be applied to the synchronous playback scenarios of multi-device audio products (such as TWS headphones, speakers, etc.), and can self-check and self-recover the synchronous playback. It can effectively improve the playback freeze and the problem of unsynchronized sound between the left and right headphones when using multi-device audio products such as TWS headphones in electromagnetic interference environments (such as high-speed rail stations, airports, etc.), and optimize the experience of using the product.
[0146] The embodiment of the present application provides a method for restoring synchronous playback. The first earphone in the wireless earphone can periodically receive a synchronization detection message carrying a first identifier sent by the second earphone according to a preset detection strategy. The first earphone determines whether the two earphones are playing synchronously by comparing the first identifier with the second identifier of the data packet played by itself at the same time. When it is determined that they are not synchronized, the recovery strategy and the target data packet can be further determined. Then, the synchronous playback can be restored by playing the target data packet when the data packet played at the i-th time is completed. It can be seen that the wireless earphone in the present application can use the identifiers of the data packets played by the two earphones at the same time to adjust and control the data packets, so as to effectively restore the synchronous playback of the wireless earphone, which greatly improves the intelligence of the wireless earphone and improves the playback effect of the wireless earphone.
[0147] Based on the above embodiments, another embodiment of the present application proposes a method for restoring synchronous playback, which is applied to a second earphone in a wireless earphone, wherein the second earphone may be another earphone in the wireless earphone other than the first earphone.
[0148] Figure 8 Schematic diagram of the implementation process of the synchronous playback recovery method Figure 3 ,like Figure 8 As shown, the method for resuming synchronous playback of the second earphone in the wireless earphone may include the following steps:
[0149] Step 201: Based on a preset detection strategy, a first synchronization detection message is sent to the first earphone at the i-th moment to achieve synchronized playback with the first earphone through the first synchronization detection message; wherein the first synchronization detection message carries a first identifier of a data packet played by the second earphone at the i-th moment, and i is an integer greater than 0.
[0150] In an embodiment of the present application, the second earphone in the wireless earphone sends a first synchronization detection message for detecting whether the first earphone and the second earphone are playing synchronously to the first earphone in the wireless earphone at the i-th time according to a preset detection strategy, so that synchronous playback with the first earphone can be achieved through the first synchronization detection message. The first earphone is any earphone in the wireless earphone, and the second earphone is another earphone in the wireless earphone that is different from the first earphone.
[0151] It can be understood that, in the embodiment of the present application, the second earphone can send the first synchronization detection message to the first earphone at the i-th time, where i is an integer greater than 0.
[0152] It should be noted that, in the embodiment of the present application, the preset detection strategy is used to periodically check whether the first earphone and the second earphone are playing synchronously.
[0153] Exemplarily, in the present application, based on a preset detection strategy, the second earphone can send a first synchronization detection message to the first earphone at a preset time interval. That is, the first earphone can receive a detection signal sent by the second earphone for detecting whether synchronous playback is performed at a certain time interval (preset time interval), i.e., the first synchronization detection message.
[0154] Exemplarily, in the present application, based on a preset detection strategy, the second headset can send a first synchronization detection message to the first headset according to a preset number of data packets. That is, every time the first headset plays or decodes a certain number of data packets (preset number of data packets), it can receive a detection signal sent by the second headset for detecting whether synchronous playback is performed, i.e., the first synchronization detection message.
[0155] That is, in the present application, the preset detection strategy can be used to receive and / or send the first synchronization detection message according to a preset time interval; or, the preset detection strategy can be used to receive and / or send the first synchronization detection message according to a preset number of data packets. It can be seen that the synchronization detection based on the preset detection strategy is performed every period of time (preset time interval) or every time a certain number of data packets (preset number of data packets) are played or decoded.
[0156] Further, in an embodiment of the present application, the first synchronization detection message sent by the second headset to the first headset may carry an identifier of a data packet. Specifically, the first synchronization detection message carries a first identifier of a data packet played by the second headset at the i-th moment.
[0157] It should be noted that, in the embodiment of the present application, the first synchronization detection message may be a detection signal generated when the wireless headset performs synchronization detection. It can be seen that the first synchronization detection message may be used to detect whether the first headset and the second headset are playing synchronously.
[0158] Exemplarily, in an embodiment of the present application, the first identifier may be the serial number of the data packet played by the second earphone at time i. Specifically, after receiving at least one audio data packet, the second earphone may decode and play each audio data packet in sequence. In the order of decoding, each data packet has a corresponding sequence number, i.e., a serial number. Accordingly, the second earphone may also play the data packets in sequence according to the serial numbers of the data packets.
[0159] It should be noted that, in the embodiment of the present application, after the second earphone sends the first synchronization detection message to the first earphone, the first earphone can use the first identifier carried in the first synchronization detection message to further determine whether the first earphone and the second earphone are playing synchronously. If it is determined that the first earphone and the second earphone are not playing synchronously, the first earphone can continue to adjust and control the data packets played based on the first identifier, thereby realizing the restoration of synchronous playback. It can be seen that the second earphone can achieve synchronous playback with the first earphone by sending the first synchronization detection message to the first earphone.
[0160] It is understandable that, in the present application, the first earphone and the second earphone can mark each received data packet and generate an identifier corresponding to each data packet, so that the data packets can be played according to the order of the identifiers corresponding to each data packet.
[0161] Step 202: When the data packet played at the i-th time is finished, continue playing the next data packet.
[0162] In an embodiment of the present application, after the second earphone sends the first synchronization detection message to the first earphone at the i-th moment, it can continue to play the next data packet at the next moment, that is, play the next data packet after the first identified data packet in the data packet list at the (i+1)th moment.
[0163] In the embodiments of the present application, further, Fig. 9 Schematic diagram of the implementation process of the synchronous playback recovery method Figure 4 ,like Fig. 9 As shown, when the data packet played at the i-th moment is finished, before continuing to play the next data packet, that is, before step 202, the method for resuming synchronous playback of the second earphone in the wireless earphone may further include the following steps:
[0164] Step 203: Based on a preset detection strategy, receive a second synchronization detection message sent by the first headset at the i-th moment.
[0165] In the embodiment of the present application, based on a preset detection strategy, the second earphone may also receive the second synchronization detection message sent by the first earphone at the i-th moment.
[0166] Exemplarily, in the present application, based on a preset detection strategy, the first earphone may send a detection signal, ie, a second synchronization detection message, to the second earphone at regular intervals (preset time intervals) for detecting whether synchronous playback is performed.
[0167] Exemplarily, in the present application, based on a preset detection strategy, each time the first earphone plays or decodes a certain number of data packets (preset number of data packets), it can send a detection signal, i.e., a second synchronization detection message, to the second earphone for detecting whether the playback is synchronous.
[0168] That is to say, in the present application, the synchronization detection message used to detect whether the first earphone and the second earphone are synchronized can be sent from the first earphone to the second earphone, or from the second earphone to the first earphone, and the present application does not make any specific limitation.
[0169] Furthermore, in an embodiment of the present application, if the executor for sending the synchronization detection message and the executor for performing the synchronization playback recovery are both the first earphone (or the second earphone), then the synchronization detection message sent by the first earphone (or the second earphone) may not carry the identifier of the data packet played by itself at the i-th moment.
[0170] Step 204: Determine the first identifier according to the second synchronization detection message.
[0171] Step 205: Send a response message to the first headset; wherein the response message carries the first identifier.
[0172] In an embodiment of the present application, after the second earphone receives the second synchronization detection message sent by the first earphone at the i-th moment for determining whether to play synchronously, the second earphone can determine the first identifier of the data packet played by itself at the i-th moment based on the second synchronization detection message, and then can send a response message to the first earphone in response to the second synchronization detection message, wherein the response message carries the first identifier.
[0173] That is to say, in the present application, after receiving the second synchronization detection message at the i-th moment, the second earphone can send the serial number of the data packet played by itself at the i-th moment to the first earphone, so that the first earphone can determine whether to play synchronously based on the serial number.
[0174] The embodiment of the present application provides a method for restoring synchronous playback, in which the second earphone in the wireless earphone can periodically send a synchronization detection message carrying a first identifier to the first earphone according to a preset detection strategy, so that the first earphone determines whether the two earphones are playing synchronously by comparing the first identifier with the second identifier of the data packet played by itself at the same time. When it is determined that they are not synchronized, the recovery strategy and the target data packet can be further determined, and then the synchronous playback can be restored by playing the target data packet when the data packet played at the i-th time is completed. It can be seen that the wireless earphone in the present application can use the identifiers of the data packets played by the two earphones at the same time to adjust and control the data packets, so as to effectively restore the synchronous playback of the wireless earphone, which greatly improves the intelligence of the wireless earphone and improves the playback effect of the wireless earphone.
[0175] Based on the above embodiments, another embodiment of the present application proposes a method for restoring synchronous playback, wherein the recovery method can be applied to a first earphone and a second earphone in a wireless headset, wherein the first earphone can be any one of the wireless earphones, and the second earphone can be another earphone in the wireless headset other than the first earphone.
[0176] Fig.10 Schematic diagram of the implementation process of the synchronous playback recovery method Figure 5 ,like Fig.10 As shown, the method for resuming synchronous playback of the first earphone and the second earphone in the wireless earphone may include the following steps:
[0177] Step 301: The second headset sends a first synchronization detection message to the first headset at the i-th moment based on a preset detection strategy.
[0178] The first identifier may be a serial number of a data packet played by the second headset at time i.
[0179] Step 302: The first earphone determines a second identifier of a data packet played by the first earphone at time i.
[0180] The second identifier may be a serial number of a data packet played by the first headset at time i.
[0181] Step 303: If the first identifier and the second identifier do not meet the synchronous playback condition, the first headset determines a recovery strategy according to the first identifier and the second identifier.
[0182] In an embodiment of the present application, when the first earphone determines the recovery strategy based on the first identifier and the second identifier, if the first identifier is greater than the second identifier, then it can be determined that the playback progress of the first earphone is slower than the playback progress of the second earphone. Therefore, in order to "catch up" with the playback progress of the second earphone, the first earphone can choose to discard part of the data packets, that is, the recovery strategy can be determined to discard the data packets.
[0183] Accordingly, in the present application, when the first earphone determines the recovery strategy based on the first identifier and the second identifier, if the first identifier is smaller than the second identifier, then it can be determined that the playback progress of the first earphone is faster than that of the second earphone. Therefore, in order to "wait" for the playback progress of the second earphone, the first earphone can choose to insert a part of empty data packets, that is, the recovery strategy can be determined as inserting data packets.
[0184] Step 304: The first earphone determines a target data packet based on the recovery strategy, and plays the target data packet when the data packet played at the i-th moment is completed, so as to achieve synchronous playback with the second earphone.
[0185] In an embodiment of the present application, if the first earphone determines to use a recovery strategy of inserting a data packet to restore synchronous playback with the second earphone, the first earphone can directly determine the empty data packet as the target data packet. Accordingly, at the next moment, the first earphone directly plays the inserted empty data packet.
[0186] In an embodiment of the present application, if the first earphone determines to use a recovery strategy of discarding data packets to resume synchronous playback with the second earphone, the first earphone can determine the target data packet based on the first identifier and the second identifier, and can further determine the target data packet to be played by the first earphone at the next moment based on the third identifier of the data packet played by the second earphone at the next moment.
[0187] Step 305: When the data packet played at the i-th moment is finished, the second earphone continues to play the next data packet.
[0188] After the second earphone sends the first synchronization detection message to the first earphone at time i, it can continue to play the next data packet at time (i+1), that is, play the next data packet after the first identified data packet in the data packet list at the next time.
[0189] Fig.11 Schematic diagram of the implementation process of the synchronous playback recovery method Figure 6 ,like Fig.11 As shown, if the first identifier and the second identifier do not meet the synchronous playback condition, before determining the recovery strategy according to the first identifier and the second identifier, that is, before step 303, the method for restoring the synchronous playback of the first earphone and the second earphone in the wireless earphone may further include the following steps:
[0190] Step 306: The first headset sends a second synchronization detection message to the second headset at the i-th moment based on a preset detection strategy.
[0191] Based on the preset detection strategy, the first earphone may also send a second synchronization detection message to the second earphone at the i-th moment. That is to say, in the present application, the synchronization detection message used to detect whether the first earphone and the second earphone are synchronized can be sent from the first earphone to the second earphone, or from the second earphone to the first earphone, and the present application does not make any specific limitation.
[0192] Step 307: The second headset determines the first identifier according to the second synchronization detection message.
[0193] Step 308: The second earphone sends a response message to the first earphone; wherein the response message carries the first identifier.
[0194] In the present application, after receiving the second synchronization detection message at the i-th moment, the second earphone can send the serial number of the data packet played by itself at the i-th moment to the first earphone, so that the first earphone can determine whether to play synchronously based on the serial number.
[0195] Step 309: The first earphone determines the second identifier, and determines whether the first identifier and the second identifier meet the synchronous playback condition.
[0196] In an embodiment of the present application, after receiving a response message sent by the second earphone to respond to the second synchronization detection message, the first earphone can determine the second identifier of the data packet played by itself at the i-th moment, and then can further determine whether the first identifier and the second identifier meet the conditions for synchronous playback.
[0197] In summary, in the present application, through the method for recovering synchronous playback proposed in steps 301 to 309, the first earphone and the second earphone in the wireless earphone can realize the recovery of synchronous playback by calibrating the sequence numbers of the data packets played by the two earphones at the same time. Specifically, when the first earphone and the second earphone play out of sync, the deviation of the playback of the two earphones can be quickly corrected by discarding data packets or inserting data packets, thereby restoring the synchronous playback of the two earphones. Furthermore, for the first earphone and the second earphone in the wireless earphone, the method for recovering synchronous playback proposed in the present application only requires software modifications to quickly correct the problem of unsynchronized playback, and there is no need to interrupt the ongoing playback process during the process of restoring synchronous playback.
[0198] The embodiment of the present application provides a method for restoring synchronous playback. The first earphone in the wireless earphone can periodically receive a synchronization detection message carrying a first identifier sent by the second earphone according to a preset detection strategy. The first earphone determines whether the two earphones are playing synchronously by comparing the first identifier with the second identifier of the data packet played by itself at the same time. When it is determined that they are not synchronized, the recovery strategy and the target data packet can be further determined. Then, the synchronous playback can be restored by playing the target data packet when the data packet played at the i-th time is completed. It can be seen that the wireless earphone in the present application can use the identifiers of the data packets played by the two earphones at the same time to adjust and control the data packets, so as to effectively restore the synchronous playback of the wireless earphone, which greatly improves the intelligence of the wireless earphone and improves the playback effect of the wireless earphone.
[0199] Based on the above embodiments, in another embodiment of the present application, taking the TWS headset as an example, in order to ensure that the main headset and the slave headset of the TWS headset can play synchronously when playing audio, that is, it is necessary to ensure that the playback time between the main headset and the slave headset cannot deviate too much, the main headset and the slave headset in the TWS headset can first mark and number each received audio data packet respectively, and generate an identifier corresponding to each data packet, and the identifier of the data packet can be a serial number.
[0200] Furthermore, in an embodiment of the present application, based on a preset detection strategy, the main earphone can periodically send a synchronization detection message carrying a first identifier of the data packet played at the i-th moment to the secondary earphone at a preset time interval or a preset number of data packets, so that the secondary earphone can further determine whether the main and secondary earphones are playing synchronously based on the identifier.
[0201] It can be understood that in the present application, after receiving the synchronization detection message, the slave earphone can first determine the second identifier of the data packet played by itself at the same time, and then compare the first identifier and the second identifier. If the first identifier and the second identifier are different, it can be determined that the main and slave earphones are not played synchronously, so it is necessary to correct the deviation of the main and slave earphones to achieve the restoration of synchronous playback.
[0202] Specifically, in an embodiment of the present application, the secondary earphone can calculate the deviation value of the audio played between the main and secondary earphones according to the first identifier and the second identifier, and then the data packets in the data packet queue to be played of the secondary earphone can be discarded or inserted according to the deviation value. Specifically, if the playback progress of the secondary earphone is slower than that of the main earphone, the secondary earphone speeds up the playback progress by discarding the data packets, thereby "catching up" with the playback progress of the main earphone; correspondingly, if the playback progress of the secondary earphone is faster than that of the main earphone, the secondary earphone stops the playback progress by inserting the data packets, thereby "waiting" for the playback progress of the main earphone. It can be seen that the secondary earphone can maintain the same playback progress as the main earphone by controlling the data packets and complete the restoration of synchronous playback.
[0203] For example, in this application, Fig.12 Indicates that the playback is out of sync Figure 1 ,like Fig.12 As shown, the primary and secondary earphones both play data packet D1 with sequence number 1 at the same time T1; at time T2, when the secondary earphone plays data packet D2 with sequence number 2, wireless interference occurs in the primary earphone, resulting in insufficient data packets, and it can only fill in empty data NULL for playback; at time T3, when the secondary earphone plays data packet D3 with sequence number 3, the primary earphone plays data packet D2 with sequence number 2. At this time, there is a playback asynchronism between the primary and secondary earphones, that is, the primary earphone lags behind the secondary earphone by one data packet when playing audio.
[0204] Based on the above Fig.12 , Fig.13 Indication for resuming synchronous playback Figure 1 ,like Fig.13 As shown, in order to correct the playback deviation between the main and auxiliary earphones, the main earphone can periodically send a synchronization detection message to the auxiliary earphone, wherein the synchronization detection message carries the sequence number of the data packet played by the main earphone at a certain time. For example, the main earphone sends a synchronization detection message carrying sequence number 2 to the auxiliary earphone at time T3. After receiving the synchronization detection message, the auxiliary earphone can compare the sequence number 2 carried therein with the sequence number 3 of the data packet played at time T3, and determine that the playback progress of the auxiliary earphone is ahead of the playback progress of the main earphone by one data packet. Then the auxiliary earphone can insert a data packet, that is, play an empty data packet NULL at time T4, and at time T4, the main earphone continues to play the data packet D3 with sequence number 3, and at time T5, the main and auxiliary earphones both play the data packet D4 with sequence number 4, that is, at time T5, the playback sequence numbers of the main and auxiliary earphones are synchronized again, and the synchronization playback is restored.
[0205] For example, in this application, Fig.14 Indicates that the playback is out of sync Figure 2 ,like Fig.14 As shown, the primary and secondary earphones both play data packet D1 with sequence number 1 at the same time T1; at time T2, when the primary earphone plays data packet D2 with sequence number 2, wireless interference occurs in the secondary earphone, resulting in insufficient data packets, and it can only fill in empty data NULL for playback; at time T3, when the primary earphone plays data packet D3 with sequence number 3, the secondary earphone plays data packet D2 with sequence number 2. At this time, there is a playback asynchronism between the primary and secondary earphones, that is, the primary earphone plays the audio one data packet ahead of the secondary earphone.
[0206] Based on the above Fig.14 , Fig.15 Indication for resuming synchronous playback Figure 2 ,like Fig.15As shown, in order to correct the playback deviation between the main and auxiliary earphones, the main earphone can periodically send a synchronization detection message to the auxiliary earphone, wherein the synchronization detection message carries the sequence number of the data packet played by the main earphone at a certain moment. For example, the main earphone sends a synchronization detection message carrying sequence number 3 to the auxiliary earphone at time T3. After receiving the synchronization detection message, the auxiliary earphone can compare the sequence number 3 carried therein with the sequence number 2 of the data packet played at time T3, and determine that the playback progress of the auxiliary earphone lags behind the playback progress of the main earphone by one data packet. Then the auxiliary earphone can choose to discard a data packet, that is, at time T4, the data packet D3 with sequence number 3 is no longer played in sequence, but the data packet D3 with sequence number 3 is directly discarded, and the data packet D4 with sequence number 4 is directly played. At time T4, the main earphone continues to play the data packet D4 with sequence number 4, that is, at time T4, the playback sequence numbers of the main and auxiliary earphones are synchronized again, and the synchronization playback is restored.
[0207] It should be noted that, in the embodiment of the present application, the synchronization detection message used to detect whether the main and sub-earphones are synchronized can be sent from the main earphone to the sub-earphone, or from the sub-earphone to the main earphone, and the present application does not make any specific limitation.
[0208] For example, in this application, Fig.16 Schematic diagram of the implementation process of the synchronous playback recovery method Figure 7 ,like Fig.16 As shown, for the auxiliary earphone, after receiving multiple audio data packets, the auxiliary earphone can decode each data packet in turn. After completing the decoding of the t-th data packet (step 401), t is an integer greater than 0, and it is determined whether the decoding count t is an integer multiple of the preset number of data packets N (step 402). If so, before executing step 404, a synchronization detection message is first sent to the main earphone (step 403), wherein the synchronization detection message carries the first identifier a corresponding to the t-th data packet, so that the main earphone can judge and restore the synchronous playback according to the first identifier a. If not, the audio data corresponding to the t-th data packet is directly output (step 404), and the audio data is sent to the speaker for playback (step 405), and then the next data packet, i.e., the (t+1)-th data packet, is decoded.
[0209] For example, in this application, Fig.17 Schematic diagram of the implementation process of the synchronous playback recovery method Figure 8 ,like Fig.17As shown, for the main earphone, after receiving data packets of multiple audio signals, the main earphone can decode each data packet in sequence. After the main earphone decodes the t-th data packet (step 501), it can receive a synchronization detection message sent by the secondary earphone (step 502). The synchronization detection message carries a first identifier a corresponding to the t-th data packet, where f is an integer greater than 0. It is determined whether the first identifier a is the same as the second identifier b of the f-th data packet (step 503). If they are the same, the audio data corresponding to the f-th data packet is directly played (step 504). Then, when the data packet played at the i-th moment is played completely, the next data packet is played, that is, the (f + 1)-th data packet is played (step 505). If they are different, it is determined whether the first identifier a is greater than the second identifier b (step 506). If not, after step 504 is executed, a data packet insertion process is performed, and (a - b) empty data packets are inserted after the f-th data packet (step 507). Then, the empty data packets are played at the next moment (step 508). Specifically, after playing (a - b) empty data packets at the next (a - b) moments, the (f + 1)-th data packet is played. If so, after step 504 is executed, a data packet discarding process is performed, and (a - b) data packets after the f-th data packet are discarded (step 509). Then, the (f + a - b + 1)-th data packet is played at the next moment (step 510).
[0210] That is to say, in the embodiment of the present application, the secondary earphone can send the information of the currently decoded data packet to the main earphone every N decoding cycles to check the playback time difference between the main and secondary earphones. Each time the main earphone receives the synchronization detection message sent by the secondary earphone, it compares the sequence numbers of the data packets played by the main and secondary earphones at the corresponding moment. If they are the same, the main and secondary earphones play synchronously. If they are different, the difference between them can be calculated continuously. Then, the main earphone can control the audio data packet queue according to the difference. For example, at the same moment, when the sequence number a corresponding to the secondary earphone is compared with the sequence number b corresponding to the main earphone, if a > b, the main earphone can discard (a - b) data packets in the playback queue, so that the sequence number of the data packet played by the main earphone at the next moment is the same as the sequence number of the data packet played by the secondary earphone, that is, the restoration of synchronous playback is completed. If a < b, the main earphone can insert (a - b) empty data packets into the playback queue, so that the main earphone plays empty data packets at the next moment, and finally realizes the restoration of synchronous playback between the main and secondary earphones.
[0211] The embodiment of the present application provides a method for restoring synchronous playback. The first earphone in the wireless earphone can periodically receive a synchronization detection message carrying a first identifier sent by the second earphone according to a preset detection strategy. The first earphone determines whether the two earphones are playing synchronously by comparing the first identifier with the second identifier of the data packet played by itself at the same time. When it is determined that they are not synchronized, the recovery strategy and the target data packet can be further determined. Then, the synchronous playback can be restored by playing the target data packet when the data packet played at the i-th time is completed. It can be seen that the wireless earphone in the present application can use the identifiers of the data packets played by the two earphones at the same time to adjust and control the data packets, so as to effectively restore the synchronous playback of the wireless earphone, which greatly improves the intelligence of the wireless earphone and improves the playback effect of the wireless earphone.
[0212] Based on the above embodiment, in another embodiment of the present application, Fig.18 Schematic diagram of the structure of the first earphone Figure 1 ,like Fig.18 As shown, the first earphone 11 may include a receiving unit 111, a determining unit 112 and a first playing unit 113.
[0213] The receiving unit 111 is configured to receive, at the i-th moment, a first synchronization detection message sent by the second headset based on a preset detection strategy; wherein the first synchronization detection message carries a first identifier of a data packet played by the second headset at the i-th moment; the second headset is another headset among the wireless headsets other than the first headset; and i is an integer greater than 0;
[0214] The determining unit 112 is configured to determine a second identifier of the data packet played by the first earphone at the i-th moment; if the first identifier and the second identifier do not satisfy the synchronous playback condition, determine a recovery strategy according to the first identifier and the second identifier; and determine a target data packet based on the recovery strategy;
[0215] The first playing unit 113 is used to play the target data packet when the data packet played at the i-th moment is completed, so as to achieve synchronous playback with the second headset.
[0216] In the embodiments of the present application, further, Fig.19 Schematic diagram of the structure of the first earphone Figure 2 ,like Fig.19 As shown, the first earphone 11 proposed in the embodiment of the present application may also include a first processor 114 and a first memory 115 storing executable instructions of the first processor 114. Further, the first earphone 11 may also include a first communication interface 116, and a first bus 117 for connecting the first processor 114, the first memory 115 and the first communication interface 116.
[0217] Further, in an embodiment of the present application, the above-mentioned first processor 114 is used to receive a first synchronization detection message sent by the second earphone at the i-th moment based on a preset detection strategy; wherein the first synchronization detection message carries a first identifier of the data packet played by the second earphone at the i-th moment; the second earphone is another earphone among the wireless earphones other than the first earphone; the i is an integer greater than 0; determine the second identifier of the data packet played by the first earphone at the i-th moment; if the first identifier and the second identifier do not meet the conditions for synchronous playback, determine a recovery strategy based on the first identifier and the second identifier; determine a target data packet based on the recovery strategy, and play the target data packet when the data packet played at the i-th moment is completed, so as to achieve synchronous playback with the second earphone.
[0218] Fig. 20 The structure of the second earphone is shown in FIG. Figure 1 ,like Fig. 20 As shown, the second earphone 12 may include a sending unit 121 and a playing unit 122.
[0219] The sending unit 121 is configured to send a first synchronization detection message to the first headset at the i-th moment based on a preset detection strategy, so as to achieve synchronized playback with the first headset through the first synchronization detection message; wherein the first synchronization detection message carries a first identifier of a data packet played by the second headset at the i-th moment; and i is an integer greater than 0;
[0220] The second playing unit 122 is used to continue playing the next data packet when the data packet played at the i-th moment is completed.
[0221] In the embodiments of the present application, further, Fig.21 The structure of the second earphone is shown in FIG. Figure 2 ,like Fig.21 As shown, the second earphone 12 proposed in the embodiment of the present application may also include a second processor 123 and a second memory 124 storing executable instructions of the second processor 123. Further, the second earphone 12 may also include a second communication interface 125 and a second bus 126 for connecting the second processor 123, the second memory 124 and the second communication interface 125.
[0222] Furthermore, in an embodiment of the present application, the above-mentioned second processor 123 is used to send a first synchronization detection message to the first earphone at the i-th moment based on a preset detection strategy, so as to achieve synchronous playback with the first earphone through the first synchronization detection message; wherein, the first synchronization detection message carries a first identifier of the data packet played by the second earphone at the i-th moment; i is an integer greater than 0; when the data packet played at the i-th moment is completed, continue to play the next data packet.
[0223] In an embodiment of the present application, the first processor 114 and the second processor 123 can be at least one of an application-specific integrated circuit (ASIC), a digital signal processor (DSP), a digital signal processing device (DSPD), a programmable logic device (PLD), a field programmable gate array (FPGA), a central processing unit (CPU), a controller, a microcontroller, and a microprocessor. It can be understood that for different devices, the electronic device used to implement the above-mentioned processor function can also be other, and the embodiment of the present application is not specifically limited. The first memory 115 and the second memory 124 are used to store executable program code, which includes computer operation instructions. The first memory 115 and the second memory 124 may include high-speed RAM memory, and may also include non-volatile memory, for example, at least two disk memories.
[0224] In the embodiment of the present application, the first memory 115 and the second memory 124 are used to store instructions and data.
[0225] Further, in an embodiment of the present application, the wireless headset 10 may include a first headset 11 and a second headset 12, wherein the first headset 11 is used to receive a first synchronization detection message sent by the second headset at the i-th moment based on a preset detection strategy; wherein the first synchronization detection message carries a first identifier of a data packet played by the second headset at the i-th moment; the second headset is another headset in the wireless headset other than the first headset; determining a second identifier of a data packet played by the first headset at the i-th moment; if the first identifier and the second identifier do not meet the synchronous playback condition, determining a recovery strategy according to the first identifier and the second identifier; determining a target data packet based on the recovery strategy, and playing the target data packet when the data packet played at the i-th moment is completed, so as to achieve synchronous playback with the second headset. The second headset 12 is used to send a first synchronization detection message to the first headset at the i-th moment based on a preset detection strategy, so as to achieve synchronous playback with the first headset through the first synchronization detection message; wherein the first synchronization detection message carries a first identifier of a data packet played by the second headset at the i-th moment; and continuing to play the next data packet when the data packet played at the i-th moment is completed.
[0226] In addition, each functional module in this embodiment can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or software functional modules.
[0227] If the integrated unit is implemented in the form of a software function module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this embodiment is essentially or the part that contributes to the prior art or the whole or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) or a processor to perform all or part of the steps of the method of this embodiment. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc., various media that can store program codes.
[0228] The embodiment of the present application proposes a wireless headset, a first headset and a second headset. The first headset in the wireless headset can periodically receive a synchronization detection message carrying a first identifier sent by the second headset according to a preset detection strategy. The first headset determines whether the two headsets are playing synchronously by comparing the first identifier with the second identifier of the data packet played by itself at the same time. When it is determined that they are not synchronized, the recovery strategy and the target data packet can be further determined. Then, the target data packet can be played when the data packet played at the i-th time is completed to complete the recovery of the synchronous playback. It can be seen that the wireless headset in the present application can use the identifiers of the data packets played by the two headsets at the same time to adjust and control the data packets, so as to effectively restore the synchronous playback of the wireless headset, which greatly improves the intelligence of the wireless headset and improves the playback effect of the wireless headset.
[0229] An embodiment of the present application provides a computer-readable storage medium having a program stored thereon, which, when executed by a processor, implements the method for restoring synchronous playback as described above.
[0230] Specifically, the program instructions corresponding to the method for restoring synchronous playback in this embodiment can be stored in a storage medium such as a CD, a hard disk, or a USB flash drive. When the program instructions corresponding to the method for restoring synchronous playback in the storage medium are read or executed by a wireless headset, the following steps are included:
[0231] Based on a preset detection strategy, a first synchronization detection message sent by a second headset is received at time i; wherein the first synchronization detection message carries a first identifier of a data packet played by the second headset at time i; the second headset is another headset among the wireless headsets other than the first headset; and i is an integer greater than 0;
[0232] Determine a second identifier of the data packet played by the first headset at the i-th moment;
[0233] If the first identifier and the second identifier do not meet the synchronous playback condition, determining a recovery strategy according to the first identifier and the second identifier;
[0234] A target data packet is determined based on the recovery strategy, and when the data packet played at the i-th moment is finished playing, the target data packet is played to achieve synchronous playback with the second headset.
[0235] When a program instruction corresponding to a synchronous playback recovery method in a storage medium is read or executed by an earphone box, the method includes the following steps:
[0236] Based on a preset detection strategy, at the i-th moment, a first synchronization detection message is sent to the first headset, so as to achieve synchronized playback with the first headset through the first synchronization detection message; wherein the first synchronization detection message carries a first identifier of a data packet played by the second headset at the i-th moment; and i is an integer greater than 0;
[0237] When the data packet played at the i-th moment is finished, the next data packet continues to be played.
[0238] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of hardware embodiments, software embodiments, or embodiments in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) that contain computer-usable program code.
[0239] The present application is described with reference to implementation flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the process in the flowchart. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0240] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which is implemented in the implementation flow diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0241] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide for implementing the process described in the flowchart. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0242] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application.
Claims
1. A method for restoring synchronous playback, characterized in that: The synchronous playback recovery method is applied to a first earphone in a wireless earphone, where the first earphone is any earphone in the wireless earphone; the method comprises: Based on a preset detection strategy, a first synchronization detection message sent by a second headset is received at the i-th moment; wherein the first synchronization detection message carries a first identifier of a data packet played by the second headset at the i-th moment; the second headset is another headset among the wireless headsets other than the first headset; and i is an integer greater than 0; Determine a second identifier of the data packet played by the first headset at the i-th moment; If the first identifier and the second identifier do not meet the synchronous playback condition, a recovery strategy is determined according to the first identifier and the second identifier; wherein the recovery strategy includes discarding a data packet and / or inserting a data packet; A target data packet is determined based on the recovery strategy, and when the data packet played at the i-th moment is finished playing, the target data packet is played to achieve synchronous playback with the second headset.
2. The method according to claim 1, characterized in that The first identifier and the second identifier are sequence numbers of the data packet.
3. The method according to claim 1 or 2, characterized in that: The determining of the recovery strategy according to the first identifier and the second identifier includes: When the first identifier is greater than the second identifier, determining that the recovery strategy is the discarded data packet; When the first identifier is smaller than the second identifier, the recovery strategy is determined to be the insert data packet.
4. The method according to claim 3, characterized in that The determining of the target data packet based on the restoration strategy includes: If the recovery strategy is to discard the data packet, determine the difference m between the first identifier and the second identifier; wherein m is an integer greater than 0; After discarding m data packets according to the difference value m, the target data packet is determined.
5. The method according to claim 3, characterized in that: The determining of the target data packet based on the restoration strategy includes: If the recovery strategy is to discard the data packet, determining a third identifier of the data packet to be played by the second headset at the next moment according to the first identifier; The target data packet is determined according to the third identifier.
6. The method according to claim 3, characterized in that The determining of the target data packet based on the restoration strategy includes: If the recovery strategy is the inserting data packet, the empty data packet is determined as the target data packet.
7. The method according to claim 6, characterized in that Before determining a target data packet based on the recovery strategy and playing the target data packet when the data packet played at the i-th moment is completed to achieve synchronous playback with the second headset, the method further includes: Determine a difference n between the second identifier and the first identifier; wherein n is an integer greater than 0.
8. The method according to claim 7, characterized in that When n is greater than 1, when the data packet played at the i-th time is finished playing, after playing the target data packet, the method further includes: Continue to play the empty data packet at the next n-1 moments to achieve synchronous playback with the second headset.
9. The method according to claim 1, characterized in that: After determining the second identifier of the data packet played by the first earphone at the i-th moment, and before determining a recovery strategy according to the first identifier and the second identifier if the first identifier and the second identifier do not meet the synchronous playback condition, the method further includes: When the first identifier and the second identifier are the same, determining that the synchronous playback condition is met; When the first identifier and the second identifier are different, it is determined that the synchronous playback condition is not met.
10. The method according to claim 1, characterized in that The preset detection strategy is used to receive and / or send the first synchronization detection message according to a preset time interval; or, the preset detection strategy is used to receive and / or send the first synchronization detection message according to a preset number of data packets.
11. The method according to claim 1 or 10, characterized in that: If the first identifier and the second identifier do not satisfy the synchronous playback condition, before determining the recovery strategy according to the first identifier and the second identifier, the method further includes: Based on the preset detection strategy, sending a second synchronization detection message to the second headset at the i-th moment; receiving a response message sent by the second headset and used to respond to the second synchronization detection message; wherein the response message carries the first identifier; The second identifier is determined, and it is determined whether the first identifier and the second identifier satisfy the synchronous playback condition.
12. The method according to claim 1, characterized in that The method further comprises: Mark each received data packet and generate an identifier corresponding to each data packet.
13. A method for restoring synchronous playback, characterized in that: The synchronous playback recovery method is applied to a second earphone in a wireless earphone, where the second earphone is another earphone in the wireless earphone other than the first earphone; the method comprises: Based on a preset detection strategy, at the i-th moment, a first synchronization detection message carrying a first identifier of a data packet played by the second earphone at the i-th moment is sent to the first earphone, so that when the first identifier and the second identifier of the data packet played by the first earphone at the i-th moment do not meet a synchronous playback condition, the first earphone determines a recovery strategy according to the first identifier and the second identifier, determines a target data packet based on the recovery strategy, and plays the target data packet when the data packet played at the i-th moment is completed; wherein the recovery strategy includes discarding a data packet and / or inserting a data packet; and i is an integer greater than 0; When the data packet played at the i-th moment is finished, the next data packet continues to be played.
14. The method according to claim 13, characterized in that The preset detection strategy is used to send the first synchronization detection message according to a preset time interval; or, the preset detection strategy is used to send the first synchronization detection message according to a preset number of data packets.
15. The method according to claim 13 or 14, characterized in that The method further comprises: Based on the preset detection strategy, receiving a second synchronization detection message sent by the first headset at the i-th moment; determining the first identifier according to the second synchronization detection message; Send a response message to the first headset; wherein the response message carries the first identifier.
16. The method according to claim 13, characterized in that The method further comprises: Mark each received data packet and generate an identifier corresponding to each data packet.
17. A first earphone, characterized in that: The first earphone is any earphone in a wireless earphone, and the first earphone comprises: a receiving unit, a determining unit and a first playing unit. The receiving unit is configured to receive, at the i-th moment, a first synchronization detection message sent by the second headset based on a preset detection strategy; wherein the first synchronization detection message carries a first identifier of a data packet played by the second headset at the i-th moment; the second headset is another headset among the wireless headsets other than the first headset; and i is an integer greater than 0; The determining unit is used to determine the second identifier of the data packet played by the first earphone at the i-th moment; if the first identifier and the second identifier do not meet the synchronous playback condition, determine a recovery strategy according to the first identifier and the second identifier; determine a target data packet based on the recovery strategy; wherein the recovery strategy includes discarding a data packet and / or inserting a data packet; The first playing unit is used to play the target data packet when the data packet played at the i-th moment is completed, so as to achieve synchronous playback with the second headset.
18. A first earphone, characterized in that: The first earphone is any earphone in a wireless earphone, and the first earphone comprises: a first processor and a first memory storing instructions executable by the first processor, and when the instructions are executed by the first processor, the method according to any one of claims 1 to 12 is implemented.
19. A second earphone, characterized in that: The second earphone is another earphone among wireless earphones except the first earphone, and the second earphone comprises: a sending unit and a second playing unit. The sending unit is used to send, at the i-th moment, a first synchronization detection message carrying a first identifier of a data packet played by the second earphone at the i-th moment to the first earphone based on a preset detection strategy, so that when the first identifier and the second identifier of the data packet played by the first earphone at the i-th moment do not meet the synchronous playback condition, the first earphone determines a recovery strategy according to the first identifier and the second identifier, determines a target data packet based on the recovery strategy, and plays the target data packet when the data packet played at the i-th moment is completed; wherein the recovery strategy includes discarding a data packet and / or inserting a data packet; and i is an integer greater than 0; The second playing unit is used to continue playing the next data packet when the data packet played at the i-th moment is completed.
20. A second earphone, characterized in that: The second earphone is an earphone other than the first earphone in a wireless earphone, and the second earphone comprises: a second processor and a second memory storing instructions executable by the second processor. When the instructions are executed by the second processor, the method according to any one of claims 13 to 16 is implemented.
21. A wireless headset, characterized in that: The wireless headset comprises a first headset and a second headset, the first headset is used to implement the method according to any one of claims 1-12; the second headset is used to implement the method according to any one of claims 13-16.
22. A computer-readable storage medium having a first program stored thereon, applied to a first headset, characterized in that: When the first program is executed by the first processor, the method according to any one of claims 1 to 12 is implemented.
23. A computer-readable storage medium having a second program stored thereon, applied to a second headset, characterized in that: When the second program is executed by the second processor, the method according to any one of claims 13 to 16 is implemented.
