CN112771828B - Audio data communication method and electronic equipment - Google Patents

Audio data communication method and electronic equipment Download PDF

Info

Publication number
CN112771828B
CN112771828B CN201880098111.7A CN201880098111A CN112771828B CN 112771828 B CN112771828 B CN 112771828B CN 201880098111 A CN201880098111 A CN 201880098111A CN 112771828 B CN112771828 B CN 112771828B
Authority
CN
China
Prior art keywords
audio data
electronic device
audio
data
earpiece
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201880098111.7A
Other languages
Chinese (zh)
Other versions
CN112771828A (en
Inventor
朱宇洪
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Publication of CN112771828A publication Critical patent/CN112771828A/en
Application granted granted Critical
Publication of CN112771828B publication Critical patent/CN112771828B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/40Network security protocols

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Synchronisation In Digital Transmission Systems (AREA)

Abstract

The embodiment of the application provides a communication method of audio data and electronic equipment, relates to the technical field of communication, and can inhibit or relieve overflow or underflow of to-be-played data of the electronic equipment. The specific scheme comprises the following steps: the first electronic equipment sends audio data to the second electronic equipment according to the first transmission parameters; the audio data sent in unit time according to the first transmission parameter has a first playing time length; responding to a first signal sent by the second electronic equipment, and sending audio data to the second electronic equipment according to the second transmission parameter; the audio data sent in unit time according to the second transmission parameter has a second playing time length; responding to a second signal sent by the second electronic equipment, and sending audio data to the second electronic equipment according to the third transmission parameter; the audio data transmitted in unit time according to the third transmission parameter has a third play duration. The second playing time length is less than the first playing time length, and the third playing time length is greater than the first playing time length.

Description

Audio data communication method and electronic equipment
Technical Field
The embodiment of the application relates to the technical field of communication, in particular to a communication method of audio data and electronic equipment.
Background
With the advancement of technology, true Wireless Stereo (TWS) headphones gradually come into view of people. TWS headphones include two headphone bodies, e.g., called left and right earplugs, respectively, and do not require a wire connection between the left and right earplugs.
The left and right earplugs of the TWS headset can establish Bluetooth connection with an electronic device (such as a mobile phone) and serve as audio input/output equipment of the mobile phone. Synchronization of the left and right earpieces with the audio clock of the electronic device is especially important in the use of the left and right earpieces of a TWS headset as audio input/output devices for a cell phone. Wherein if the left and right earpieces are not synchronized with the audio clock of the electronic device, overflow or underflow of the data to be played of the earpieces may result.
Disclosure of Invention
Embodiments of the present application provide an audio data communication method and an electronic device, which may suppress or alleviate overflow or underflow of data to be played in an electronic device (e.g., an earpiece of a TWS headset).
The technical scheme is as follows:
in a first aspect, an embodiment of the present application provides a method for communicating audio data. The first electronic device may transmit audio data to the second electronic device according to the first transmission parameter. Wherein the audio data transmitted in unit time according to the first transmission parameter has a first play duration. And responding to the first signal sent by the second electronic equipment, and sending the audio data to the second electronic equipment by the first electronic equipment according to the second transmission parameter. Wherein the audio data transmitted per unit time according to the second transmission parameter has a second play duration. And responding to a second signal sent by the second electronic equipment, and sending the audio data to the second electronic equipment by the first electronic equipment according to the third transmission parameter. Wherein the audio data transmitted per unit time according to the third transmission parameter has a third play duration. It should be noted that the second playing time is shorter than the first playing time, and the third playing time is longer than the first playing time.
The first signal may be sent when the data to be played of the second electronic device overflows. The first electronic device, in response to the first signal, may transmit audio data according to the second transmission parameter. The audio data transmitted per unit time according to the second transmission parameter has a smaller play time period (second play time period) than the audio data transmitted per unit time according to the first transmission parameter. I.e. the second playing time duration is smaller than the first playing time duration. If the playing time of the audio data sent to the second electronic device by the first electronic device per unit time becomes shorter, it indicates that the progress of the audio data transmission from the first electronic device to the second electronic device is slowed down. In other words, the progress of transmitting the audio data according to the second transmission parameter is slower than the progress of transmitting the audio data according to the first transmission parameter. It can be understood that if the data to be played of the second electronic device overflows, the first electronic device may adjust transmission parameters for transmitting the audio data to the second electronic device. In this way, the progress of the first electronic device in transmitting audio data to the second electronic device may be slowed. In this way, the progress of the second electronic device for storing the audio data into the buffer (buffer) of the second electronic device is also slowed, and the speed of buffering the data in the buffer of the second electronic device is reduced. With the processing of the audio data buffered in the buffer by the second electronic device, the data buffered in the buffer may be reduced. Thus, the continuation or the increase of the overflow phenomenon can be suppressed.
The second signal is sent when the data to be played of the second electronic device underflow. The first electronic device, in response to the second signal, may transmit audio data according to the third transmission parameter. The audio data transmitted per unit time according to the third transmission parameter has a larger play time period (second play time period) than the audio data transmitted per unit time according to the first transmission parameter. I.e. the third play time period is greater than the first play time period. The playing time length of the audio data sent to the second electronic device by the first electronic device per unit time is increased, which indicates that the progress of the audio data transmission from the first electronic device to the second electronic device is accelerated. In other words, the progress of transmitting the audio data according to the third transmission parameter is faster than the progress of transmitting the audio data according to the first transmission parameter. It is understood that the first electronic device may adjust the transmission parameter for transmitting the audio data to the second electronic device if the data to be played of the second electronic device underflows. Therefore, the progress of transmitting the audio data to the second electronic equipment by the first electronic equipment can be accelerated. In this way, the progress of storing the audio data into the buffer of the second electronic device is also increased, and the speed of buffering the data in the buffer of the second electronic device is increased. On the premise that the speed of the second electronic device for processing the audio data cached in the buffer is not changed, the data cached in the buffer can be increased. In this way it is possible to obtain, the continuation or aggravation of the underflow phenomenon can be suppressed.
With reference to the first aspect, in a possible design manner, the first signal is sent when data to be played of the second electronic device overflows. The second signal is sent when the data to be played of the second electronic device underflows. The overflow of the data to be played of the second electronic device may be specifically: the data in the buffer of the second electronic device exceeds a first preset value (also referred to as a pipeline). The underflow of the data to be played of the second electronic device specifically includes: the data in the buffer of the second electronic device is lower than a second preset value (also called a lower pipeline).
With reference to the first aspect, in another possible design manner, the data in the cache of the second electronic device exceeds a first preset value, which may specifically be: the size of the data in the cache of the second electronic device exceeds a first preset value. The data in the cache of the second electronic device is lower than a second preset value, which may specifically be: the size of the data in the cache of the second electronic device is lower than a second preset value. The unit of the size of the data is Megabyte (MB) or Kilobyte (KB).
With reference to the first aspect, in another possible design manner, the data in the cache of the second electronic device exceeds a first preset value, which may specifically be: the time length to be played of the data in the cache of the second electronic device exceeds a first preset value. The data in the cache of the second electronic device is lower than a second preset value, which may specifically be: and the time length to be played of the data in the cache of the second electronic equipment is lower than a second preset value.
With reference to the first aspect, in another possible design manner, the data in the cache of the second electronic device exceeds a first preset value, which may specifically be: the number of the audio data packets in the cache of the second electronic device is larger than a first preset value. The data in the cache of the second electronic device is lower than a second preset value, which may specifically be: the number of the audio data packets in the cache of the second electronic device is smaller than a second preset value.
With reference to the first aspect, in another possible design manner, the first transmission parameter, the second transmission parameter, and the third transmission parameter each include at least one of a play-out time length, a time interval, a data amount, and a Pulse Code Modulation (PCM) sampling rate. The first electronic device sends an audio data packet to the second electronic device at intervals, the data volume is the size of audio data included in each audio data packet, and the playing duration is the playing duration of the audio data included in each audio data packet.
With reference to the first aspect, in another possible design manner, when the data to be played overflows or underflows, the second electronic device may send, to the first electronic device, indication information for indicating that the data to be played overflows or underflows, so as to feed back the overflow or underflow phenomenon. For example, the second electronic device may send a first indication message to the first electronic device when the data to be played overflows. The first electronic device may receive a first indication message sent by the second electronic device. The first indication message is used for indicating that the data to be played of the second electronic equipment overflows. The second electronic device may send a second indication message to the first electronic device when underflow occurs in the data to be played. The first electronic device may receive a second indication message sent by the second electronic device. The second indication message is used for indicating that underflow occurs in the data to be played of the second electronic device. That is, the first signal is a first indication message, and the second signal is a second indication message.
With reference to the first aspect, in another possible design manner, the second electronic device sends a request for adjusting the progress of the audio data to the first electronic device when the data to be played overflows or underflows. For example, the second electronic device may send a first adjustment request to the first electronic device when the data to be played overflows. The first adjustment request is used for requesting the first electronic equipment to slow down the progress of transmitting the audio data to the second electronic equipment. The second electronic device may send a second adjustment request to the first electronic device when the data to be played underflow occurs. The second adjustment request is used for requesting the first electronic equipment to adjust the progress of transmitting the audio data to the second electronic equipment. I.e. the first signal is a first adjustment request. The first adjustment request is used for requesting the first electronic device to reduce the playing time length of the audio data sent to the second electronic device in unit time. The second signal is a second adjustment request. The second adjustment request is used for requesting the first electronic device to increase the playing duration of the audio data sent to the second electronic device in unit time.
With reference to the first aspect, in another possible design manner, the first signal includes a second transmission parameter. The second signal includes a third transmission parameter. When the data to be played overflows or underflows, the second electronic device sends the transmission parameters of the audio data to the first electronic device to request the first electronic device to transmit the audio data to the first electronic device according to the transmission parameters. When the data to be played of the second electronic device overflows, the transmission progress of the audio data corresponding to the transmission parameters sent to the first electronic device by the second electronic device is slower than the current transmission progress. When the data to be played of the second electronic device underflow, the transmission progress of the audio data corresponding to the transmission parameters sent by the second electronic device to the first electronic device is faster than the current transmission progress. For example, the transmission parameter may be at least one of a PCM sampling rate, a transmission time interval of the audio packet, and a size of the audio packet. The first electronic device can transmit the audio data to the second electronic device according to the transmission parameters indicated by the second electronic device.
With reference to the first aspect, in another possible design manner, the playing duration of the audio data in the audio data packet sent according to the second transmission parameter is equal to the playing duration of the audio data in the audio data packet sent according to the first transmission parameter. The PCM sampling rate of the audio data in the audio data packets sent according to the second transmission parameter is less than the PCM sampling rate of the audio data in the audio data packets sent according to the first transmission parameter. The data volume of the audio data in the audio data packet sent according to the second transmission parameter is smaller than the data volume of the audio data in the audio data packet sent according to the first transmission parameter; the data amount is the size of audio data included in each audio data packet.
For example, if the data to be played of the second electronic device overflows, the first electronic device may adjust the PCM sampling rate in the first transmission parameter according to a first preset step to obtain the second transmission parameter. Wherein the PCM sampling rate of the second transmission parameter is less than the PCM sampling rate in the first transmission parameter. It will be appreciated that the amount of data in the second transmission parameter is less than the amount of data in the first transmission parameter after adjusting the PCM sampling rate. Under the condition that the time interval is fixed and the time length of the data to be played is fixed, the higher the PCM sampling rate is, the more PCM samples are sampled in unit time, and the more audio data in the audio data packet is. In this way, if the size of the data in the buffer of the second electronic device exceeds the first preset value (i.e., overflow), the first electronic device may turn down the PCM sampling rate to reduce the data in the audio data packets. Thus, the persistence or aggravation of the overflow phenomenon can be suppressed or avoided.
With reference to the first aspect, in another possible design manner, the playing duration of the audio data in the audio data packet sent according to the third transmission parameter is equal to the playing duration of the audio data in the audio data packet sent according to the first transmission parameter. The PCM sampling rate of the audio data in the audio data packets sent according to the third transmission parameter is greater than the PCM sampling rate of the audio data in the audio data packets sent according to the first transmission parameter. The data volume of the audio data in the audio data packet sent according to the third transmission parameter is larger than the data volume of the audio data in the audio data packet sent according to the first transmission parameter; the data amount is the size of audio data included in each audio data packet.
Illustratively, if the data to be played of the second electronic device underflows, the first electronic device adjusts the PCM sampling rate in the first transmission parameter according to a second preset step, so as to obtain a third transmission parameter. Wherein the PCM sampling rate of the third transmission parameter is greater than the PCM sampling rate in the first transmission parameter. It will be appreciated that the amount of data in the third transmission parameter is greater than the amount of data in the first transmission parameter after adjusting the PCM sampling rate. In the case that the time interval is fixed and the duration of the data to be played is fixed, the smaller the PCM sampling rate is, the fewer the number of PCM samples obtained by sampling per unit time is, and the fewer the audio data in the audio data packet is. In this way, if the size of the data in the buffer memory of the second electronic device is below the second preset value (i.e., underflow), the first electronic device may increase the PCM sampling rate to increase the data in the audio data packets. Thus, the persistence or aggravation of the underflow phenomenon can be suppressed or avoided.
With reference to the first aspect, in another possible design manner, the data amount of the audio data in the audio data packet sent according to the second transmission parameter is equal to the data amount of the audio data in the audio data packet sent according to the first transmission parameter; the data amount is the size of audio data included in each audio data packet. The PCM sampling rate of the audio data in the audio data packets sent according to the second transmission parameter is greater than the PCM sampling rate of the audio data in the audio data packets sent according to the first transmission parameter. The playing time length of the audio data in the audio data packet sent according to the second transmission parameter is shorter than the playing time length of the audio data in the audio data packet sent according to the first transmission parameter.
Illustratively, if the data to be played of the second electronic device overflows, the first electronic device adjusts the PCM sampling rate in the first transmission parameter according to a third preset step to obtain a second transmission parameter. Wherein the PCM sampling rate of the second transmission parameter is greater than the PCM sampling rate in the first transmission parameter. It is understood that the playback time duration in the second transmission parameter is shorter than the playback time duration in the first transmission parameter after adjusting the PCM sampling rate. Under the condition that the time interval is fixed and the size of the audio data included in each audio data packet is fixed, the duration of the data to be played in each audio data packet depends on the size of the PCM sampling rate used when the first electronic device converts the analog signal into the digital signal. The larger the PCM sampling rate, the shorter the duration of data to be played in each audio data packet. In this way, if the duration to be played of the data in the buffer of the second electronic device exceeds the first preset value (i.e. overflow), the first electronic device may increase the PCM sampling rate to shorten the duration of the data to be played in the audio data packet. Thus, the persistence or aggravation of the overflow phenomenon can be suppressed or avoided.
With reference to the first aspect, in another possible design manner, the data amount of the audio data in the audio data packet sent according to the third transmission parameter is equal to the data amount of the audio data in the audio data packet sent according to the first transmission parameter; the data amount is the size of audio data included in each audio data packet. The PCM sampling rate of the audio data in the audio data packets sent according to the third transmission parameter is smaller than the PCM sampling rate of the audio data in the audio data packets sent according to the first transmission parameter. The playing time of the audio data in the audio data packet sent according to the third transmission parameter is longer than the playing time of the audio data in the audio data packet sent according to the first transmission parameter.
Illustratively, if the data to be played of the second electronic device underflows, the first electronic device adjusts the PCM sampling rate in the first transmission parameter according to a fourth preset step to obtain a third transmission parameter. Wherein the PCM sampling rate of the third transmission parameter is less than the PCM sampling rate in the first transmission parameter. It is understood that the playing time duration in the third transmission parameter is longer than the playing time duration in the first transmission parameter after the PCM sampling rate is adjusted. Under the condition that the time interval is fixed and the size of the audio data included in each audio data packet is fixed, the duration of the data to be played in each audio data packet depends on the size of the PCM sampling rate used when the first electronic device converts the analog signal into the digital signal. The smaller the PCM sampling rate, the longer the duration of data to be played in each audio data packet. In this way, if the duration to be played of the data in the buffer of the second electronic device is lower than the second preset value (i.e. underflow), the first electronic device may turn down the PCM sampling rate to increase the duration of the data to be played in the audio data packet. Thus, the persistence or aggravation of the underflow phenomenon can be suppressed or avoided.
With reference to the first aspect, in another possible design manner, a time interval of the audio data packets sent according to the second transmission parameter is greater than a time interval of the audio data packets sent according to the first transmission parameter.
With reference to the first aspect, in another possible design manner, a time interval of the audio data packets sent according to the third transmission parameter is smaller than a time interval of the audio data packets sent according to the first transmission parameter.
The larger the frequency of sending the audio data packets to the second electronic device by the first electronic device is, the smaller the time interval is, the more the audio data packets are buffered in the buffer of the second electronic device, and the more the audio data are. The smaller the frequency, i.e. the larger the time interval, at which the first electronic device sends audio data packets to the second electronic device, the fewer the audio data packets are buffered in the buffer of the ear plug 101-1 and the fewer the audio data.
Illustratively, if the data to be played of the second electronic device overflows, the first electronic device adjusts the time interval in the first transmission parameter according to a fifth preset step to obtain a second transmission parameter. Wherein the time interval of the second transmission parameter is greater than the time interval of the first transmission parameter. It is understood that although the size of the audio data in each audio data packet is constant, the playing time duration of the audio data in each audio data packet is constant. However, the number of the audio data packets sent by the first electronic device to the second electronic device is reduced, so that the audio data to be buffered by the buffer of the second electronic device is reduced, and the playing time of the audio data to be buffered by the buffer is also shortened. Therefore, the buffer pressure of the second electronic device can be relieved, and the persistence or the aggravation of the overflow phenomenon can be inhibited or avoided.
The following are exemplary: and if the data to be played of the second electronic device underflows, the first electronic device adjusts the time interval in the first transmission parameter according to a sixth preset step to obtain a third transmission parameter. Wherein the time interval of the third transmission parameter is smaller than the time interval of the first transmission parameter. It is understood that although the size of the audio data in each audio data packet is constant, the playback time period of the audio data in each audio data packet is constant. However, the number of audio data packets sent by the first electronic device to the second electronic device increases, so that the audio data to be buffered by the buffer of the second electronic device increases, and the playing time of the audio data to be buffered by the buffer also becomes longer. In this way, the buffer of the second electronic device can be increased, and the continuation or aggravation of the underflow phenomenon can be inhibited or avoided.
With reference to the first aspect, in another possible design manner, the method according to the embodiment of the present application may further include: the first electronic device sends a synchronization message to the second electronic device. The synchronization message is used for bluetooth clock synchronization. The bluetooth clock information of the first electronic device may be included in the synchronization message. For example, the synchronization message may be a pilot signal.
In a second aspect, an embodiment of the present application provides a method for communicating audio data. The method can comprise the following steps: when the data to be played overflows, the second electronic equipment feeds back the overflow to the first electronic equipment; and when the data to be played underflow, the second electronic equipment feeds the underflow back to the first electronic equipment. For a specific method for the second electronic device to feed back the overflow or underflow to the first electronic device, reference may be made to the description of the first aspect and possible design manners thereof. The embodiments of the present application are not described herein in detail.
With reference to the second aspect, in another possible design manner, the method according to the embodiment of the present application may further include: and the second electronic equipment receives the synchronous message sent by the first electronic equipment. The synchronization message is used for bluetooth clock synchronization. The synchronization message may include bluetooth clock information of the first electronic device. For example, the synchronization message may be a pilot signal. In response to the synchronization message, the second electronic device adjusts the bluetooth clock of the second electronic device such that the bluetooth clock of the second electronic device is synchronized with the bluetooth clock indicated by the synchronization message.
With reference to the second aspect, in another possible design manner, the method according to the embodiment of the present application may further include: the second electronic device adjusts an audio clock of the second electronic device so that the audio clock of the second electronic device is synchronized with a Bluetooth clock of the second electronic device.
In a third aspect, an embodiment of the present application provides an electronic device, where the electronic device is a first electronic device, and the electronic device includes: a processor, a memory, and a communication interface; the memory and the communication interface are coupled with the processor; the memory for storing computer program code; the computer program code comprises computer instructions which, when executed by the processor, cause the electronic device to perform the method of communicating audio data as set forth in the first aspect and possible designs thereof.
In a fourth aspect, an embodiment of the present application provides an electronic device, where the electronic device is a second electronic device, and the electronic device includes: a processor, a memory, and a communication interface; the memory and the communication interface are coupled with the processor; the memory for storing computer program code; the computer program code comprises computer instructions which, when executed by the processor, cause the electronic device to perform the method of communicating audio data as set forth in the second aspect and possible designs thereof.
In a fifth aspect, an embodiment of the present application provides a communication system for audio data. The communication system of audio data comprises the first electronic device of the third aspect and the second electronic device of the fourth aspect.
With reference to the fifth aspect, in a possible design, the first electronic device may perform audio data communication with one or more second electronic devices. For example, the plurality of second electronic devices may be two earpieces of a TWS headset.
In a sixth aspect, an embodiment of the present application provides a computer storage medium, which is characterized by comprising computer instructions, when the computer instructions are executed on an electronic device, the electronic device is caused to perform the method for communicating audio data according to the first aspect, the second aspect, and any possible design manner thereof.
In a seventh aspect, embodiments of the present application provide a computer program product, which when run on a computer, causes the computer to execute the method for communicating audio data according to the first aspect, the second aspect, and any possible design manner thereof.
It is to be understood that the electronic device according to the third aspect, the fourth aspect, and any possible design manner thereof, the communication system according to the fifth aspect, the computer storage medium according to the sixth aspect, and the computer program product according to the seventh aspect are all configured to execute the corresponding method provided above, and therefore, the beneficial effects achieved by the electronic device according to the third aspect, the fourth aspect, and any possible design manner thereof may refer to the beneficial effects in the corresponding method provided above, and are not described herein again.
Drawings
Fig. 1A is a schematic structural diagram of a communication network system of a communication method of audio data according to an embodiment of the present application;
fig. 1B is a schematic diagram of a clock synchronization principle provided in an embodiment of the present application;
fig. 2 is a schematic structural diagram of a communication network system of another audio data communication method according to an embodiment of the present application;
fig. 3A is a schematic structural diagram of a communication network system of another audio data communication method according to an embodiment of the present application;
fig. 3B is a schematic diagram of another clock synchronization principle provided in the embodiment of the present application;
fig. 4A is a schematic structural diagram of a communication network system of another audio data communication method according to an embodiment of the present application;
fig. 4B is a schematic diagram of another clock synchronization principle provided in the embodiment of the present application;
FIG. 5 is a schematic diagram illustrating an example of a TWS earphone according to an embodiment of the present application;
FIG. 6 is a schematic diagram of a hardware structure of an earplug of a TWS earphone according to an embodiment of the present application;
fig. 7 is a schematic hardware structure diagram of an electronic device according to an embodiment of the present disclosure;
FIG. 8 is a schematic diagram of a TWS audio system framework provided by an embodiment of the present application;
fig. 9 is a flowchart of a method for communicating audio data based on a dual-transmission mode according to an embodiment of the present application;
fig. 10A is a schematic diagram illustrating an earplug of a TWS headset according to an embodiment of the present application, for implementing synchronization between an audio clock and a bluetooth clock;
10B-10E are schematic diagrams illustrating an example of a Bluetooth count of a Bluetooth clock and an example of an audio count of an audio clock according to an embodiment of the present application;
fig. 11 is an audio protocol framework based on Bluetooth Low Energy (BLE) according to an embodiment of the present application;
fig. 12 is a flowchart of another audio data communication method based on a dual mode according to an embodiment of the present application;
fig. 13 is a flowchart of a communication method of audio data based on a monitoring manner or a forwarding manner according to an embodiment of the present application;
fig. 14 is a flowchart of a method for communicating audio data based on a single shot method according to an embodiment of the present application.
Detailed Description
The embodiment of the application provides a communication method of audio data, which can be applied to the process of audio data transmission between first electronic equipment and second electronic equipment. In the embodiment of the present application, the first electronic device is simply referred to as an electronic device, and the second electronic device is an earpiece of a TWS headset. The electronic device may be in audio data transmission with one or both earpieces of the TWS headset.
The clock synchronization in the embodiment of the present application may include: synchronizing an earplug of a TWS earphone with a Bluetooth clock of the electronic equipment (clock synchronization-1 for short); synchronization of an audio clock of an earplug of a TWS headset and a Bluetooth clock (clock synchronization-2 for short); synchronization of the audio clock of the electronic device with the audio clock of the earpieces of the TWS headset (clock synchronization-3 for short).
It should be noted that, in the embodiment of the present application, the clock synchronization-3 specifically refers to: the electronic device can improve or alleviate the overflow or underflow of the audio data in the earplug by adjusting the progress of transmitting the audio data to the earplug. After the overflow or underflow phenomenon is improved or alleviated, it can be considered that the audio clock of the electronic device and the audio clock of the ear plug are close to synchronization. In the embodiment of the application, the electronic device is adjusted to transmit the audio data to the earplugs to inhibit or avoid the overflow or underflow phenomenon, which is called that the electronic device is synchronized with the audio clock of the earplugs.
Wherein the TWS headset may include left and right earplugs. For example, as shown in FIG. 1A, TWS headset 101 may include earpieces 101-1 and 101-2. The earplug 101-1 is the left earplug of the TWS earpiece 101 and the earplug 101-2 is the right earplug. Alternatively, the earplug 101-1 is a right earplug of the TWS earpiece 101 and the earplug 101-2 is a left earplug.
Illustratively, the method of the embodiment of the present application may be applied to the following scenarios (1) to (4).
Scenario (1): the electronic device 100 and the TWS headset 101 may transmit audio data by a first transmission means.
The first transmission mode may also be referred to as a dual mode. In the dual mode, as shown in fig. 1A, the earpieces 101-1 and 101-2 of the TWS headset 101 can be used together as an audio input/output device of the electronic device 100 (e.g., a mobile phone) to implement functions such as music playing or voice communication. Also, as shown in fig. 1A, the electronic device 100 is pair-connected with the earpieces 101-1 and 101-2, respectively, and the electronic device 100 transmits audio data with the earpieces 101-1 and 101-2, respectively.
The audio data transmitted by the electronic device 100 to the ear-bud 101-1 may be the same as or different from the audio data transmitted by the electronic device 100 to the ear-bud 101-2. For example, when the TWS headset 101 plays stereo sound, the electronic device 100 transmits different audio data to the earpieces 101-1 and 101-2. For example, the electronic device 100 transmits left channel encoded audio data to the earpiece 101-1 and right channel encoded audio data to the earpiece 101-2. For another example, when the TWS headset 101 plays monaural audio data, the electronic device 100 transmits the same audio data to the earpiece 101-1 and the earpiece 101-2.
In the dual mode, as shown in fig. 1B, the synchronization between the earplugs of the TWS headset and the bluetooth clock of the electronic device (i.e. clock synchronization-1) may specifically include: synchronization of the earpiece 101-1 with the bluetooth clock of the electronic device 100; the synchronization of the earpiece 101-2 with the bluetooth clock of the electronic device 100. After the bluetooth clock of the earplug 101-1 and the bluetooth clock of the earplug 101-2 are synchronized with the bluetooth clock of the electronic device 100, the bluetooth clock of the earplug 101-1 and the bluetooth clock of the earplug 101-2 are synchronized therewith.
In the dual-transmission mode, as shown in fig. 1B, the synchronization between the audio clock of the earpiece of the TWS headset and the bluetooth clock (i.e. clock synchronization-2) may specifically include: synchronization of the bluetooth clock of the earpiece 101-1 with the audio clock of the earpiece 101-1; the bluetooth clock of the earpiece 101-2 is synchronized with the audio clock of the earpiece 101-2. Wherein, the synchronization of the Bluetooth clocks of the earplug 101-1 and the earplug 101-2 is realized in the clock synchronization-1; thus, after clock synchronization-2, the audio clock of the earpiece 101-1 is then synchronized with the audio clock of the earpiece 101-2.
In the dual-transmission mode, as shown in fig. 1B, the synchronization between the audio clock of the electronic device and the audio clock of the earplugs of the TWS headset (i.e. clock synchronization-3) may specifically include: synchronization of the audio clock of the electronic device 100 with the audio clock of the earpiece 101-1; the synchronization of the audio clock of the electronic device 100 with the audio clock of the earpiece 101-2.
The synchronization between the audio clock of the electronic device 100 and the audio clock of the earplug 101-1 specifically includes: the electronic device 100 may improve or alleviate overflow or underflow of audio data in the earpiece 101-1 by adjusting the progress of transmitting audio data to the earpiece 101-1, such that the audio clock of the electronic device 100 is synchronized with the audio clock of the earpiece 101-1. Synchronization of the audio clock of the electronic device 100 with the audio clock of the earpiece 101-2, specifically: the electronic device 100 may improve or alleviate overflow or underflow of audio data in the earpiece 101-2 by adjusting the progress of transmitting audio data to the earpiece 101-2, so that the audio clock of the electronic device 100 and the audio clock of the earpiece 101-2 tend to be synchronized.
Scenario (2): the electronic device 100 and the TWS headset 101 may transmit audio data by the second transmission means.
The second transmission mode may also be referred to as a listening mode. In the listening mode, as shown in fig. 2, the earpieces 101-1 and 101-2 of the TWS headset 101 may be used together as an audio input/output device of the electronic device 100 (e.g., a mobile phone) to implement functions such as music playing or voice communication. However, unlike the dual mode, as shown in FIG. 2, the electronic device 100 is mated with only one earplug (e.g., earplug 101-1), and the earplug 101-1 is mated with the earplug 101-2. The electronic device 100 transmits audio data to the ear plug 101-1, and the ear plug 101-2 can listen to the audio data transmitted by the electronic device 100 to the ear plug 101-1 according to the connection parameter of the electronic device 100 and the ear plug 101-1. Wherein, the earplug 101-1 can transmit the connection parameters of the electronic device 100 and the earplug 101-1 to the earplug 101-2 through the connection with the earplug 101-2.
Scenario (3): the electronic device 100 and the TWS headset 101 may transmit audio data by the third transmission method.
The third transmission method may also be referred to as a forwarding method. In the repeating mode, as shown in fig. 3A, the earpieces 101-1 and 101-2 of the TWS headset 101 may be used together as an audio input/output device of the electronic device 100 (e.g., a mobile phone) to implement functions such as music playing or voice communication. However, unlike the dual mode, as shown in fig. 3A, the electronic device 100 is mated with only one earplug (e.g., earplug 101-1), and the earplug 101-1 is mated with the earplug 101-2. The forwarding mode is different from the listening mode in that the ear plug 101-2 does not need to listen to the audio data transmitted by the electronic device 100 to the ear plug 101-1. The ear plug 101-1 may forward audio data received from the electronic device 100 to the ear plug 101-2.
In the foregoing listening manner and forwarding manner, as shown in fig. 3B, the clock synchronization-1 may specifically include: synchronization of the earpiece 101-1 with the bluetooth clock of the electronic device 100; the synchronization of the bluetooth clock of the earpiece 101-2 and the earpiece 101-1. Since the earpiece 101-1 is synchronized with the bluetooth clock of the electronic device 100, the bluetooth clock of the earpiece 101-2 is then synchronized with the bluetooth clock of the electronic device 100 after the earpiece 101-2 is synchronized with the bluetooth clock of the earpiece 101-1.
In the foregoing listening manner and forwarding manner, as shown in fig. 3B, the clock synchronization-2 may specifically include: synchronization of the bluetooth clock of the earpiece 101-1 with the audio clock of the earpiece 101-1; the bluetooth clock of the earpiece 101-2 is synchronized with the audio clock of the earpiece 101-2. Wherein, the Bluetooth clock synchronization of the earplug 101-1 and the earplug 101-2 is already realized in the clock synchronization-1; thus, after clock synchronization-2, the audio clock of the earpiece 101-1 is then synchronized with the audio clock of the earpiece 101-2.
In the foregoing listening manner and forwarding manner, as shown in fig. 3B, the clock synchronization-3 may specifically include: synchronization of the audio clock of the electronic device 100 with the audio clock of the earpiece 101-1.
Scenario (4): the electronic device 100 and the TWS headset 101 may transmit audio data by a fourth transmission method.
The fourth transmission scheme may also be referred to as a single-shot scheme. In the single-shot mode, as shown in fig. 4A, one of the earpieces (e.g., earpiece 101-1) of the TWS headset 101 is used alone as an audio input/output device of the electronic device 100 (e.g., a mobile phone) to implement functions such as music playing or voice communication.
In the single-shot mode, as shown in fig. 4B, the clock synchronization-1 may specifically include: the synchronization of the earpiece 101-1 with the bluetooth clock of the electronic device 100. The clock synchronization-2 may specifically include: the bluetooth clock of the earpiece 101-1 is synchronized with the audio clock of the earpiece 101-1. Clock synchronization-3 may specifically include: the audio clock of the electronic device 100 is synchronized with the audio clock of the earpiece 101-1.
In the above monitoring mode, forwarding mode, and single-shot mode, the synchronization between the audio clock of the electronic device 100 and the audio clock of the earplug 101-1 specifically means: the electronic device 100 may improve or alleviate overflow or underflow of audio data in the earpiece 101-1 by adjusting the progress of transmitting audio data to the earpiece 101-1, such that the audio clock of the electronic device 100 is synchronized with the audio clock of the earpiece 101-1.
It should be noted that the clock synchronization-3 is not used for directly adjusting the audio clock of the electronic device 100 or the ear plug (e.g. the ear plug 101-1), so as to synchronize the audio clock of the electronic device 100 and the ear plug. But by adjusting other parameters, such as the progress of the electronic device 100 in transmitting audio data to the earpieces, the audio clock of the electronic device 100 is synchronized with the audio clock of the earpieces. Unlike the clock synchronization-3, the clock synchronization-1 and the clock synchronization-2 are both clock synchronization by directly adjusting a clock (a bluetooth clock or an audio clock).
The electronic device 100 may be, for example, a mobile phone, a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a cellular phone, a Personal Digital Assistant (PDA), an Augmented Reality (AR) \ Virtual Reality (VR) device, a media player, a television, or the like, and the embodiment of the present application is not limited to a specific form of the device. In the embodiment of the present application, the structure of the electronic device 100 may be as shown in fig. 7, which will be described in detail in the following embodiments.
Please refer to fig. 5, which is a schematic diagram of a TWS earphone according to an embodiment of the present disclosure. As shown in fig. 5, the TWS headset 101 may include: earplugs 101-1, earplugs 101-2, and an earplug case 101-3. The earplug case may be used to receive left and right earplugs of a TWS headset. Fig. 5 is a schematic diagram showing an example of a product form of the TWS headset by way of example only, and the product form of the peripheral device provided by the embodiment of the present application includes, but is not limited to, the TWS headset 101 shown in fig. 5.
Please refer to fig. 6, which is a schematic structural diagram of an earplug (a left earplug or a right earplug) of a TWS earphone according to an embodiment of the present application. As shown in fig. 6, an earpiece (e.g., earpiece 101-2) of TWS headset 101 may include: processor 610, memory 620, sensor 630, wireless communication module 640, receiver 650, microphone 660, and power supply 670.
The memory 620 may be used for storing, among other things, application code for establishing a wireless connection with another earpiece of the TWS headset 101, such as the earpiece 101-2, and for enabling the earpiece to make a pairing connection with the electronic device 100, such as the handset 100. The processor 610 may control execution of the above-described application program code to implement the functionality of the earpieces of the TWS headset in the embodiments of the present application.
The memory 620 may also have stored therein a bluetooth address for uniquely identifying the earpiece and a bluetooth address of another earpiece of the TWS headset. In addition, the memory 620 may also store connection data with an electronic device that the earplug was previously successfully paired with. For example, the connection data may be a bluetooth address of the electronic device that was successfully paired with the earpiece. Based on the connection data, the ear bud can be automatically paired with the electronic device without having to configure a connection therewith, such as for legitimacy verification or the like. The bluetooth address may be a Media Access Control (MAC) address.
The sensor 630 may be a distance sensor or a proximity light sensor. The ear bud can determine whether it is being worn by the user via the sensor 630. For example, the earbud may utilize a proximity light sensor to detect whether an object is near the earbud to determine whether the earbud is being worn by the user. Upon determining that the ear bud is worn, the ear bud can open the receiver 650. In some embodiments, the earplug may further include a bone conduction sensor, incorporated into a bone conduction earpiece. By utilizing the bone conduction sensor, the earplug can acquire the vibration signal of the vibration bone block of the sound part, analyze the voice signal and realize the voice function. In other embodiments, the ear bud may further include a touch sensor for detecting a touch operation of a user. In other embodiments, the ear bud may further include a fingerprint sensor for detecting a user's fingerprint, identifying the user's identity, and the like. In other embodiments, the earplug may further comprise an ambient light sensor, and some parameters, such as volume, may be adaptively adjusted according to the perceived brightness of the ambient light.
A wireless communication module 640 for supporting short-range data exchange between the earpieces of the TWS headset and various electronic devices, such as the electronic device 100 described above. In some embodiments, the wireless communication module 640 may be a bluetooth transceiver. The earplugs of the TWS headset may establish a wireless connection with the electronic device 100 via the bluetooth transceiver to enable short-range data exchange therebetween.
At least one receiver 650, which may also be referred to as a "headset," may be used to convert the electrical audio signals into sound signals and play them. For example, when the earpieces of the TWS headset are used as the audio output device of the electronic device 100, the receiver 650 may convert the received audio electrical signal into a sound signal and play the sound signal.
At least one microphone 660, which may also be referred to as a "microphone," is used to convert sound signals into electrical audio signals. For example, when the ear plug of the TWS headset 101 is used as an audio input device of the electronic device 100, the microphone 660 may collect a voice signal of the user and convert the voice signal into an audio electrical signal during a process of speaking (e.g., talking or sending voice message) by the user. The audio electrical signal is audio data in the embodiment of the present application.
A power supply 670 that may be used to supply power to the various components contained in the earplugs of the TWS headset 101. In some embodiments, the power source 670 may be a battery, such as a rechargeable battery.
Typically, a TWS earpiece 101 will be fitted with a earplug box (e.g., 101-3 shown in FIG. 5). The earplug case may be used to receive left and right earplugs of a TWS headset. As shown in FIG. 5, the earplug case 101-3 may be used to receive earplugs 101-1 and 101-2 of a TWS headset. In addition, the earpiece box may also charge the left and right earpieces of the TWS headset 101. Accordingly, in some embodiments, the above-described earplug may further comprise: an input/output interface 680. The input/output interface 680 may be used to provide any wired connection between earplugs of a TWS headset and an earpiece box, such as the earpiece box 101-3 described above.
In some embodiments, input/output interface 680 may be an electrical connector. When the earplugs of the TWS headset 101 are disposed in the earbud box, the earplugs of the TWS headset 101 may be electrically connected to the earbud box (e.g., to an input/output interface of the earbud box) via the electrical connector. After this electrical connection is established, the earpiece box may charge the power supply 670 for the earpieces of the TWS headset. After this electrical connection is established, the earplugs of the TWS headset 101 may also be in data communication with the earpiece box. For example, the earplugs of the TWS headset 101 may receive pairing instructions from the earpiece box through the electrical connection. The pairing command is used to instruct the earplugs of the TWS headset 101 to turn on the wireless communication module 640 so that the earplugs of the TWS headset 101 can pair with the electronic device 100 using a corresponding wireless communication protocol (e.g., bluetooth).
Of course, the earplugs of the TWS headset 101 described above may also not include an input/output interface 680. In this case, the earplugs may implement a charging or data communication function based on the wireless connection established with the earplug case 101-3 through the wireless communication module 640 described above.
Additionally, in some embodiments, an earplug case (such as the earplug case 101-3 described above) may further include a processor, memory, and the like. The memory may be used to store application program code and be controlled in execution by the processor of the earplug case to implement the functionality of the earplug case. For example. When the user opens the lid of the earplug case, the processor of the earplug case may send a pairing command or the like to the earplugs of the TWS headset in response to the user opening the lid by executing application program code stored in the memory.
It is to be understood that the illustrated structure of the embodiments of the present application does not constitute a specific limitation to the ear plug of the TWS headset 101. It may have more or fewer components than shown in fig. 6, may combine two or more components, or may have a different configuration of components. For example, the earplug may further include an indicator light (which may indicate the status of the earplug, such as power), a dust screen (which may be used with the earpiece), and the like. The various components shown in fig. 6 may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing or application specific integrated circuits.
It should be noted that the left and right earplugs of the TWS headset 101 may be identical in structure. For example, the left and right earplugs of the TWS headset 101 may both include the components shown in fig. 6. Alternatively, the structure of the left and right earplugs of the TWS headset 101 may also be different. For example, one earpiece (e.g., the right earpiece) of the TWS headset 101 may include the components shown in fig. 6, while the other earpiece (e.g., the left earpiece) may include other components in fig. 6 in addition to the microphone 660.
Taking the above-mentioned electronic device as a mobile phone 100 as an example, fig. 7 shows a schematic structural diagram of the electronic device 100. As shown in fig. 7, the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a Universal Serial Bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, a Subscriber Identification Module (SIM) card interface 195, and the like. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, and the like.
It is to be understood that the illustrated structure of the embodiment of the present invention does not specifically limit the electronic device 100. In other embodiments of the present application, electronic device 100 may include more or fewer components than shown, or some components may be combined, some components may be split, or a different arrangement of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
Processor 110 may include one or more processing units, such as: the processor 110 may include an Application Processor (AP), a modem processor, a Graphics Processing Unit (GPU), an Image Signal Processor (ISP), a controller, a memory, a video codec, a Digital Signal Processor (DSP), a baseband processor, and/or a neural-Network Processing Unit (NPU), etc. The different processing units may be separate devices or may be integrated into one or more processors.
The controller may be, among other things, a neural center and a command center of the electronic device 100. The controller can generate an operation control signal according to the instruction operation code and the timing signal to complete the control of instruction fetching and instruction execution.
A memory may also be provided in processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may hold instructions or data that have just been used or recycled by the processor 110.
In some embodiments, processor 110 may include one or more interfaces. The interface may include an integrated circuit (I2C) interface, an integrated circuit built-in audio (I2S) interface, a PCM interface, a universal asynchronous receiver/transmitter (UART) interface, a Mobile Industry Processor Interface (MIPI), a general-purpose input/output (GPIO) interface, a Subscriber Identity Module (SIM) interface, and/or a Universal Serial Bus (USB) interface, etc.
It should be understood that the connection relationship between the modules according to the embodiment of the present invention is only illustrative, and is not limited to the structure of the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection manners or a combination of multiple interface connection manners in the above embodiments.
The charging management module 140 is configured to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger via the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive a wireless charging input through a wireless charging coil of the electronic device 100. The charging management module 140 may also supply power to the electronic device through the power management module 141 while charging the battery 142.
The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and/or the charge management module 140 and provides power to the processor 110, the internal memory 121, the external memory, the display 194, the camera 193, the wireless communication module 160, and the like. The power management module 141 may also be used to monitor parameters such as battery capacity, battery cycle count, battery state of health (leakage, impedance), etc. In some other embodiments, the power management module 141 may also be disposed in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 may also be disposed in the same device.
The wireless communication function of the electronic device 100 may be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, a modem processor, a baseband processor, and the like.
The antennas 1 and 2 are used for transmitting and receiving electromagnetic wave signals. The mobile communication module 150 may provide a solution including wireless communication of 2G/3G/4G/5G, etc. applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a Low Noise Amplifier (LNA), and the like. The mobile communication module 150 may receive the electromagnetic wave from the antenna 1, filter, amplify, etc. the received electromagnetic wave, and transmit the electromagnetic wave to the modem processor for demodulation. The mobile communication module 150 may also amplify the signal modulated by the modem processor, and convert the signal into electromagnetic wave through the antenna 1 to radiate the electromagnetic wave. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be disposed in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be provided in the same device as at least some of the modules of the processor 110.
The modem processor may include a modulator and a demodulator. The modulator is used for modulating a low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used for demodulating the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then passes the demodulated low frequency baseband signal to a baseband processor for processing. The low frequency baseband signal is processed by the baseband processor and then transferred to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 170A, the receiver 170B, etc.) or displays an image or video through the display screen 194. In some embodiments, the modem processor may be a stand-alone device. In other embodiments, the modem processor may be provided in the same device as the mobile communication module 150 or other functional modules, independent of the processor 110.
The wireless communication module 160 may provide a solution for wireless communication applied to the electronic device 100, including Wireless Local Area Networks (WLANs) (e.g., wireless fidelity (Wi-Fi) networks), bluetooth (bluetooth, BT), global Navigation Satellite System (GNSS), frequency Modulation (FM), near Field Communication (NFC), infrared (IR), and the like. The wireless communication module 160 may be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, performs frequency modulation and filtering processing on electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 160 may also receive a signal to be transmitted from the processor 110, perform frequency modulation and amplification on the signal, and convert the signal into electromagnetic waves through the antenna 2 to radiate the electromagnetic waves.
In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150 and antenna 2 is coupled to wireless communication module 160 so that electronic device 100 can communicate with networks and other devices through wireless communication techniques. The wireless communication technology may include global system for mobile communications (GSM), general Packet Radio Service (GPRS), code division multiple access (code division multiple access, CDMA), wideband Code Division Multiple Access (WCDMA), time-division code division multiple access (time-division code division multiple access, TD-SCDMA), long Term Evolution (LTE), BT, GNSS, WLAN, NFC, FM, and/or IR technologies, etc. The GNSS may include a Global Positioning System (GPS), a global navigation satellite system (GLONASS), a beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS), and/or a Satellite Based Augmentation System (SBAS). For example, in the embodiment of the present application, the electronic device 100 may utilize the wireless communication module 160 to establish a wireless connection with a peripheral device through a wireless communication technology, such as Bluetooth (BT). Based on the established wireless connection, the electronic device 100 may send voice data to the peripheral device and may also receive voice data from the peripheral device.
The electronic device 100 implements display functions via the GPU, the display screen 194, and the application processor. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or alter display information.
The display screen 194 is used to display images, video, and the like. The display screen 194 includes a display panel. The display panel may adopt a Liquid Crystal Display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (active-matrix organic light-emitting diode, AMOLED), a flexible light-emitting diode (FLED), a miniature, a Micro-oeld, a quantum dot light-emitting diode (QLED), and the like. In some embodiments, the electronic device 100 may include 1 or N display screens 194, N being a positive integer greater than 1.
The electronic device 100 may implement a photographing function through the ISP, the camera 193, the video codec, the GPU, the display screen 194, and the application processor, etc.
The ISP is used to process the data fed back by the camera 193. In some embodiments, the ISP may be provided in camera 193. The camera 193 is used to capture still images or video. In some embodiments, electronic device 100 may include 1 or N cameras 193, N being a positive integer greater than 1. Video codecs are used to compress or decompress digital video. The electronic device 100 may support one or more video codecs.
The external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, to extend the memory capability of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as music, video, etc. are saved in an external memory card.
The internal memory 121 may be used to store computer-executable program code, which includes instructions. The processor 110 executes various functional applications of the electronic device 100 and data processing by executing instructions stored in the internal memory 121. For example, in the embodiment of the present application, the processor 110 may execute instructions stored in the internal memory 121, establish a wireless connection with a peripheral device through the wireless communication module 160, and perform short-distance data exchange with the peripheral device, so as to implement functions of talking, playing music, and the like through the peripheral device. The internal memory 121 may include a program storage area and a data storage area. The storage program area may store an operating system, an application program (such as a sound playing function, an image playing function, etc.) required by at least one function, and the like. The storage data area may store data (such as audio data, phone book, etc.) created during use of the electronic device 100, and the like. In addition, the internal memory 121 may include a high-speed random access memory, and may further include a nonvolatile memory, such as at least one magnetic disk storage device, a flash memory device, a universal flash memory (UFS), and the like. In the embodiment of the present application, after the electronic device 100 establishes a wireless connection with a peripheral device by using a wireless communication technology, such as bluetooth, the electronic device 100 may store a bluetooth address of the peripheral device in the internal memory 121. In some embodiments, when the peripheral device is a device comprising two bodies, such as a TWS headset, and the left and right earpieces of the TWS headset have respective bluetooth addresses, the electronic device 100 may store the bluetooth address association of the left and right earpieces of the TWS headset in the internal memory 121.
The electronic device 100 may implement audio functions via the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone interface 170D, and the application processor. Such as music playing, recording, etc.
The audio module 170 is used to convert digital audio information into an analog audio signal output and also to convert an analog audio input into a digital audio signal. The audio module 170 may also be used to encode and decode audio signals. In some embodiments, the audio module 170 may be disposed in the processor 110, or some functional modules of the audio module 170 may be disposed in the processor 110.
The speaker 170A, also called a "horn", is used to convert the audio electrical signal into an acoustic signal. The electronic apparatus 100 can listen to music through the speaker 170A or listen to a handsfree call.
The receiver 170B, also called "earpiece", is used to convert the electrical audio signal into an acoustic signal. When the electronic apparatus 100 receives a call or voice information, it is possible to receive voice by placing the receiver 170B close to the human ear.
The microphone 170C, also referred to as a "microphone," is used to convert sound signals into electrical signals. When making a call or transmitting voice information, the user can input a voice signal to the microphone 170C by speaking near the microphone 170C through the mouth. The electronic device 100 may be provided with at least one microphone 170C. In other embodiments, the electronic device 100 may be provided with two microphones 170C to achieve a noise reduction function in addition to collecting sound signals. In other embodiments, the electronic device 100 may further include three, four or more microphones 170C to collect sound signals, reduce noise, identify sound sources, perform directional recording, and so on.
In the present embodiment, when the electronic device 100 establishes a wireless connection with a peripheral device 101, such as a TWS headset, the TWS headset may be used as an audio input/output device of the electronic device 100. For example, the audio module 170 may receive an audio electrical signal transmitted by the wireless communication module 160, and implement functions of answering a call, playing music, and the like through the TWS headset. For example, during a call made by the user, the TWS headset may collect a voice signal of the user, convert the voice signal into an audio electrical signal, and transmit the audio electrical signal to the wireless communication module 160 of the electronic device 100. The wireless communication module 160 transmits the audio electrical signal to the audio module 170. The audio module 170 may convert the received audio electrical signal into a digital audio signal, encode the digital audio signal, and transmit the encoded digital audio signal to the mobile communication module 150. And is transmitted to the opposite-end call device by the mobile communication module 150 to implement a call. For another example, when the user plays music using a media player of the electronic device 100, the application processor may transmit an audio electrical signal corresponding to the music played by the media player to the audio module 170. The audio electrical signal is transmitted by the audio module 170 to the wireless communication module 160. The wireless communication module 160 may transmit the audio electrical signal to the TWS headset so that the TWS headset converts the audio electrical signal into a sound signal and plays the sound signal.
The earphone interface 170D is used to connect a wired earphone. The headset interface 170D may be the USB interface 130, or may be a 3.5mm open mobile electronic device platform (OMTP) standard interface, a cellular telecommunications industry association (cellular telecommunications industry association of the USA, CTIA) standard interface.
The pressure sensor 180A is used for sensing a pressure signal, and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A may be disposed on the display screen 194. The pressure sensor 180A can be of a variety of types, such as a resistive pressure sensor, an inductive pressure sensor, a capacitive pressure sensor, and the like. When a force acts on the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the strength of the pressure from the change in capacitance. When a touch operation is applied to the display screen 194, the electronic apparatus 100 detects the intensity of the touch operation according to the pressure sensor 180A. The electronic apparatus 100 may also calculate the touched position from the detection signal of the pressure sensor 180A. In some embodiments, the touch operations that are applied to the same touch position but different touch operation intensities may correspond to different operation instructions. For example: and when the touch operation with the touch operation intensity smaller than the first pressure threshold value acts on the short message application icon, executing an instruction for viewing the short message. And when the touch operation with the touch operation intensity larger than or equal to the first pressure threshold value acts on the short message application icon, executing an instruction of newly building the short message.
The gyro sensor 180B may be used to determine the motion attitude of the electronic device 100. The gyroscope sensor 180B may also be used for navigation, somatosensory gaming scenes. The air pressure sensor 180C is used to measure air pressure. The magnetic sensor 180D includes a hall sensor. The acceleration sensor 180E may detect the magnitude of acceleration of the electronic device 100 in various directions (typically three axes). A distance sensor 180F for measuring a distance. The electronic device 100 can utilize the proximity light sensor 180G to detect that the user holds the electronic device 100 close to the ear for talking, so as to automatically turn off the screen to achieve the purpose of saving power. The proximity light sensor 180G may also be used in a holster mode, a pocket mode automatically unlocks and locks the screen. The ambient light sensor 180L is used to sense ambient light brightness. The ambient light sensor 180L may also be used to automatically adjust the white balance when taking a picture. The ambient light sensor 180L may also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in a pocket to prevent accidental touches. The fingerprint sensor 180H is used to collect a fingerprint. The electronic device 100 can utilize the collected fingerprint characteristics to unlock the fingerprint, access the application lock, photograph the fingerprint, answer an incoming call with the fingerprint, and so on. The temperature sensor 180J is used to detect temperature. The touch sensor 180K is also referred to as a "touch panel". The touch sensor 180K may be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, which is also called a "touch screen". The touch sensor 180K is used to detect a touch operation applied thereto or nearby. The touch sensor may communicate the detected touch operation to the application processor to determine the touch event type. Visual output associated with the touch operation may be provided via the display screen 194. In other embodiments, the touch sensor 180K may be disposed on a surface of the electronic device 100, different from the position of the display screen 194. The bone conduction sensor 180M may acquire a vibration signal. The bone conduction sensor 180M may also contact the human pulse to receive the blood pressure pulsation signal. The application processor can analyze heart rate information based on the blood pressure beating signal acquired by the bone conduction sensor 180M, so as to realize the heart rate detection function.
The keys 190 include a power-on key, a volume key, and the like. The keys 190 may be mechanical keys. Or may be touch keys. The electronic apparatus 100 may receive a key input, and generate a key signal input related to user setting and function control of the electronic apparatus 100. The motor 191 may generate a vibration cue. The motor 191 may be used for incoming call vibration cues, as well as for touch vibration feedback. Indicator 192 may be an indicator light that may be used to indicate a state of charge, a change in charge, or a message, missed call, notification, etc. The SIM card interface 195 is used to connect a SIM card. The SIM card can be brought into and out of contact with the electronic apparatus 100 by being inserted into the SIM card interface 195 or being pulled out of the SIM card interface 195. The electronic device 100 may support 1 or N SIM card interfaces, N being a positive integer greater than 1. The electronic device 100 interacts with the network through the SIM card to implement functions such as communication and data communication.
Please refer to fig. 8, which illustrates a schematic structural diagram of a TWS audio system according to an embodiment of the present application. The TWS audio system shown in fig. 8 may be applied to the above-described scenes (1) -scene (4). As shown in fig. 8, the electronic device 100, the earpieces 101-1 and 101-2 may each include a bluetooth module, an audio module and a Codec (Codec) module.
The bluetooth module is responsible for bluetooth protocol processing and receiving and transmitting bluetooth data (such as audio data). The bluetooth module may include at least one receiver and transmitter, a radio frequency antenna. Also, the bluetooth module may maintain a bluetooth clock (BT clock).
The audio module is responsible for audio coding and audio decoding. The audio module includes at least one audio encoder or audio decoder.
The Codec module is responsible for sampling and playing the audio signal. The Codec module at least includes a digital to analog converter (DAC) or an analog to digital converter (ADC). Also, the Codec module maintains an Audio clock (Audio clock).
For example, the bluetooth module of the mobile phone 100 shown in fig. 8 may be implemented in the wireless communication module 160 shown in fig. 7. The audio module and Codec module of the handset 100 shown in fig. 8 may be implemented in the audio module 170 shown in fig. 7. The audio module 170 shown in fig. 7 may be disposed in the processor 110, or some functional modules of the audio module 170 may be disposed in the processor 110.
The bluetooth module of the earplug 101-1 or 101-2 shown in fig. 8 may be implemented in the wireless communication module 640 shown in fig. 6. The audio module and Codec module of the ear bud 101-1 or the ear bud 101-2 shown in fig. 8 may be implemented in the processor 610 shown in fig. 6.
For convenience of understanding, the following describes in detail a communication method of audio data provided by an embodiment of the present application with reference to the drawings. In the following embodiments, the electronic device is a mobile phone 100, the first earpiece 101-1 of the TWS headset 101 is a first earpiece of the TWS headset, and the second earpiece 101-2 of the TWS headset 101 is taken as an example for description.
In the embodiment of the present application, in the above scenario (1), the earpieces 101-1 and 101-2 of the TWS headset 101 are used together as an audio input/output device of the mobile phone 11 to implement functions such as music playing or voice communication, for example, so as to describe the communication method of audio data provided in the embodiment of the present application.
When a user wishes to use the TWS headset 101, the cover of the earplug case 101-3 of the TWS headset 101 may be opened. At this point, the earplugs 101-1 and 101-2 may be automatically mated.
In some implementations, a sensor (e.g., an ambient light sensor or a magnetic sensor, etc.) may be included in the earbud cartridge 101-3. The sensor may detect that the earplug case 101-3 is opened. For example, the earplug case 101-3 includes an ambient light sensor. After the earplug box 101-3 is opened, the ambient light sensor in the earplug box 101-3 detects a larger ambient light level. After the earplug box 101-3 is closed, the ambient light sensor in the earplug box 101-3 detects a small ambient light level. If the earplug case 101-3 is closed, the ambient light level detected by the ambient light sensor changes from small to large after the earplug case 101-3 is opened. The earplug box 101-3 may generate a pairing instruction to any earplug (e.g., the earplug 101-1) when the ambient light brightness detected by the ambient light sensor changes from small to large and is higher than a preset brightness threshold, so as to indicate that the earplug is paired and connected with another earplug. As another example, the earplug case 101-3 includes a magnetic sensor. The earplug case 101-3 can detect the opening and closing of the case cover by using a magnetic sensor. The earplug box 101-3 can detect the opening and closing of the box cover according to the magnetic sensor. When the earplug box 101-3 detects that the box cover is opened according to the magnetic sensor, a pairing instruction can be sent to any earplug (such as the earplug 101-1) to indicate that the earplug is paired and connected with another earplug. Wherein, in response to the pairing instruction, the earplug 101-1 may generate a pairing request to the earplug 101-2, requesting a pairing connection with the earplug 101-2.
In other implementations, the ambient light sensor described above may be included on an ear piece (e.g., ear piece 101-1) of the TWS earpiece 101. When the ambient light brightness detected by the ambient light sensor changes from small to large and is higher than a preset brightness threshold, the earplug 101-1 may generate a pairing request to the earplug 101-2 to request for pairing connection with the earplug 101-2.
And after the cover of the earplug box 101-3 is opened, any one of the earplugs 101-1 and 101-2 (such as the earplug 101-1) can send paired broadcast to the outside. If the handset 100 has bluetooth enabled, the handset 100 may receive the pairing broadcast and prompt the user that the associated bluetooth device (e.g., earpiece 101-1) has been scanned. When a user selects the earpiece 101-1 as the connecting device on the handset 100, the handset 100 may be paired with the earpiece 101-1.
After the earplug 101-1 is paired with the mobile phone 100, the earplug 101-1 may send the bluetooth address of the mobile phone 100 to the earplug 101-2 through the bluetooth connection with the earplug 101-2, and notify the earplug 101-2 to send a pairing broadcast to the outside. Thus, the handset 100 can receive the paired broadcast transmitted by the earpiece 101-2 and be paired with the earpiece 101-2.
Take the dual-transmission mode described in the above scenario (1) as an example. The handset 100 can transmit audio data after being respectively connected with the earplugs 101-1 and 101-2 in a pairing manner. The handset 100, the earpieces 101-1 and 101-2 may perform the communication method of the audio data provided by the embodiment of the present application during the process of transmitting the audio data, so as to achieve the synchronization of the bluetooth clock and the audio clock of the handset 100 and the TWS headset 101.
First, in the embodiment of the present application, the left and right earpieces of the TWS headset 101 may be synchronized with the bluetooth clock of the mobile phone 100 (i.e. clock synchronization-1).
With reference to fig. 1B, as shown in fig. 9, the clock synchronization-1 may specifically include: synchronization of the bluetooth clock of the ear plug 101-1 and the handset 100 (i.e., S901); and, the synchronization of the earpiece 101-2 with the bluetooth clock of the handset 100 (i.e., S902).
Illustratively, the earpiece 101-1 is synchronized with the bluetooth clock of the electronic device 100. As shown in fig. 9, a handset 100 (e.g., the bluetooth module of the handset 100 shown in fig. 8) may send a synchronization message to an earpiece 101-1. The synchronization message is used for bluetooth clock synchronization. The synchronization message may include bluetooth clock information for the handset 100. For example, the synchronization message may be a pilot signal. Upon receiving the pilot signal, the earpiece 101-1 (e.g., the bluetooth module of the earpiece 101-1 shown in fig. 8) may estimate the difference between the bluetooth clock indicated by the pilot signal and the bluetooth clock maintained by the earpiece 101-1. The earplug 101-1 (e.g., the bluetooth module of the earplug 101-1 shown in fig. 8) may then adjust the bluetooth clock of the earplug 101-1 based on the estimated difference such that the bluetooth clock of the earplug 101-1 is synchronized with the bluetooth clock indicated by the pilot signal. That is, the handset 100 and the earpiece 101-1 can execute S901 to synchronize the bluetooth clocks of the earpiece 101-1 and the electronic device 100. The handset 100 and the earpiece 101-2 may execute S902, and the method for implementing bluetooth clock synchronization between the earpiece 101-2 and the electronic device 100 is similar to S901, which is not described herein again in this embodiment of the present application.
It is to be understood that in the above-described clock synchronization-1, the bluetooth clock of the ear plug 101-1 is synchronized with the bluetooth clock of the mobile phone 100, and the bluetooth clock of the ear plug 101-2 is synchronized with the bluetooth clock of the mobile phone 100. Because the Bluetooth clock of the earplug 101-1 and the Bluetooth clock of the earplug 101-2 are both synchronous with the Bluetooth clock of the mobile phone 100; thus, the Bluetooth clock of the earpiece 101-1 and the Bluetooth clock of the earpiece 101-2 are also synchronized.
Secondly, in the embodiment of the present application, the synchronization of the audio clock of the earpiece of the TWS headset 101 with the bluetooth clock (i.e. clock synchronization-2) can be achieved.
The earpiece 101-1 (e.g., the audio module of the earpiece 101-1 shown in fig. 8) may adjust the audio clock of the earpiece 101-1 such that the audio clock is synchronized with the bluetooth clock. Specifically, the earpiece 101-1 (e.g., the bluetooth module of the earpiece 101-1 shown in fig. 8) may generate the synchronization signal based on the bluetooth clock of the earpiece 101-1. The earpiece 101-1 (e.g., the audio module of the earpiece 101-1 shown in fig. 8) may then calculate the difference of the synchronization signal from the audio clock of the earpiece 101-1. The audio module of the earplug 101-1 shown in fig. 8 can obtain the above-mentioned synchronization signal from the bluetooth module. Finally, the earpiece 101-1 (e.g., the audio module of the earpiece 101-1 shown in fig. 8) may adjust the audio clock of the earpiece 101-1 according to the difference such that the audio clock of the earpiece 101-1 is synchronized with the bluetooth clock. I.e. the earpiece 101-1 may perform S903 to synchronize the audio clock of the earpiece 101-1 with the bluetooth clock.
The earpiece 101-2 (e.g., the audio module of the earpiece 101-2 shown in fig. 8) may adjust the audio clock of the earpiece 101-2 such that the audio clock is synchronized with the bluetooth clock. Specifically, the earpiece 101-2 (e.g., the bluetooth module of the earpiece 101-2 shown in fig. 8) may generate the synchronization signal based on the bluetooth clock of the earpiece 101-2. The earpiece 101-2 (e.g., the audio module of the earpiece 101-2 shown in fig. 8) may then calculate the difference of the synchronization signal from the audio clock of the earpiece 101-2. The audio module of the earplug 101-2 shown in fig. 8 can obtain the above-mentioned synchronization signal from the bluetooth module. Finally, the earpiece 101-2 (e.g., the audio module of the earpiece 101-2 shown in fig. 8) may adjust the audio clock of the earpiece 101-2 according to the difference such that the audio clock of the earpiece 101-2 is synchronized with the bluetooth clock. That is, the ear plug 101-2 may perform S904 to synchronize the audio clock of the ear plug 101-2 with the bluetooth clock.
It can be understood that if the bluetooth clocks of the earpieces 101-1 and 101-2 are synchronized with the bluetooth clock of the mobile phone 100, the earpieces 101-1 and 101-2 respectively adjust the audio clock to be synchronized with the bluetooth clock; then the audio clock of the earpiece 101-1 and the audio clock of the earpiece 101-2 will also be synchronized.
With reference to fig. 1B, in the dual mode, as shown in fig. 9, the clock synchronization-2 may specifically include: synchronization of the audio clock of the ear plug 101-1 with the bluetooth clock (i.e., S903); and synchronization of the audio clock of the ear plug 101-2 with the bluetooth clock (i.e., S904).
For example, the embodiment of the present application takes the synchronization of the audio clock of the earplug 101-1 and the bluetooth clock as an example, and a specific method of the clock synchronization-2 is described herein. An ear bud 101-1 (e.g., the bluetooth module of ear bud 101-1 shown in fig. 8) may generate a synchronization signal based on the bluetooth clock of ear bud 101-1, which may characterize the value of the bluetooth clock of ear bud 101-1. Wherein. The bluetooth count shown in fig. 10A is the value of the bluetooth clock of the earplug 101-1. Meanwhile, the earplug 101-1 (e.g., the audio module of the earplug 101-1 shown in fig. 8) may obtain a value of the audio clock of the earplug 101-1. Wherein the audio count shown in fig. 10A is the value of the audio clock of the earplug 101-1. Then, as shown in fig. 10A, the earplug 101-1 (e.g., the audio module of the earplug 101-1 shown in fig. 8) may compare the bluetooth count and the audio count to obtain a difference between the bluetooth count and the audio count. Finally, the earplug 101-1 (e.g., the Audio module of the earplug 101-1 shown in fig. 8) may adjust the input and output frequencies of the Audio (Audio) Phase Locked Loop (PLL) of the earplug 101-1 according to the difference, so that the Audio count of the earplug 101-1 is the same as the bluetooth count, and the Audio clock of the earplug 101-1 is synchronized with the bluetooth clock.
Illustratively, the bluetooth module of the earplug 101-1 can perform m bluetooth counts every a ms. The audio module of the earplug 101-1 can perform an audio count m times per a ms. For example, as shown in fig. 10B or fig. 10C, a =10,m =10000. As shown in fig. 10B, the bluetooth module of the earplug 101-1 performs 10000 bluetooth counts per 10ms. Wherein, the Bluetooth module can clear the Bluetooth count every 10ms. As shown in fig. 10C, the audio module of the earplug 101-1 performs 10000 audio counts per 10ms. Wherein, the Bluetooth module can clear the Bluetooth count to zero every 10ms.
In this embodiment, the bluetooth module of the earplug 101-1 can send a synchronization signal to the audio module every a ms (e.g., 10 ms). The synchronization signal may characterize the value of the bluetooth clock (i.e., bluetooth count) of the earpiece 101-1. For example, as shown in fig. 10D or fig. 10E, the bluetooth module of the earplug 101-1 transmits a synchronization signal to the audio module every 10ms.
It will be appreciated that the audio clock and bluetooth clock of the earpiece 101-1 are synchronized and the bluetooth count of the bluetooth module is synchronized with the audio count of the audio module. However, over time, the Bluetooth count and the audio count of the earpiece 101-1 may differ, i.e., the audio clock and the Bluetooth clock of the earpiece 101-1 may differ.
For example, the audio count of the earpiece 101-1 may be less than the bluetooth count. As shown in fig. 10D, if the bluetooth count indicated by the synchronization signal is 10000 and the audio count is 9990, it means that the audio count is 10 count values smaller than the bluetooth count. At this time, the audio module can adjust the input/output frequency of the audio PLL of the earplug 101-1, so that the audio count of the earplug 101-1 is synchronized with the bluetooth count, and the audio clock of the earplug 101-1 is synchronized with the bluetooth clock.
For example, the audio count of the earpiece 101-1 may be greater than the bluetooth count. As shown in fig. 10E, if the bluetooth count indicated by the sync signal is 10000 and the audio count is 10, it indicates that when the bluetooth count is 10000 for one 10ms period (i.e., 0 for the next 10ms period of the 10ms period), the audio count is already 10 for the next 10ms period. I.e. the audio count is 10 count values greater than the bluetooth count. At this time, the audio module can adjust the input/output frequency of the audio PLL of the earplug 101-1, so that the audio count of the earplug 101-1 is synchronized with the bluetooth count, and the audio clock of the earplug 101-1 is synchronized with the bluetooth clock.
The method for implementing the synchronization between the audio clock and the bluetooth clock by the earplug 101-2 is the same as the method for implementing the synchronization between the audio clock and the bluetooth clock by the earplug 101-1, and details are not described herein in the embodiments of the present application.
It should be noted that in the embodiment of the present application, after the earplug 101-1 is taken out of the earplug case 101-3, the synchronization of the audio clock and the bluetooth clock can be performed periodically (e.g., every 10 ms). However, the earplug 101-1 is not necessarily used after being taken out of the earplug case 101-3. For example, the earplugs 101-1 may not necessarily communicate audio data with an electronic device (e.g., the handset 100) after being removed from the earpiece housing 101-3. If the earplug 101-1 is not used after being taken out of the earplug case 101-3 but the synchronization of the audio clock and the bluetooth clock is always performed, the power consumption of the earplug 101-1 is increased, affecting the endurance time of the earplug 101-1. In order to reduce the power consumption of the ear bud 101-1, the ear bud 101-1 can perform the synchronization of the audio clock and the bluetooth clock as described above when the ear bud 101-1 establishes a connection with the electronic device or when the ear bud 101-1 communicates audio data with the electronic device.
Finally, in the present embodiment, synchronization of the audio clock of the handset 100 with the audio clock of the earpieces of the TWS headset 101 (i.e., clock synchronization-3) may be achieved.
With reference to fig. 1B, as shown in fig. 9, the clock synchronization-3 may specifically include: synchronization of the audio clock of the handset 100 with the audio clock of the earpiece 101-1 (i.e., S905); and synchronization of the audio clock of the handset 100 with the audio clock of the earpiece 101-2 (i.e., S906).
Illustratively, the synchronization of the audio clock of the handset 100 and the audio clock of the earpiece 101-1 (i.e., S905) is taken as an example. As shown in fig. 9, the synchronization between the audio clock of the mobile phone 100 and the audio clock of the earpiece 101-1 may specifically include: the earpiece 101-1 may request the handset 100 to adjust the schedule of transmission of audio data from the handset 100 to the earpiece 101-1 when the data to be played (i.e., audio data) overflows or underflows, so as to suppress or avoid the persistence or exacerbation of the overflow or underflow phenomenon.
After the earplug 101-1 or the earplug 101-2 receives the audio data sent by the mobile phone 100, the received audio data (i.e. the data to be played) is stored in a buffer (buffer). The overflow of the data to be played may include: the buffered data in the buffer exceeds a first preset value (also referred to as a pipeline). The underflow of the data to be played may include: the buffered data in the buffer is lower than a second preset value (also called a lower pipeline).
Illustratively, specific implementations that the data buffered in the buffer is higher than the first preset value and the data buffered in the buffer is lower than the second preset value may include at least implementation (1) to implementation (3).
In implementation manner (1), the data cached in the buffer exceeds the first preset value, which may specifically be: the size of the data cached in the buffer exceeds a first preset value. The data cached in the buffer is lower than a second preset value, which may specifically be: the size of the data cached in the buffer is lower than a second preset value. The unit of the size of the data may be MB or KB. The unit of the first preset value and the second preset value is also MB or KB.
In the implementation manner (2), the data cached in the buffer exceeds the first preset value, which may specifically be: the time length to be played of the data cached in the buffer exceeds a first preset value. The data cached in the buffer is lower than a second preset value, which may specifically be: the time length to be played of the data cached in the buffer is lower than a second preset value. The time length of the data to be played refers to the length of time required for the earplug (e.g., the earplug 101-1) to play the data. The unit of the time length to be played of the data may be milliseconds (ms), seconds(s), or the like. The unit of the first preset value and the second preset value is also millisecond, second or the like.
In implementation manner (3), the data cached in the buffer exceeds the first preset value, which may specifically be: the number of the data packets cached in the buffer is greater than a first preset value. The data cached in the buffer is lower than a second preset value, which may specifically be: the number of the data packets cached in the buffer is less than a second preset value.
Optionally, in some embodiments, the overflowing the data to be played may include: the buffered data in the buffer will exceed a first preset value (also referred to as the pipeline). The underflow of the data to be played may include: the buffered data in the buffer will be lower than a second preset value (also called a lower pipeline).
It should be noted that, for a specific implementation manner that the data buffered in the buffer is about to exceed the first preset value, reference may be made to the detailed description of the embodiment that the data buffered in the buffer exceeds the first preset value. For a specific implementation manner that the data buffered in the buffer is about to be lower than the second preset value, reference may be made to the above embodiment to describe in detail that the data buffered in the buffer is lower than the second preset value. The embodiments of the present application are not described herein in detail.
In the embodiment of the present application, the handset 100 may transmit audio data to the earpiece 101-1 according to the first transmission parameter. Wherein the audio data transmitted per unit time according to the first transmission parameter has a first play duration. When the data to be played of the earplug 101-1 overflows, a first signal is sent to the mobile phone 100. In response to the first signal. The handset 100 may transmit audio data to the earpiece 101-1 according to the second transmission parameter. The audio data transmitted in unit time according to the second transmission parameter has a second play duration. The second playing time length is less than the first playing time length. The earpiece 101-1 sends a second signal to the handset 100 when the data to be played underflows. In response to the second signal transmitted by the earpiece 101-1, the handset 100 transmits audio data to said earpiece 101-1 according to the third transmission parameter. Wherein the audio data transmitted per unit time according to the third transmission parameter has a third play duration. The third playing time length is longer than the first playing time length.
Wherein the first signal may be transmitted by the earplug 101-1. The handset 100, in response to the first signal, may transmit audio data according to the second transmission parameter. The audio data transmitted per unit time according to the second transmission parameter has a smaller play time period (second play time period) than the audio data transmitted per unit time according to the first transmission parameter. I.e. the second play time is smaller than the first play time. If the playing time of the audio data sent to the ear plug 101-1 by the mobile phone 100 per unit time becomes shorter, it indicates that the progress of transmitting the audio data to the ear plug 101-1 by the mobile phone 100 is slowed down. In other words, the progress of transmitting the audio data according to the second transmission parameter is slower than the progress of transmitting the audio data according to the first transmission parameter. It will be appreciated that the handset 100 may adjust the transmission parameters for transmitting audio data to the earpiece 101-1 if the data to be played at the earpiece 101-1 overflows. In this manner, handset 100 may be slowed down in its progress to transmit audio data to ear piece 101-1. Thus, the earpiece 101-1 will slow down its buffer to store audio data, and the earpiece 101-1 will buffer data at a slower rate. The data buffered in the buffer may be reduced as the audio data buffered in the buffer is processed by the earpiece 101-1). Thus, the continuation or the progress of the overflow phenomenon can be suppressed.
The second signal is sent when the data to be played of the earplug 101-1 underflows. The handset 100 may transmit audio data according to the third transmission parameter in response to the second signal. The audio data transmitted per unit time according to the third transmission parameter has a larger play time period (second play time period) than the audio data transmitted per unit time according to the first transmission parameter. I.e. the third play time period is greater than the first play time period. The playing time of the audio data sent to the earplug 101-1 by the mobile phone 100 per unit time becomes longer, which means that the progress of the transmission of the audio data from the mobile phone 100 to the earplug 101-1 is accelerated. In other words, the progress of transmitting the audio data according to the third transmission parameter is faster than the progress of transmitting the audio data according to the first transmission parameter. It will be appreciated that the handset 100 may adjust the transmission parameters for transmitting audio data to the earpiece 101-1 if the data to be played for the earpiece 101-1 underflows. In this way, the progress of the handset 100 in transmitting audio data to the ear piece 101-1 can be accelerated. Thus, the amount of time that the earplug 101-1 stores audio data into its buffer is increased, and the amount of time that the earplug 101-1 buffers the audio data into its buffer is increased. On the premise that the speed of processing the audio data buffered in the buffer by the earplug 101-1 is unchanged, the data buffered in the buffer can be increased. Thus, the continuation or the progress of the underflow phenomenon can be suppressed.
Illustratively, the earplug 101-1 may request the handset 100 to adjust the schedule of transmitting the audio data from the handset 100 to the earplug 101-1 when the data to be played overflows or underflows, so as to suppress or avoid the continuation or aggravation of the overflow or underflow phenomenon described above, through the following three implementations (implementation a-implementation c). In implementation a, the first signal is a first indication message. The second signal is a second indication message.
The implementation mode a: the earplug 101-1 may send, when the data to be played overflows or underflows, indication information indicating that the data to be played overflows or underflows to the mobile phone 100, so as to feed back the overflow or underflow phenomenon.
For example, the earpiece 101-1 may send a first indication message to the handset 100 when the data to be played overflows. The first indication message is used to indicate that the data to be played of the earplug 101-1 overflows. The earpiece 101-1 may send a second indication message to the handset 100 when underflow occurs for the data to be played. The second indication message is used to indicate that the data to be played of the earplug 101-1 underflows.
The implementation mode b: the ear plug 101-1 sends a request for adjusting the progress of the audio data to the handset 100 when the data to be played overflows or underflows. In implementation b, the first signal is a first adjustment request. The second signal is a second adjustment request.
For example, the earpiece 101-1 may send a first adjustment request to the handset 100 when the data to be played overflows. The first adjustment request is for requesting the handset 100 to slow down the transmission of audio data to the earpiece 101-1. The earpiece 101-1 may send a second adjustment request to the handset 100 when underflow of data to be played occurs. The second adjustment request is for requesting the handset 100 to schedule the transmission of audio data to the earpiece 101-1.
It should be noted that, in the implementation a and the implementation b, reference may be made to the description in the following embodiments for a specific method for the mobile phone 100 to adjust the progress of transmitting the audio data to the earplug 101-1, which is not described herein again in this embodiment of the present application.
The implementation mode c: the earplug 101-1 sends the transmission parameters of the audio data to the handset 100 when the data to be played overflows or underflows, so as to request the handset 100 to transmit the audio data to the handset 100 according to the transmission parameters. In implementation manner c, the first signal may include a second transmission parameter. The second signal may include a third transmission parameter.
When the data to be played of the earplug 101-1 overflows, the transmission progress of the audio data corresponding to the transmission parameter (i.e., the second transmission parameter) sent by the earplug 101-1 to the mobile phone 100 is slower than the current transmission progress (i.e., the transmission progress corresponding to the first transmission parameter). When underflow occurs in the data to be played in the earplug 101-1, the transmission progress of the audio data corresponding to the transmission parameter (i.e., the third transmission parameter) sent by the earplug 101-1 to the mobile phone 100 is faster than the current transmission progress (i.e., the transmission progress corresponding to the first transmission parameter). For example, the transmission parameter may be at least one of a PCM sampling rate, a transmission time interval of the audio packet, and a size of the audio packet. Wherein the handset 100 can transmit audio data to the earpiece 101-1 in accordance with the transmission parameters indicated by the earpiece 101-1.
For example, assume that the handset 100 transmits audio data to the earpiece 101-1 with the corresponding transmission parameters in manner 1 of table 1. When the data to be played overflows, the earplug 101-1 may send the transmission parameter corresponding to the mode 2 in table 1 to the mobile phone 100. After receiving the transmission parameters corresponding to the mode 2 in table 1, the mobile phone 100 may transmit the audio data to the earplug 101-1 according to the transmission parameters corresponding to the mode 2 in table 1.
In the embodiment of the present application, the earplug 101-1 may transmit the first indication message, the second indication message, the first adjustment request, the second adjustment request, the transmission parameter, and the like through a control link between the earplug 101-1 and the mobile phone 100. For example, the control link may be an asynchronous connection-oriented link (ACL) link.
It is understood that when the data to be played overflows, the buffer of the earplug (e.g., the earplug 101-1) has more data buffered, and the earplug 101-1 has no time to play more audio data. The reason for the higher amount of data buffered in the buffer may be that the handset 100 is transmitting audio data to the earpiece 101-1 faster. In this case, if the handset 100 still transmits the audio data to the earpiece 101-1 according to the original transmission schedule, the audio data may be lost because the buffer cannot buffer the audio data from the handset 100. Thus, the audio data played by the ear bud 101-1 may not be continuous. At this point, the handset 100 may slow down the transmission of audio data to the earpiece 101-1. In this way, the cushioning pressure of the earplug 101-1 can be relieved, inhibiting or avoiding the persistence or exacerbation of the overflow phenomenon.
When underflow occurs for the data to be played, the buffer representing the earplug (e.g., the earplug 101-1) has less audio data buffered therein, and the earplug 101-1 does not have enough data to be played buffered therein. The reason for the lower data buffered in the buffer may be that the handset 100 is slower in its transmission of audio data to the earpiece 101-1. In this case, if the mobile phone 100 still transmits the audio data to the ear-bud 101-1 according to the original transmission schedule, no audio data may be played after the ear-bud 101-1 has played the data buffered in the buffer. Thus, the earplug 101-1 will experience an interruption in playback. At this point, the handset 100 may schedule the transmission of audio data to the earpiece 101-1. In this way, the buffering of the earplug 101-1 may be increased, inhibiting or avoiding the persistence or exacerbation of the underflow phenomenon.
For example, in the embodiment of the present application, the handset 100 may adjust the progress of transmitting the audio data to the earpiece 101-1 through the following implementation (i) to implementation (ii).
Implementation (i): the handset 100 (e.g., a Codec module of the handset 100 shown in fig. 8) may adjust the progress of the handset 100 transmitting audio data to the earpiece 101-1 by adjusting the PCM sampling rate at which the handset 100 transmits audio data to the earpiece 101-1 to inhibit or avoid the continuation or exacerbation of the underflow phenomenon. The higher the PCM sampling rate is, the more PCM samples are obtained by sampling in unit time. The more PCM samples, the more data is sampled.
Wherein, the audio data transmitted by the handset 100 to the ear-bud 101-1 is a digital signal. The data signal is converted from an analog signal. The handset 100 (e.g., a Codec module of the handset 100 shown in fig. 8) may convert the analog signal to a digital signal. The handset 100 may adjust the progress of the handset 100 in transmitting audio data to the earpiece 101-1 by adjusting the PCM sampling rate used in converting the analog signal to a digital signal.
In the first case, it is assumed that the time interval for transmitting the audio data packet to the ear piece 101-1 by the cellular phone 100 is fixed. For example, the handset 100 sends an audio data packet to the earpiece 101-1 every 20 milliseconds (ms). And the time length of the data to be played in each audio data packet is fixed. For example, the duration of the data to be played in each audio data packet is 20ms. The handset 100 may then suppress or avoid the persistence or exacerbation of the overflow or underflow phenomenon by resizing the audio data included in each audio data packet. Under the condition that the time interval is fixed and the duration of the data to be played is fixed, the size of the audio data included in each audio data packet depends on the PCM sampling rate used when the mobile phone 100 converts the analog signal into the digital signal.
Under the condition that the time interval is fixed and the duration of the data to be played is fixed, the greater the PCM sampling rate is, the more PCM samples are obtained by sampling in unit time, and the more audio data in the audio data packet is. Thus, if underflow occurs in implementation (1) above, the handset 100 may increase the PCM sampling rate to increase the data in the audio packets. Thus, the persistence or aggravation of the underflow phenomenon can be suppressed or avoided.
In the case that the time interval is fixed and the duration of the data to be played is fixed, the smaller the PCM sampling rate is, the fewer the number of PCM samples obtained by sampling per unit time is, and the fewer the audio data in the audio data packet is. Thus, if overflow occurs in implementation (1) above, the handset 100 may turn down the PCM sampling rate to reduce the data in the audio packets. Thus, the persistence or aggravation of the overflow phenomenon can be inhibited or avoided.
For example, as shown in mode 1 in table 1, assume that handset 100 transmits one audio packet to ear set 101-1 every 20ms. And, each audio data packet includes 20ms of audio data. The handset 100 transmits audio data packets to the earpiece 101-1 using a PCM sampling rate of 24 kilohertz (kHz). The size of the audio data included in each audio data packet is 100KB.
TABLE 1
Figure GPA0000302546590000251
Figure GPA0000302546590000261
If the data to be played of the ear piece 101-1 overflows, the mobile phone 100 may turn down the PCM sampling rate used by the mobile phone 100 to transmit the audio data packet to the ear piece 101-1. For example, the handset 100 may adjust the PCM sampling rate to 16kHz as shown in mode 2 in table 1. After the PCM sampling rate has been adjusted down, the handset 100 transmits an audio data packet to the ear piece 101-1 again every 20ms. Each audio data packet includes 20ms of audio data. However, the size of the audio data included in each audio data packet is changed. Specifically, the audio data included in each audio data packet becomes less. As shown in table 1, the audio data included in each audio data packet is changed from 100KB shown in mode 1 to 80KB shown in mode 2. In this manner, the buffering pressure of the earplug 101-1 can be relieved, and the persistence or aggravation of the overflow phenomenon can be inhibited or avoided.
If underflow occurs in the data to be played in the ear plug 101-1, the PCM sampling rate used by the handset 100 to transmit audio data packets to the ear plug 101-1 can be increased by the handset 100. For example, the handset 100 may adjust the PCM sampling rate to 32kHz as shown in mode 3 in table 1. After the PCM sampling rate has been adjusted up, the handset 100 transmits an audio data packet to the ear piece 101-1 again every 20ms. Each audio data packet includes 20ms of audio data. However, the size of the audio data included in each audio data packet is changed. Specifically, the audio data included in each audio data packet becomes more. As shown in table 1, the audio data included in each audio data packet is changed from 100KB shown in mode 1 to 160KB shown in mode 3. In this manner, the buffering of the earplug 101-1 may be increased to inhibit or avoid the persistence or exacerbation of the underflow phenomenon.
In the second case, it is assumed that the time interval for transmitting the audio data packet to the ear piece 101-1 by the cellular phone 100 is fixed. For example, the handset 100 sends one audio packet to the ear piece 101-1 at 20ms intervals. And, the size of the audio data included in each audio data packet is fixed. For example, 100KB of audio data is included in each audio data packet. The handset 100 can then suppress or avoid the persistence or exacerbation of the overflow or underflow phenomenon by adjusting the duration of the data to be played in each audio data packet.
In the case that the time interval is fixed and the size of the audio data included in each audio data packet is fixed, the duration of the data to be played in each audio data packet depends on the PCM sampling rate used when the mobile phone 100 converts the analog signal into the digital signal.
Under the condition that the size of the audio data included in the audio data packet is fixed, the larger the PCM sampling rate is, the shorter the duration of the data to be played in each audio data packet is. Thus, if the overflow in the above implementation (2) occurs, the cell phone 100 can increase the PCM sampling rate to shorten the duration of the data to be played in the audio data packet. Thus, the persistence or aggravation of the overflow phenomenon can be suppressed or avoided.
In the case where the size of audio data included in an audio data packet is fixed, the smaller the PCM sampling rate, the longer the duration of data to be played in each audio data packet. Thus, if underflow occurs in implementation (2) above, the handset 100 can turn down the PCM sampling rate to increase the duration of the data to be played in the audio data packet. Thus, the persistence or aggravation of the underflow phenomenon can be suppressed or avoided.
For example, as shown in mode 1 in table 2, assume that handset 100 transmits one audio packet to ear set 101-1 every 20ms. And, the size of the audio data included in each audio data packet is 100KB. Each audio data packet includes 20ms of audio data. The handset 100 transmits audio data packets to the earpiece 101-1 using a PCM sampling rate of 24kHz.
TABLE 2
Figure GPA0000302546590000262
Figure GPA0000302546590000271
If the data to be played of the ear plug 101-1 overflows, the PCM sampling rate used by the mobile phone 100 to transmit the audio data packet to the ear plug 101-1 can be increased by the mobile phone 100. For example, the handset 100 may adjust the PCM sampling rate to 32kHz as shown in mode 2 of table 2. After the PCM sampling rate is adjusted up, the handset 100 transmits an audio data packet to the ear piece 101-1 again every 20ms. Each audio data packet includes 100KB of audio data. However, the playback time length of the audio data in each audio data packet is changed. Specifically, the playing time of the audio data in the audio data packet is shortened. As shown in table 2, the playback time period of the audio data in each audio data packet is changed from 20ms shown in pattern 1 to 10ms shown in pattern 2. In this manner, the buffer pressure of the earplug 101-1 can be relieved, and the persistence or aggravation of the overflow phenomenon can be inhibited or avoided.
If the data to be played in the ear plug 101-1 underflows, the PCM sampling rate used by the handset 100 to transmit the audio data packets to the ear plug 101-1 can be reduced by the handset 100. For example, the handset 100 may adjust the PCM sampling rate to 16kHz as shown in mode 3 in table 2. After the PCM sampling rate has been adjusted down, the handset 100 transmits an audio data packet to the ear piece 101-1 again every 20ms. Each audio data packet includes 100KB of audio data. However, the playback time length of the audio data in each audio data packet changes. Specifically, the playing time of the audio data in the audio data packet is lengthened. As shown in table 2, the playing time of the audio data in each audio data packet is changed from 20ms shown in the mode 1 to 30ms shown in the mode 3. In this manner, the buffering of the earplug 101-1 may be increased to inhibit or avoid the persistence or exacerbation of the underflow phenomenon.
Implementation (ii): the handset 100 may adjust the schedule of audio data transmission from the handset 100 to the earpiece 101-1 by adjusting the interval between audio data packets transmission to the earpiece (e.g., the earpiece 101-1) to inhibit or avoid the continuation or exacerbation of the underflow phenomenon.
Here, it is assumed that the size of audio data included in an audio data packet transmitted from the cellular phone 100 to the earpiece 101-1 is fixed. For example, 100KB of audio data is included in each audio data packet. And the duration of the data to be played in each audio data packet is fixed. For example, the duration of the data to be played in each audio data packet is 20ms. In this case, the more frequently the handset 100 sends audio packets to the earpiece 101-1, i.e., the less the time interval, the more audio packets are buffered in the buffer of the earpiece 101-1 and the more audio data is buffered. The less frequently the handset 100 sends audio packets to the earpiece 101-1, i.e., the greater the time interval, the fewer audio packets and the fewer audio data are buffered in the buffer of the earpiece 101-1.
If an overflow occurs in any of the above implementations (1), (2), or (3), the handset 100 may adjust the time interval for transmitting audio data to the earpiece 101-1. For example, the handset 100 may transmit an audio data packet to the earpiece 101-1 every 30ms. After the time interval for transmitting the audio data to the ear plug 101-1 is increased, the playing time period of the audio data in each audio data packet is not changed although the size of the audio data in each audio data packet is not changed. However, the number of audio data packets sent by the handset 100 to the earpiece 101-1 is reduced, so that the audio data to be buffered by the buffer of the earpiece 101-1 is reduced, and the playing time of the audio data to be buffered by the buffer is also shortened. In this manner, the buffering pressure of the earplug 101-1 can be relieved, inhibiting or avoiding the persistence or exacerbation of the overflow phenomenon.
If underflow occurs in any of the above implementations (1), (2), or (3), the handset 100 may reduce the time interval for transmitting audio data to the earpiece 101-1. For example, the handset 100 may transmit an audio data packet to the earpiece 101-1 every 10ms. After the time interval for transmitting the audio data to the ear plug 101-1 is reduced, the playing time of the audio data in each audio data packet is not changed although the size of the audio data in each audio data packet is not changed. However, the number of audio data packets sent by the handset 100 to the earpiece 101-1 increases, so that the audio data to be buffered by the buffer of the earpiece 101-1 increases, and the playing time of the audio data to be buffered by the buffer also increases. In this manner, the buffering of the earplug 101-1 may be increased to inhibit or avoid the persistence or exacerbation of the underflow phenomenon.
It should be noted that the bluetooth clock of the handset 100 is not adjusted during the process of the handset 100 adjusting the progress of transmitting audio data to the earpieces. I.e., the time at which the handset 100 transmits audio data to the earpieces, does not change. The handset 100 simply adjusts the interval between the transmission of audio data packets to the ear buds. For example, the handset 100 may not send audio packets at some time when they would otherwise be sent.
It should be noted that, in the embodiment of the present application, the handset 100 can not only adjust the progress of transmitting the audio data to the earpiece 101-1 through the following implementation (i) to implementation (ii). The handset 100 may also adjust the progress of transmitting audio data to the ear bud 101-1 by adjusting at least two of the three parameters, i.e., the size of audio data included in the audio data packets, the duration of data to be played in each audio data packet, and the time interval for transmitting the audio data packets.
With reference to the implementation manner a, if the mobile phone 100 receives the first indication message sent by the earplug 101-1, it indicates that the data to be played of the earplug 101-1 overflows. At this point, the handset 100 may turn down the PCM sampling rate to slow the progress of the handset 100 in transmitting audio data to the ear piece 101-1. If the handset 100 receives the second indication message sent by the earpiece 101-1, it indicates that the data to be played of the earpiece 101-1 underflows. At this point, the handset 100 may increase the PCM sampling rate to speed up the progress of the handset 100 in transmitting audio data to the earpiece 101-1.
In conjunction with implementation b above, if the handset 100 receives the first adjustment request sent by the earpiece 101-1, the PCM sampling rate may be decreased in response to the first adjustment request to slow down the progress of the handset 100 in transmitting audio data to the earpiece 101-1. If the handset 100 receives a second adjustment request sent by the earpiece 101-1, the PCM sampling rate may be increased in response to the second adjustment request to speed up the progress of the handset 100 in transmitting audio data to the earpiece 101-1.
For example, in the implementation a and the implementation b, the mobile phone 100 may adjust the progress of transmitting the audio data to the earpiece 101-1 by the mobile phone 100 according to the preset steps.
For example, in combination with the first case of the above implementation (i), the mobile phone 100 may decrease the PCM sampling rate in the first transmission parameter according to a first preset step, so as to slow down the progress of the mobile phone 100 in transmitting the audio data to the earplug 101-1; the handset 100 may increase the PCM sampling rate in the first transmission parameter by a second predetermined step to speed up the progress of the handset 100 in transmitting audio data to the earpiece 101-1.
For example, in combination with the second case of the foregoing implementation manner (i), the mobile phone 100 may increase the PCM sampling rate in the first transmission parameter according to a third preset step, so as to reduce the playing time of the audio data in the audio data packet. Thus, the progress of the transmission of audio data to the earpiece 101-1 by the handset 100 can be slowed. The handset 100 may turn down the PCM sampling rate in the first transmission parameter in a fourth predetermined step. This can increase the play time of the audio data in the audio data packet. Thereby, the progress of the transmission of the audio data from the handset 100 to the earpiece 101-1 can be speeded up.
For another example, in combination with the above implementation (ii), the mobile phone 100 may increase the time interval in the first transmission parameter according to a fifth preset step, so as to slow down the progress of the mobile phone 100 in transmitting the audio data to the earpiece 101-1; the cell phone 100 may decrease the time interval in the first transmission parameter according to a sixth predetermined step to speed up the progress of the cell phone 100 in transmitting the audio data to the earpiece 101-1.
Take the example that the mobile phone 100 adjusts the progress of transmitting the audio data to the ear piece 101-1 by adjusting the interval time of transmitting the audio data packets to the ear piece 101-1. The fifth preset step and the sixth preset step may be 5ms. It is assumed that the size of the audio data included in the audio data packets sent by the handset 100 to the earpiece 101-1 is fixed, and the duration of the data to be played in each audio data packet is fixed. When the data to be played overflows, the handset 100 may extend the time interval for transmitting the audio data packet to the earpiece 101-1 by 5ms. For example, the handset 100 may adjust the time interval for transmitting audio data packets to the earpiece 101-1 from 10ms to 15ms. When underflow occurs in the data to be played, the handset 100 may shorten the time interval for transmitting the audio data packet to the earplug 101-1 by 5ms. For example, the handset 100 may adjust the time interval for transmitting audio data packets to the ear piece 101-1 from 10ms to 5ms.
Illustratively, the interaction process when the handset 100 and the earplugs of the TWS headset 101 realize audio clock synchronization is explained based on the audio protocol framework of BLE in the embodiments of the present application.
Please refer to fig. 11, which illustrates a BLE-based audio protocol framework provided in an embodiment of the present application. As shown in fig. 11, the protocol framework may include: an application (application) layer, a Host (Host), a Host Controller Interface (HCI), and a Controller (Controller).
Wherein the controller includes a link layer and a physical layer. The physical layer is responsible for providing the physical channel for data transmission. Typically, several different types of channels exist in a communication system, such as control channels, data channels, voice channels, and so on. The link layer includes ACL links and ISO channels. The ACL link is used to transmit control messages between devices, such as content control messages (e.g., previous, next, etc.). ISO channels may be used to transmit isochronous data (i.e., audio data) between devices.
Host and Controller communicate via HCI. The medium in which Host and Controller communicate is the HCI directive. The Host may be implemented in an Application Processor (AP) of the device, and the Controller may be implemented in a bluetooth chip of the device. Alternatively, in a small device, host and Controller may be implemented in the same processor or Controller, in which case HCI is optional.
Referring to fig. 12, the embodiment of the present application, in combination with the BLE-based audio protocol framework shown in fig. 11, explains a specific process of the clock synchronization-3 by taking an example of adjusting the PCM sampling rate to suppress overflow or underflow on the premise that the time interval for sending the audio data packets to the ear plug by the mobile phone 100 is fixed, and the duration of the data to be played in each audio data packet is fixed. The specific process of synchronizing the audio clock of the handset 100 and the earpiece 101-1 (i.e., S905) can refer to S1201. The specific procedure of the audio clock synchronization of the handset 100 and the earpiece 101-2 (i.e., S905) can refer to S1202. Where both the handset 100 and the earpiece have a Host and a link layer LL (included in the controller), the Host and LL communicate via the HCI.
Illustratively, the handset 100 is synchronized with the audio clock of the earpiece 101-1. As shown in fig. 12, the audio module of the earplug 101-1 may send a set audio clock request to the Host of the earplug 101-1 when the data to be played overflows or underflows. For example, the Set Audio Clock Request may be a Set Audio Clock Request. The Host of the earpiece 101-1, upon receiving the set audio clock request, may send a set audio clock confirmation message to the LL of the earpiece 101-1. The set audio clock confirmation message is used to instruct the LL of the ear-bud 101-1 to request the handset 100 to adjust the audio clock of the handset 100 (i.e., to adjust the transmission progress of sending audio data to the ear-bud 101-1). For example, the Set Audio Clock confirmation information may be the HCI Command "HCI Set Audio Clock Command".
As shown in fig. 12, the LL of the earpiece 101-1, upon receiving the set audio clock acknowledgement message, may send an audio clock control command to the LL of the handset 100. The audio clock control command is used to request the handset 100 to adjust the audio clock of the handset 100 (i.e., to adjust the transmission progress of the audio data sent to the earpiece 101-1). For example, the audio clock Control command may be a LL _ Control _ PDU message. Wherein the LL of the earplug 101-1 may send an LL _ Control _ PDU message to the LL of the handset 100 through an ACL link (such as the ACL link of the link layer shown in fig. 11).
In response to the LL _ Control _ PDU message described above, the LL of the handset 100 may trigger a Set Audio Clock event (e.g., "HCI Set Audio Clock event") to the Host of the handset 100. Wherein, the LL of the handset 100 may trigger setting of the audio clock event to the Host of the handset 100 through the HCI instruction. In response to a set audio clock event triggered by the LL of the handset 100, the Host of the handset 100 may adjust the PCM sampling rate of the audio data transmitted to the earpiece 101-1 to encode. Wherein the handset 100 adjusts the PCM sampling rate of the audio data transmitted to the earpiece 101-1 after the feedback of the earpiece 101-1 overflows or underflows, the continuation or aggravation of the overflow or underflow phenomenon can be suppressed or avoided.
In the monitoring mode described in the above scenario (2) and the forwarding mode described in the above scenario (3), the handset 100 is connected in pair with the earplug 101-1. Earplug 101-1 is mated with earplug 101-2.
Referring to fig. 3B, as shown in fig. 13, in the scene (2) and the scene (3), the clock synchronization-1 may specifically include: synchronization of the earpiece 101-1 with the bluetooth clock of the handset 100 (i.e., S901); and synchronization of the bluetooth clock of the ear plug 101-2 and the ear plug 101-1 (i.e., S1301). The clock synchronization-2 may specifically include: synchronization of the audio clock of the earpiece 101-1 with the bluetooth clock (i.e., S903); and synchronization of the audio clock of the ear plug 101-2 with the bluetooth clock (i.e., S904). Clock synchronization-3 may specifically include: synchronization of the audio clock of the handset 100 with the audio clock of the earpiece 101-1 (i.e., S905).
It should be noted that, for the detailed description of S901 and S903 to S905 in the scenario (2) and the scenario (3), reference may be made to the introduction of S901 and S903 to S905 in the foregoing embodiment, and details of the embodiment of the present application are not repeated here. The method for synchronizing the bluetooth clocks of the earpieces 101-2 and 101-1 (i.e., S1301) is similar to the method for synchronizing the bluetooth clocks of the earpieces 101-1 and the mobile phone 100 (i.e., S901), and is not described herein again in this embodiment of the present application.
In any of the above-described scenarios (1) to (3), the bluetooth clock synchronization of the earpiece 101-1 and the bluetooth clock of the mobile phone 100 may be achieved, and the earpiece 101-2 and the bluetooth clock of the mobile phone 100 are synchronized, so that the bluetooth clock synchronization of the two earpieces of the TWS headset 101 is achieved. Furthermore, the audio clock of the earpiece 101-1 can be synchronized with the bluetooth clock, and the audio clock of the earpiece 101-2 can be synchronized with the bluetooth clock, so that the audio clocks of the two earpieces of the TWS headset 101 can be synchronized. Further, the mobile phone 100 may also adjust the progress of the audio data transmitted to the two earplugs of the TWS headset 101, so as to suppress or avoid the persistence or aggravation of the overflow or underflow phenomenon, and improve the transmission efficiency and the playing quality of the audio data.
In the single-shot mode described in the above scenario (4), the handset 100 is connected in pair with the earplug 101-1.
With reference to fig. 4B, as shown in fig. 14, in scenario (4), clock synchronization-1 may specifically include: synchronization of the earpiece 101-1 with the bluetooth clock of the handset 100 (i.e., S901). The clock synchronization-2 may specifically include: synchronization of the audio clock of the earpiece 101-1 with the bluetooth clock (i.e., S903). Clock synchronization-3 may specifically include: synchronization of the audio clock of the handset 100 with the audio clock of the earpiece 101-1 (i.e., S905). For detailed description of S901, S903, and S905 in the scenario (4), reference may be made to descriptions of S901, S903, and S905 in the foregoing embodiments, and details of the embodiments of the present application are not repeated here.
In the above scenario (4), synchronization of the bluetooth clock of the ear plug 101-1 and the handset 100 can be achieved. Also, the audio clock of the ear plug 101-1 can be synchronized with the bluetooth clock. Further, the mobile phone 100 may also adjust the progress of the audio data transmitted to the earplugs 101-1, so as to suppress or avoid the persistence or aggravation of the overflow or underflow phenomenon, and improve the transmission efficiency and the playing quality of the audio data.
In some embodiments, if the data to be played in an ear piece (e.g., ear piece 101-1) overflows, it indicates that more data is buffered in the buffer of ear piece 101-1, and that ear piece 101-1 has no time to play more audio data. At this time, the earplug 101-1 may perform shortening processing on the data buffered in the buffer and then play the data. For example, the earplug 101-1 may perform a shortening process on the audio data with a playing time of 30ms, and shorten the playing time of the processed audio data to 20ms. Thus, the earplug 101-1 can play the shortened processed audio data for 20ms.
If the data to be played in the earplug (e.g., the earplug 101-1) underflows, it indicates that the buffer of the earplug 101-1 has less audio data buffered, and the earplug 101-1 does not have enough data to be played. At this time, the earplug 101-1 may perform stretching processing on the data buffered in the buffer and then play the data. For example, the earplug 101-1 may stretch the audio data with a playing time of 20ms, and the audio data after the stretching has a playing time of 30ms. In this way, the earplug 101-1 can play the shortened processed audio data for 30ms.
In some embodiments, the single-shot mode described in scenario (4) above may be converted into the dual-shot mode described in scenario (1) above, the listening mode described in scenario (2) above, or the forwarding mode described in scenario (3) above due to the addition of a new earplug. When the single-transmission mode described in the scenario (4) is converted into the dual-transmission mode described in the scenario (1), when the mobile phone 100 starts to transmit an audio data packet to a newly added earplug (e.g., the earplug 101-2), the buffer of the earplug 101-2 has less data. While more data may have been buffered in the buffer of the earplug (e.g., earplug 101-1) that is playing the audio data. At this time, underflow of data to be played back of the earplug 101-2 and overflow of data to be played back of the earplug 101-1 may occur.
To avoid this, the handset 100 may slow down the transmission of audio data to the earpiece 101-1 when a newly added earpiece 101-2 is detected. The handset 100 may transmit audio data to the earpiece 101-2 when the data buffered in the buffer of the earpiece 101-1 is below a third predetermined value (also referred to as a waterline).
Alternatively, the handset 100 may slow down the transmission of audio data to the earpiece 101-1 upon detection of a newly added earpiece 101-2. Meanwhile, the mobile phone 100 may speed up the transmission of the audio data to the earpiece 101-2 until the difference between the buffered data in the buffer of the earpieces 101-1 and 101-2 is smaller than the preset value.
In still other embodiments of the present application, an electronic device is provided that is a second electronic device. For example, the second electronic device may be an earpiece of a TWS headset. The structure of the earplug of the TWS headset may refer to the structure of the earplug shown in fig. 6. One or more computer programs may be stored in the memory of the earplug. The one or more computer programs include instructions. The instructions may be for performing various functions or steps performed by earplugs (e.g., earplug 101-1, earplug 101-2) of a TWS headset as described in any of fig. 9, 12, 13, or 14. Of course, the earplug of the TWS headset shown in fig. 6 may further include other devices such as a sensor, which is not limited in this embodiment.
In still other embodiments of the present application, an electronic device is provided that is a first electronic device. The structure of the electronic device may refer to the structure of the electronic device shown in fig. 7. One or more computer programs may be stored in the memory of the electronic device. The one or more computer programs include instructions. The instructions may be used to perform various functions or steps as performed by the handset 100 in the description corresponding to any of fig. 9, 12, 13 or 14.
An embodiment of the present application further provides a computer storage medium, where the computer storage medium includes computer instructions, and when the computer instructions are executed on the above electronic device (first electronic device or second electronic device), the electronic device is caused to perform various functions or steps that are performed by the corresponding electronic device in the description corresponding to any one of fig. 9, fig. 12, fig. 13, or fig. 14.
Embodiments of the present application also provide a computer program product, which when run on a computer, causes the computer to execute the method for communicating audio data as shown in any one of fig. 9, fig. 12, fig. 13, or fig. 14.
Through the above description of the embodiments, it is clear to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional modules is merely used as an example, and in practical applications, the above function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device may be divided into different functional modules to complete all or part of the above described functions. For the specific working processes of the system, the apparatus and the unit described above, reference may be made to the corresponding processes in the foregoing method embodiments, and details are not described here again.
In the several embodiments provided in this embodiment, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules or units is only one type of logical functional division, and other divisions may be realized in practice, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one position, or may be distributed on multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, each functional unit in each embodiment of the present embodiment may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present embodiment essentially or partially contributes to the prior art, or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) or a processor to execute all or part of the steps of the method described in the embodiments. And the aforementioned storage medium includes: flash memory, removable hard drive, read only memory, random access memory, magnetic or optical disk, and the like.
The above descriptions are only specific embodiments of the present embodiment, but the scope of the present embodiment is not limited thereto, and any changes or substitutions within the technical scope of the present embodiment should be covered by the scope of the present embodiment. Therefore, the protection scope of the present embodiment shall be subject to the protection scope of the claims.

Claims (10)

1. A method of communicating audio data, the method comprising:
the first electronic equipment sends a first audio data packet to the second electronic equipment according to the first transmission parameter; wherein the audio data in the first audio data packet transmitted according to the first transmission parameters has a first pulse code modulation, PCM, sample rate;
responding to a first signal sent by the second electronic equipment, and sending a second audio data packet to the second electronic equipment by the first electronic equipment according to a second transmission parameter; wherein audio data in the second audio data packet transmitted according to the second transmission parameter has a second PCM sampling rate, the second PCM sampling rate being greater than the first PCM sampling rate;
in response to a second signal sent by the second electronic device, the first electronic device sends a third audio data packet to the second electronic device according to a third transmission parameter; audio data in the third audio data packet sent according to the third transmission parameter has a third PCM sampling rate, the third PCM sampling rate being less than the first PCM sampling rate;
the first electronic device sends audio data packets to the second electronic device at fixed time intervals, and the size of audio data included in each audio data packet using different PCM sampling rates is fixed.
2. The method according to claim 1, wherein the first signal is sent when the data to be played of the second electronic device overflows; the second signal is sent when the data to be played of the second electronic equipment underflow;
the data to be played of the second electronic device overflows, specifically: the data in the cache of the second electronic device exceeds a first preset value;
the underflow of the to-be-played data of the second electronic device specifically includes: and the data in the cache of the second electronic equipment is lower than a second preset value.
3. The method according to claim 2, wherein the data in the cache of the second electronic device exceeds a first preset value, specifically: the size of the data in the cache of the second electronic equipment exceeds the first preset value;
the data in the cache of the second electronic device is lower than a second preset value, and specifically includes: and the size of the data in the cache of the second electronic equipment is lower than the second preset value.
4. The method according to claim 2, wherein the data in the cache of the second electronic device exceeds a first preset value, specifically: the time length to be played of the data in the cache of the second electronic equipment exceeds the first preset value;
the data in the cache of the second electronic device is lower than a second preset value, and specifically includes: and the time length to be played of the data in the cache of the second electronic equipment is lower than the second preset value.
5. The method according to claim 2, wherein the data in the cache of the second electronic device exceeds a first preset value, specifically: the number of the audio data packets in the cache of the second electronic equipment is greater than the first preset value;
the data in the cache of the second electronic device is lower than a second preset value, and specifically includes: and the number of the audio data packets in the cache of the second electronic equipment is less than the second preset value.
6. The method according to any one of claims 1-5, wherein the first signal is a first indication message, and the first indication message is used for indicating that the data to be played of the second electronic device is overflowed;
the second signal is a second indication message, and the second indication message is used for indicating underflow of data to be played of the second electronic device.
7. The method according to any one of claims 1 to 5, wherein the first signal is a first adjustment request, and the first adjustment request is used for requesting the first electronic device to reduce the playing duration of the audio data sent to the second electronic device per unit time;
the second signal is a second adjustment request, and the second adjustment request is used for requesting the first electronic device to increase the playing time length of the audio data sent to the second electronic device in unit time.
8. The method according to any of claims 1-5, characterized in that the second transmission parameters are included in the first signal; the third transmission parameter is included in the second signal.
9. An electronic device, wherein the electronic device is a first electronic device, the electronic device comprising: a processor, a memory, and a communication interface; the memory and the communication interface are coupled with the processor; the memory for storing computer program code; the computer program code comprising computer instructions which, when executed by the processor, cause the electronic device to perform the method of any of claims 1-8.
10. A computer storage medium comprising computer instructions that, when run on a first electronic device, cause the first electronic device to perform the method of any of claims 1-8.
CN201880098111.7A 2018-12-25 2018-12-25 Audio data communication method and electronic equipment Active CN112771828B (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2018/123656 WO2020132907A1 (en) 2018-12-25 2018-12-25 Communication method for audio data, and electronic device

Publications (2)

Publication Number Publication Date
CN112771828A CN112771828A (en) 2021-05-07
CN112771828B true CN112771828B (en) 2022-10-18

Family

ID=71127574

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201880098111.7A Active CN112771828B (en) 2018-12-25 2018-12-25 Audio data communication method and electronic equipment

Country Status (2)

Country Link
CN (1) CN112771828B (en)
WO (1) WO2020132907A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112040457A (en) * 2020-08-26 2020-12-04 广州番禺巨大汽车音响设备有限公司 Pairing connection method, device and system of TWS wireless Bluetooth headset
CN113709619A (en) * 2021-08-31 2021-11-26 Oppo广东移动通信有限公司 Audio processing method and device, user terminal and computer readable medium
CN114173426B (en) * 2021-11-30 2023-09-29 广州番禺巨大汽车音响设备有限公司 Wireless sound box playing control method, device and system based on wireless audio transmission

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7035215B1 (en) * 1998-01-02 2006-04-25 Nokia Corporation Method for synchronization adaptation of asynchronous digital data streams
CN101409808A (en) * 2008-10-15 2009-04-15 北京创毅视讯科技有限公司 Method and apparatus for re-sampling audio, and digital television chip
CN101681624A (en) * 2007-05-21 2010-03-24 松下电器产业株式会社 Voice coder and decoder
CN105847961A (en) * 2016-03-29 2016-08-10 北京数码视讯科技股份有限公司 Audio data processing method and apparatus

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3711099B2 (en) * 2002-09-27 2005-10-26 株式会社東芝 Reproducing apparatus and reproducing apparatus access method
JP2006518948A (en) * 2003-02-13 2006-08-17 ノキア コーポレイション Streaming quality adaptation and control mechanism signaling method in multimedia streaming
CN101002192A (en) * 2004-07-27 2007-07-18 索尼株式会社 Home network system with transmission error recovery
CN102075514B (en) * 2010-11-19 2013-07-31 王恒 Audio transmission method for DSPPA network
CN103916367B (en) * 2012-12-31 2017-04-26 北京新媒传信科技有限公司 Method and apparatus for transmission of multimedia data
CN105245946B (en) * 2014-07-10 2020-08-28 中兴通讯股份有限公司 Method, device and system for controlling flow of variable-code-rate media stream
CN105681883B (en) * 2016-01-07 2019-05-31 深圳Tcl数字技术有限公司 Audio data method for pushing and system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7035215B1 (en) * 1998-01-02 2006-04-25 Nokia Corporation Method for synchronization adaptation of asynchronous digital data streams
CN101681624A (en) * 2007-05-21 2010-03-24 松下电器产业株式会社 Voice coder and decoder
CN101409808A (en) * 2008-10-15 2009-04-15 北京创毅视讯科技有限公司 Method and apparatus for re-sampling audio, and digital television chip
CN105847961A (en) * 2016-03-29 2016-08-10 北京数码视讯科技股份有限公司 Audio data processing method and apparatus

Also Published As

Publication number Publication date
CN112771828A (en) 2021-05-07
WO2020132907A1 (en) 2020-07-02

Similar Documents

Publication Publication Date Title
CN112789867B (en) Bluetooth connection method and equipment
CN112640505B (en) Transmission rate control method and equipment
CN113382397B (en) Bluetooth connection method, device and system
CN113228701B (en) Audio data synchronization method and device
CN112789866B (en) Audio data transmission method and equipment applied to TWS earphone single-ear and double-ear switching
CN112868244B (en) Point-to-multipoint data transmission method and device
CN112313929B (en) Method for automatically switching Bluetooth audio coding modes and electronic equipment
CN112771890B (en) Point-to-multipoint data transmission method and electronic equipment
CN112042212B (en) Audio data transmission method and electronic equipment
CN112789883B (en) Rate control method, device and computer storage medium
CN114710768B (en) Bluetooth connection method and related device
CN112913321B (en) Method, equipment and system for carrying out call by using Bluetooth headset
CN112771828B (en) Audio data communication method and electronic equipment
CN112806092A (en) Microphone MIC switching method and device
CN112469012A (en) Bluetooth communication method and related device
CN113678481B (en) Wireless audio system, audio communication method and equipment
CN115525366A (en) Screen projection method and related device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant