Audio data transmission method and device, earphone, earphone group and medium

By implementing a data synchronization and backup mechanism in the headphone group, the problem of recording data loss during headphone master-slave switching is solved, ensuring the integrity of the recording data and the stereo recording effect.

CN116347319BActive Publication Date: 2026-01-13GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111583097.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-22
Publication Date
2026-01-13
Estimated Expiration
2041-12-22

AI Technical Summary

Technical Problem

When a master-slave switch occurs in the headphone assembly, it can easily lead to the loss of recording data, affecting the recording quality.

Method used

By implementing a data synchronization mechanism in the headphone assembly, and utilizing synchronization information comparison and backup mechanisms, synthetic recording data is generated to ensure the integrity of the recording data.

Benefits of technology

During the master-slave switching process of the headphones, the recording data is prevented from being lost, ensuring the integrity of the recording data and the recording effect, so as to achieve true stereo recording.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116347319B_ABST
    Figure CN116347319B_ABST
Patent Text Reader

Abstract

The application provides an audio data transmission method, device, earphone, earphone group and medium. The audio data transmission method comprises the following steps: in the case that the first earphone is switched from a slave earphone to a master earphone, receiving first recording data sent by a second earphone; if the first recording data is not synchronized with second recording data cached by the first earphone, obtaining third recording data according to the first recording data, the third recording data being audio data corresponding to a non-synchronized part of the first recording data relative to the second recording data; and generating synthesized recording data according to the first recording data, the second recording data and the third recording data. The application can avoid data loss and ensure recording effect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of audio equipment technology, and in particular to an audio data transmission method, apparatus, headphones, headphone assembly, and medium. Background Technology

[0002] With the rapid development of technology, headphones have become increasingly widely used. Some headphones with microphones are used not only for audio playback but also for audio recording. To achieve stereo recording, the microphones of both headphones can be used separately for recording. Summary of the Invention

[0003] This application provides an audio data transmission method, apparatus, first earphone, second earphone, earphone group, and medium, which can avoid data loss and ensure recording quality.

[0004] An audio data transmission method is applied to a first earpiece of an earphone group, the earphone group further comprising a second earpiece. The method includes: when the first earpiece switches from a slave earpiece to a master earpiece, receiving first recording data sent by the second earpiece; if the first recording data is out of sync with second recording data buffered by the first earpiece, obtaining third recording data based on the first recording data, the third recording data being audio data corresponding to the out-of-sync portion of the first recording data relative to the second recording data; and generating synthesized recording data based on the first recording data, the second recording data, and the third recording data.

[0005] An audio data transmission method is applied to a second earpiece in an earphone group, the earphone group further comprising a first earpiece. The method includes: when the second earpiece is switched from a master earpiece to a slave earpiece, sending first recording data and slave ear recording data to the first earpiece; wherein the first recording data is audio data recorded by the second earpiece, and the slave ear recording data is audio data recorded and sent to the second earpiece when the first recording data is not synchronized with second recording data buffered in the first earpiece; the first earpiece is used to obtain third recording data based on the first recording data when the first recording data is not synchronized with second recording data buffered in the first earpiece, and to generate synthesized recording data based on the first recording data, the second recording data, and the third recording data; the third recording data is the audio data corresponding to the asynchronous portion of the first recording data relative to the second recording data.

[0006] An audio data transmission method is applied to an earphone group, the earphone group including a first earphone and a second earphone. The method includes: when the first earphone switches from a slave earphone to a master earphone, the second earphone sends the first recording data to the first earphone; the first recording data is audio data recorded by the second earphone; when the first recording data is out of sync with the second recording data buffered by the first earphone, the first earphone obtains the third recording data based on the first recording data, and generates synthesized recording data based on the first recording data, the second recording data, and the third recording data; the third recording data is the audio data corresponding to the out-of-sync portion of the first recording data relative to the second recording data.

[0007] An audio data transmission device is applied to a first earpiece of an earphone assembly, the earphone assembly further comprising a second earpiece. The device includes: a first receiving module for receiving first recording data sent by the second earpiece when the first earpiece switches from a slave earpiece to a master earpiece; a data acquisition module for acquiring third recording data based on the first recording data when the first recording data is out of sync with second recording data buffered by the first earpiece, the third recording data being audio data corresponding to the out-of-sync portion of the first recording data relative to the second recording data; and a data synthesis module for generating synthesized recording data based on the first recording data, the second recording data, and the third recording data.

[0008] A first earphone includes a memory and a processor. The memory stores a computer program. When the computer program is executed by the processor, the processor performs the following steps: when the first earphone switches from a slave earphone to a master earphone, it receives first recording data sent by a second earphone; if the first recording data is out of sync with second recording data buffered by the first earphone, it obtains third recording data based on the first recording data, the third recording data being the audio data corresponding to the out-of-sync portion of the first recording data relative to the second recording data; and it generates synthesized recording data based on the first recording data, the second recording data, and the third recording data.

[0009] A second earphone includes a memory and a processor. The memory stores a computer program. When the computer program is executed by the processor, the processor performs the following steps: when the second earphone is switched from a master earphone to a slave earphone, it sends first recording data and slave ear recording data to a first earphone; wherein, the first recording data is audio data recorded by the second earphone, and the slave ear recording data is audio data recorded and sent to the second earphone when the first recording data is not synchronized with the second recording data buffered in the first earphone; the first earphone is used to obtain third recording data based on the first recording data when the first recording data is not synchronized with the second recording data buffered in the first earphone, and generate synthesized recording data based on the first recording data, the second recording data, and the third recording data; the third recording data is the audio data corresponding to the asynchronous portion of the first recording data relative to the second recording data.

[0010] A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the method described above.

[0011] An earphone assembly includes a first earphone and a second earphone using the audio data transmission method described above.

[0012] In the aforementioned audio data transmission method, device, earphone, earphone group, and medium, when a master-slave switch occurs between the first and second earphones, the first earphone, which becomes the master earphone, receives the first recording data sent by the second earphone. If the first recording data is out of sync with the second recording data buffered by the first earphone, then the third recording data is obtained based on the first recording data. The third recording data is the audio data corresponding to the out-of-sync portion of the first recording data relative to the second recording data. Synthesized recording data is generated based on the first, second, and third recording data. The synthesized recording data is the binaural recording data that needs to be sent to the terminal device, enabling the earphones to support binaural stereo recording and ensuring that no data loss occurs when the earphones switch master and slave, thus guaranteeing the recording effect. Attached Figure Description

[0013] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0014] Figure 1 This is an application environment diagram of an audio data transmission method in one embodiment;

[0015] Figure 2 This is a flowchart of an audio data transmission method in one embodiment;

[0016] Figure 3 This is a flowchart of the step of obtaining third recording data based on first recording data in one embodiment;

[0017] Figure 4 This is a schematic diagram of the recording data transmission of the headphone group before a master-slave switch occurs in one embodiment.

[0018] Figure 5 This is a schematic diagram of the recording data transmission of the headphone group after a master-slave switch in one embodiment.

[0019] Figure 6 This is a flowchart of the step of obtaining third recording data based on first recording data in another embodiment;

[0020] Figure 7This is a schematic diagram of the recording data transmission of the headphone group before the master-slave switch occurs in another embodiment;

[0021] Figure 8 This is a schematic diagram of the recording data transmission of the headphone group after a master-slave switch occurs in another embodiment;

[0022] Figure 9 This is a structural block diagram of an audio data transmission device in one embodiment;

[0023] Figure 10 This is a schematic diagram of the internal structure of the first or second earphone in one embodiment;

[0024] Figure 11 This is a schematic diagram of the headphone assembly in one embodiment. Detailed Implementation

[0025] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0026] It is understood that the terms "first," "second," etc., used in this application may be used herein to describe various technical features, but these technical features are not limited by these terms. These terms are only used to distinguish one technical feature from another. For example, without departing from the scope of this application, the first earphone may be referred to as the second earphone, and similarly, the second earphone may be referred to as the first earphone. Both the first earphone and the second earphone are one (or a group of) earphones in an earphone set, but they are not the same earphone.

[0027] Figure 1 This is a schematic diagram illustrating the application environment of an audio data transmission method in one embodiment. For example... Figure 1As shown, the application environment includes a terminal device 101 and an earphone group 102. The earphone group 102 includes a first earphone 1021 and a second earphone 1022. The terminal device 101 communicates with the master earphone in the earphone group 102, and the master earphone communicates with the slave earphone. Specifically, the master earphone establishes a communication connection with the terminal device 101, and the slave earphone establishes a communication connection with the master earphone, monitoring the communication connection between the master earphone and the terminal device 101. When the terminal device 101 needs to send data to the earphone group 102, it sends the data to the master earphone, which then forwards the data to the slave earphone. Similarly, when the slave earphone needs to send data to the terminal device, it sends the data to the master earphone, which then forwards it to the terminal device 101. One of the first earphone 1021 and the second earphone 1022 acts as the master earphone, and the other as the slave earphone; they switch between each other when the master-slave switching conditions are met. Specifically, if the second earphone 1022 is the master earphone, then the first earphone 1021 is the slave earphone. When the master-slave switching condition is met, the first earphone 1021 switches to the master earphone, and the second earphone 1022 switches to the slave earphone.

[0028] The terminal device 101 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart TVs, smart in-vehicle devices, etc. Portable wearable devices can include smartwatches, smart bracelets, head-mounted devices, etc. The earphone set is a true wireless stereo headset (TWS earphone) or other types of Bluetooth earphones.

[0029] When the headphone group is recording stereo audio, after successfully establishing a communication connection with the terminal device 101, the headphone group 102 executes the recording action in response to the start recording command sent by the terminal device 101. The headphone group 102 has a first headphone and a second headphone, which are the master headphone and the slave headphone, respectively. For example, if the first headphone is the master headphone, then the second headphone is the slave headphone. The master headphone and the slave headphone respectively collect audio data through their respective microphones and encode the collected audio data. The slave headphone stores the encoded slave recording data packet in the buffer and sends the slave recording data packet to the master headphone through the communication connection established with the master headphone. The master headphone encodes the audio data collected by its microphone to generate the master recording data packet and stores the master recording data packet in its local buffer. The master headphone receives the slave recording data packet sent by the slave headphone and stores the slave recording data packet in the slave buffer. The slave earphone can send slave recording data packets to the master earphone according to a preset period; it can also send slave recording data packets to the master earphone upon receiving an instruction from the master earphone. In some embodiments, the slave earphone can send data to the master earphone once after generating a slave recording data packet; in another embodiment, the slave earphone can send slave recording data packets to the master earphone when the number of slave recording data packets in the buffer reaches a preset value. When uplink transmission is initiated, the master earphone retrieves the master recording data packet from its local buffer and sequentially retrieves slave recording data packets from the slave buffer and compares them synchronously. If the master recording data packet and slave recording data packet are synchronized, they are merged into a binaural data packet, which is then sent to the terminal device through the communication connection with the terminal device.

[0030] When using the microphones on each of the two earpieces in an earphone set for audio recording, binaural recording can be achieved. However, during recording, the primary earpiece consumes more power because it is responsible for both data transmission with the phone and sending the audio data recorded by the secondary earpiece back to the phone. When there is a significant difference in battery levels between the primary and secondary earpieces, a master-slave switch is required. Specifically, when the primary earpiece's battery is low, a master-slave switch may occur, turning the primary earpiece into the secondary earpiece, and vice versa. In some cases, removing the primary earpiece can also trigger a master-slave switch. In one embodiment, a poor communication signal between the primary earpiece and the terminal device may also trigger a master-slave switch. During a master-slave switch, data loss may occur in the earphone set performing binaural recording.

[0031] To prevent data loss, this application provides an audio data transmission method. Figure 2 This is a flowchart of an audio data transmission method in one embodiment. The audio data transmission method in this embodiment is designed to run on... Figure 1 The description will be based on the first earphone 1021 in the example. Figure 2 As shown, the audio data transmission method includes steps 201 to 203.

[0032] Step 201: When the first earphone switches from a slave earphone to a master earphone, the first recording data sent by the second earphone is received.

[0033] The first recording data is audio data recorded by the second earphone, including audio data recorded by the second earphone before switching to earphone mode and not sent to the terminal device, and / or audio data recorded by the second earphone after switching to earphone mode.

[0034] Step 202: If the first recording data is not synchronized with the second recording data cached in the first earphone, then obtain the third recording data based on the first recording data.

[0035] The third recording data refers to the audio data corresponding to the asynchronous portion of the first recording data relative to the second recording data. The second recording data is the audio data recorded by the first earphone but not yet sent to the terminal device. Optionally, the second recording data may also include audio data recorded by the first earphone after switching to the main earphone but not yet sent to the terminal device; in some embodiments, the second recording data may also include audio data recorded by the first earphone before switching to the main earphone but not yet sent to the original main earphone (i.e., the second earphone). Before the master-slave switch occurs, the first earphone, acting as the slave earphone, records audio data and sends it to the second earphone, which is acting as the master earphone. The portion of this audio data that has not yet been sent to the terminal device is the third recording data.

[0036] If the first recording data includes audio data recorded by the second earphone before it switched to the slave earphone, the first and second recording data may become out of sync. This is because the audio data recorded by the first earphone before it switched to the master earphone has already been sent to the second earphone (which is now the master earphone) and deleted from the first earphone's local buffer. When a master-slave switch occurs, the original second earphone becomes the slave earphone, meaning the audio data forwarded from the original first earphone (formerly the slave earphone) to the second earphone may not have been sent to the terminal device in time (for example, when the signal between the terminal device and the second earphone is poor or the interference signal is too strong, a data packet may need to be retransmitted multiple times to be successfully sent). After the master-slave switch, the second earphone sends its recorded audio data to the first earphone (now the master earphone), and this data is relatively complete. However, the first earphone's local buffer no longer contains the audio data recorded before it switched to the master earphone, so the audio data before the master-slave switch is out of sync, resulting in data loss. At this point, it is necessary to retrieve the missing third recording data. The third recording data is synchronized with the audio data recorded by the second earphone before switching to the earphone and not sent to the terminal device. The third recording data is retrieved based on the first recording data.

[0037] Optionally, to determine whether the first and second recording data are synchronized, the first synchronization information of the first recording data can be compared with the second synchronization information of the second recording data. It can be understood that the first synchronization information is the identification information added by the second earphone to the recorded audio data, and the second synchronization information is the identification information added by the first earphone to the recorded audio data.

[0038] For example, the first synchronization information and the second synchronization information may be timestamp information used to identify time frames, or sequence number information used to identify the recording order, or other data identification information.

[0039] If the first synchronization information and the second synchronization information do not match, the first and second recorded data are determined to be out of sync. If the first and second synchronization information match, the first and second recorded data are determined to be synchronized. Determining whether the first and second recorded data match by comparing synchronization information is a simple and easy-to-execute process.

[0040] In one embodiment, the first synchronization information and the second synchronization information are added before the audio data is encoded. In this embodiment, the first earphone needs to decode the received first recording data, obtain the first synchronization information, compare it with the second synchronization information, and then encode the synchronized first recording data, second recording data, and / or third recording data to generate a binaural data packet.

[0041] In one embodiment, the first synchronization information and the second synchronization information are added after the audio data is encoded. In this embodiment, the first earphone can directly compare the received encoded first recording data, second recording data, or third recording data with the synchronization information. If the comparison is synchronized, it generates synthetic recording data for transmission, reducing the data processing process of the first earphone and improving data transmission efficiency. In one embodiment, the synchronization comparison can be performed by comparing the recording time of the audio data. Data (data packets) with the same recording time are synchronized data (or data packets); or the first earphone and the second earphone use the same data recording mechanism, and the audio recorded in the same time period is identified with the same sequence number, and the synchronization comparison is performed by the sequence number. Step 203: Generate synthetic recording data based on the first recording data, the second recording data, and the third recording data.

[0042] The synthesized recording data includes audio data recorded by the first earphone and the second earphone over a period of time; the synthesized recording data can be sent to the terminal device.

[0043] It is understood that audio data recorded by both ears and compared to be synchronized can be synthesized and sent to the terminal device. In this embodiment, synthesized audio data can be generated based on the first recording data, the second recording data, and the third recording data. Optionally, the first earphone first synthesizes the first earphone data, which includes the third recording data recorded by the first earphone before the master-slave switch and the second recording data recorded after the master-slave switch. The third recording data and the second recording data are sequential in time, and the second recording data and the third recording data can be spliced ​​together according to the time order to synthesize the first earphone data. On this basis, the first earphone data and the first recording data are then synthesized into binaural recording data. The first recording data is the audio data recorded by the second earphone, thereby realizing the synchronization of the recording data of the two earphones. When the synchronization is successful, the data of the master earphone and the data of the slave earphone are merged and packaged into one data packet, and then sent to the terminal device through wireless communication (such as Bluetooth communication, ZigBee communication, etc.).

[0044] In one embodiment, synchronized audio data recorded by both ears can be combined and sent to a terminal device. Upon initiating uplink transmission, the earliest recorded audio data from the first recording data and the earliest recorded audio data from the second recording data are read. The synchronization information of the two data sets is compared. If they match, they are combined into a composite recording data set and sent to the terminal device. If they do not match, a third recording data set synchronized with the first recording data is obtained, and the two data sets are combined into a composite recording data set and sent to the terminal device.

[0045] Since the first earphone is the main earphone at this time, it establishes a communication connection with the terminal device and sends the synthesized recording data to the terminal.

[0046] In one embodiment, audio data successfully sent to the terminal device will be released from the cache.

[0047] In this embodiment, the audio data transmission method involves a master-slave switch between the first and second earphones. The first earphone, now the master earphone, receives the first recording data sent by the second earphone. If the first recording data is out of sync with the second recording data buffered by the first earphone, third recording data is obtained based on the first recording data. The third recording data corresponds to the audio data corresponding to the out-of-sync portion of the first recording data relative to the second recording data. Synthesized recording data is generated based on the first, second, and third recording data. This avoids the loss of audio data recorded when the first earphone is the slave earphone, ensuring the integrity of the recording data and preventing data loss due to master-slave switching from affecting the recording quality. Furthermore, compared to balanced stereo recording headphones that use single-ear recording to directly superimpose single-ear recording data as binaural data, this embodiment uses true stereo recording achieved by two (or two sets of) earphones recording separately, which can represent a realistic spatial sound field and improve sound quality.

[0048] To ensure the integrity of the recorded audio data, if the first and second recordings are out of sync, it is necessary to retrieve the missing recordings. For example... Figure 3 As shown, in one embodiment, obtaining third recording data based on first recording data includes:

[0049] Step 301: Synchronize and compare the first recording data with the audio data in the backup area of ​​the first earphone.

[0050] The backup area is used to back up audio data recorded by the first earphone and sent to the second earphone when the first earphone is used as an earphone.

[0051] In one embodiment, when the first earpiece acts as the slave earpiece, each time data is sent to the second earpiece, this data is backed up to the backup area and cleared from the main buffer. Sending data to the second earpiece can be done by sending and backing up data after a set of data is recorded; or it can be done by periodically sending all data in the main buffer of the first earpiece that has not yet been sent to the second earpiece according to a preset sending cycle, and then backing it up; in some embodiments, data can also be sent to the second earpiece and backed up when a preset amount of data is accumulated.

[0052] Step 302: Extract the third recording data that is synchronized with the first recording data from the backup area.

[0053] Based on the same / similar comparison principle and method for the first and second synchronization information, a third recording data with matching third synchronization information can be found according to the first synchronization information of the first recording data. This is achieved by comparing the first synchronization information with the synchronization identifier information of the data to be compared. If a match is found, it is identified as the third recording data. The third synchronization information is the identifier information added to the recorded audio data when the first earphone is used as the receiver. The third recording data synchronized with the first recording data is found through synchronization comparison, and the third recording data is restored from the backup area.

[0054] In one embodiment, the first synchronization information, the second synchronization information, and the third synchronization information can be timestamps or sequence numbers.

[0055] Taking the serial number as an example, the recording data of the first earphone is added to the serial number B1, B2, B3... in the recording order and cached in the main buffer area of ​​the first earphone; the recording data of the second earphone is added to the serial number A1, A2, A3... in the recording order and cached in the main buffer area of ​​the second earphone.

[0056] refer to Figure 4 As shown, when the first earpiece acts as the slave earpiece, if transmission is initiated, data is sent sequentially to the second earpiece (which is the master earpiece) according to the recording order. The second earpiece stores the received data (e.g., data with sequence number B2) in the slave buffer. Simultaneously, the first earpiece backs up the successfully transmitted data to the backup area and clears the data from the main buffer.

[0057] refer to Figure 5 As shown, when the first earpiece switches to the master earpiece, the second earpiece switches to the slave earpiece. The second earpiece sends the first recording data from its main buffer to the first earpiece in the recording order, and the first earpiece stores the received first recording data in its slave buffer. When uplink transmission is initiated, the first earpiece reads the second recording data from the main buffer and the first recording data from the slave buffer, comparing the sequence numbers of the read second recording data. If they match (e.g., A1 and B1 are matching sequence numbers), it is determined to be synchronized data, and the synchronized data is merged into a composite recording data and sent to the terminal device. If the sequence numbers of the second recording data and the first recording data do not match, that is, at least some of the first recording data is not synchronized with the data in the main buffer of the first earpiece, then data loss is considered to have occurred, and the missing data needs to be retrieved. The first earpiece reads recording data (e.g., B2) from the backup buffer and compares its sequence number with the first recording data (A2). If they match, the matched recording data is merged with the first recording data into a composite recording data.

[0058] Understandably, the first earphone's storage space has a main buffer and a secondary buffer. The main buffer of the first earphone is used to buffer the second recording data, and the secondary buffer of the first earphone is used to buffer the audio data sent by the second earphone (e.g., receiving the first recording data sent by the second earphone when the first earphone switches to the main earphone). The second earphone's storage space also has a main buffer and a secondary buffer. The main buffer of the second earphone is used to buffer the first recording data, and the secondary buffer of the second earphone is used to buffer the secondary recording data sent by the first earphone.

[0059] The slave buffer of the first earphone mentioned in this embodiment can be newly added after a master-slave switch, or it can exist from the beginning. The second earphone can add a backup buffer when switching to a slave earphone, or it can have a backup buffer from the beginning. The master buffer, slave buffer, and backup buffer in the first and second earphones can be virtual partitions implemented in software, or physical storage implemented in hardware.

[0060] Since wireless earphones have limited memory, if backup data is not released, it will affect their normal use. In one embodiment of this application, when the first earphone is used as a slave earphone, the data in the backup area is released according to a preset rule. The preset rule for release can be set, and the backup data is released when the release condition is met.

[0061] In one embodiment, the preset rule could be setting a memory threshold; when the memory of the first earphone falls below the threshold, the audio data in the backup area is released. In another embodiment, the data can be released sequentially according to the order in which it was stored, with the earliest stored data released first. For example, if data a1 is stored at time t and data a2 is stored at time t+1, when the memory is below the threshold, data a1 is released first. After releasing data a1, if the memory is still below the threshold, then data a2 is released next.

[0062] In one embodiment, the preset rule can also be to release data sequentially according to the data's storage order based on a preset period. That is, the preset period is T, and a portion of the data is released every T time interval according to the data's storage order. For example, data a1 is stored at time t, data a2 is stored at time t+1, data a1 is released after a T time interval, and then data a2 is released after another T time interval.

[0063] In one embodiment, a preset rule can be formed by combining a preset period and a memory threshold. Optionally, data can be released according to the preset period. When releasing data, the amount of data to be released is determined based on the remaining amount of memory. For example, data a1 is stored at time t, data a2 is stored at time t+1, and data a1 is released after an interval of time T. If the memory is higher than the threshold after releasing data a1, the release stops until the next time T is used to release data a2. If the memory is still lower than the threshold after releasing data a1, the release of data continues until the memory is not lower than the threshold.

[0064] Optionally, data in the backup area can also be released based on the data transmission records of the second earpiece. This means that the data transmission records document the data transmitted by the second earpiece when it is acting as the primary earpiece. The second earpiece can send a data transmission record back to the first earpiece after each set of data transmissions is completed, or it can periodically send such records. Based on the data transmission records, the first earpiece can determine that the data corresponding to the backup audio data in the backup area has been transmitted to the terminal device via the second earpiece, and then release this data from the backup area.

[0065] In this embodiment, the first earphone acquires data transmission records and releases the data that has been transmitted in the backup area according to the data transmission records, thereby reducing the memory occupation of the backup data and ensuring that the untransmitted data is still backed up. In the event of a master-slave switch, the untransmitted data can be recovered, ensuring the integrity of the audio data.

[0066] like Figure 6 As shown, in one embodiment, obtaining third recording data based on first recording data includes:

[0067] Step 601: The first earphone receives the recording data sent by the second earphone.

[0068] The recording data can be audio data received by the first earphone when the second earphone is used as the main earphone, and data that the second earphone has not yet sent to the terminal device.

[0069] Step 602: Synchronously compare the first recording data with the second recording data, and obtain the third recording data synchronized with the first recording data from the second recording data.

[0070] For example, taking the use of serial numbers for synchronous comparison as an example, the first earphone adds serial numbers B1, B2, B3... to the recorded audio data in the recording order and caches it in the main buffer area of ​​the first earphone; the second earphone adds serial numbers A1, A2, A3... to the recorded audio data in the recording order and caches it in the main buffer area of ​​the second earphone.

[0071] refer to Figure 7 As shown, when the first earpiece acts as the slave earpiece, if transmission is initiated, data is sent sequentially to the second earpiece (which is the master earpiece) according to the recording order. The second earpiece stores the received slave recording data (e.g., data with sequence numbers B1 and B2) in its slave buffer. Simultaneously, the first earpiece clears the successfully transmitted data from its main buffer.

[0072] refer to Figure 8As shown, when the first earpiece switches to the master earpiece, the second earpiece switches to the slave earpiece. The second earpiece sends the first recording data from the main buffer and the slave recording data from the slave buffer to the first earpiece. The first earpiece stores the received first and slave recording data into the slave buffer (two slave buffers can be set up, one for caching the first recording data and the other for caching the slave recording data). It can be understood that the slave recording data can be obtained from the second earpiece only after the first earpiece determines that there is a desynchronization between the first and second recording data; or it can be sent by the second earpiece along with the first recording data. When uplink transmission is initiated, the first earpiece reads the second recording data from the main buffer and the first recording data from the slave buffer, comparing their sequence numbers. If they match (e.g., A1 and B1 are matching sequence numbers), the data is considered synchronized, and the synchronized data is merged into a composite recording data and sent to the terminal device. If the sequence numbers of the second and first recording data do not match, meaning that at least some of the first recording data is not synchronized with the data in the first earpiece's main buffer, data loss is considered to have occurred, and the missing data needs to be retrieved. The first earpiece reads the secondary recording data (e.g., B1) and compares its serial number with the first recording data (A1). If they match, the secondary recording data is identified as the correct third recording data, and the third recording data is merged with the first recording data to form a composite recording data. In this embodiment, during a master-slave switch, the second earpiece, acting as the original master earpiece, sends both the secondary recording data not yet sent to the terminal device and the first recording data to the first earpiece. The first earpiece synchronously compares the first recording data with the secondary recording data and retrieves the third recording data synchronized with the first recording data from the secondary recording data. This embodiment saves memory on the secondary earpiece and ensures no data loss occurs during a master-slave switch.

[0073] This application embodiment also provides an audio data transmission method, which is described using an earphone group as an example. The earphone group includes a first earphone and a second earphone. The method includes:

[0074] When the second earpiece is switched from the master earpiece to the slave earpiece, the first recording data and the slave recording data are sent to the first earpiece;

[0075] Among them, the first recording data is the audio data recorded by the second earphone, and the ear-receiving recording data is the audio data recorded by the first earphone and sent to the second earphone when the first earphone is used as an earphone;

[0076] The first earphone is used to obtain third recording data based on the first recording data when the first recording data is out of sync with the second recording data buffered in the first earphone, and to generate synthesized recording data based on the first recording data, the second recording data and the third recording data; the third recording data is the audio data corresponding to the out-of-sync portion of the first recording data relative to the second recording data.

[0077] In this embodiment, when the second earphone switches from the master earphone to the slave earphone, there may be audio data that has not yet been sent to the terminal. At this time, the second earphone sends its own recorded first audio data that has not yet been sent to the terminal to the first earphone, and sends back the second audio data that the first earphone sent to the second earphone when it was acting as the slave earphone. This allows the first earphone to obtain the third audio data from the second audio data based on the first audio data when the first audio data and the second audio data are out of sync, and to generate synthesized audio data based on the first audio data, the second audio data and the third audio data and send it to the terminal device, thus avoiding data loss due to the master-slave switch between the first earphone and the second earphone.

[0078] This application embodiment also provides an audio data transmission method, applied to an earphone group consisting of a first earphone and a second earphone, including:

[0079] When the first earphone switches from being a slave earphone to a master earphone, the second earphone sends the first recording data to the first earphone.

[0080] When the first earphone is out of sync with the first recording data and the second recording data buffered in the first earphone, it obtains the third recording data based on the first recording data.

[0081] The first earphone generates synthesized recording data based on the first recording data, the second recording data, and the third recording data.

[0082] The third recording data is the audio data corresponding to the asynchronous portion of the first recording data relative to the second recording data. The second recording data is the audio data recorded by the first earphone but not yet sent to the terminal device. Specifically, the second recording data may include audio data recorded by the first earphone after switching to the main earphone but not yet sent to the terminal device; in some embodiments, the second recording data may also include audio data recorded by the first earphone before switching to the main earphone but not yet sent to the original main earphone (i.e., the second earphone). The synthesized recording data includes audio data recorded by the first earphone and the second earphone over a period of time; the synthesized recording data is used to send to the terminal device.

[0083] Before the master-slave switch occurs, the first earphone, acting as the slave earphone, records audio data and sends it to the second earphone, which acts as the master earphone. The portion of this audio data that has not yet been sent to the terminal device is the third recording data. If the first recording data includes audio data recorded by the second earphone before it switched to slave mode, the first and second recording data are out of sync. In this case, it is necessary to retrieve the missing third recording data. The third recording data is synchronized with the audio data recorded by the second earphone before it switched to slave mode and not yet sent to the terminal device. The third recording data is retrieved based on the first recording data. Since the first earphone is the master earphone at this time, a communication connection is established between the first earphone and the terminal device, and the synthesized recording data is sent to the terminal device through the first earphone. In one embodiment, data successfully sent to the terminal device is released from the cache.

[0084] It should be understood that while the steps in the flowcharts corresponding to the above embodiments are shown sequentially as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in each flowchart may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least a portion of the sub-steps or stages of other steps.

[0085] like Figure 9 As shown, this application also provides an audio data transmission device 900, applied to a first earphone in an earphone group, the earphone group further including a second earphone, the device comprising:

[0086] The first receiving module 901 is used to receive the first recording data sent by the second earphone when the first earphone is switched from the slave earphone to the master earphone;

[0087] The data acquisition module 902 is used to acquire third recording data based on the first recording data when the first recording data is out of sync with the second recording data buffered by the first earphone. The third recording data is the audio data corresponding to the out-of-sync portion of the first recording data relative to the second recording data.

[0088] The data synthesis module 903 is used to generate synthesized recording data based on the first recording data, the second recording data, and the third recording data.

[0089] In one embodiment, the data acquisition module includes:

[0090] The synchronization unit is used to synchronize and compare the first recording data with the audio data in the backup area of ​​the first earphone; the backup area is used to back up and store the audio data recorded by the first earphone and sent to the second earphone when it is used as an earphone.

[0091] The backup and recovery unit is used to extract the third recording data that is synchronized with the first recording data from the backup area.

[0092] In one embodiment, the data acquisition module includes:

[0093] The recording data acquisition unit is used to acquire the recording data sent by the second earphone; the recording data is the audio data recorded by the first earphone received when the second earphone is used as the main earphone;

[0094] The data extraction unit is used to synchronously compare the first recording data with the second recording data, and to obtain the third recording data that is synchronized with the first recording data from the second recording data.

[0095] In one embodiment, the audio data transmission device further includes:

[0096] The synchronization module is used to compare the first synchronization information of the first recording data with the second synchronization information of the second recording data; the first synchronization information is the identification information added by the second earphone to the recorded audio data; the second synchronization information is the identification information added by the first earphone to the recorded audio data.

[0097] The determination module is used to determine that the first recording data and the second recording data are out of sync when the first synchronization information and the second synchronization information do not match.

[0098] In one embodiment, the audio data transmission device further includes:

[0099] The sending module is used to synthesize recording data and send it to the terminal device.

[0100] The division of the various modules in the above-described audio data transmission device is merely illustrative. In other embodiments, the audio data transmission device may be divided into different modules as needed to complete all or part of the functions of the above-described audio data transmission device.

[0101] For specific limitations regarding the audio data transmission device, please refer to the limitations on the audio data transmission method above, which will not be repeated here. Each module in the aforementioned audio data transmission device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in hardware or independently of the processor in the computer device, or stored in software in the memory of the computer device, so that the processor can call and execute the operations corresponding to each module.

[0102] Figure 10This is a schematic diagram of the internal structure of an earphone in one embodiment. The earphone can be a first earphone or a second earphone. The earphone includes a processor and a memory connected via a system bus. The processor may include one or more processing units. The processor may be a CPU (Central Processing Unit) or a DSP (Digital Signal Processor), etc. The memory may include a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system and a computer program. The computer program can be executed by the processor to implement an audio data transmission method provided in the following embodiments. The internal memory provides a cached runtime environment for the operating system computer program in the non-volatile storage medium.

[0103] The various modules in the audio data transmission device provided in this application embodiment can be implemented in the form of a computer program. This computer program can run on headphones. The program modules constituted by this computer program can be stored in the memory of an electronic device. When the computer program is executed by a processor, it implements the steps of the method described in this application embodiment.

[0104] This application also provides a computer-readable storage medium. One or more non-volatile computer-readable storage media containing computer-executable instructions, which, when executed by one or more processors, cause the processors to perform the steps of the above-described audio data transmission method.

[0105] This application also provides a computer program product containing instructions that, when run on a computer, cause the computer to execute the above-described audio data transmission method.

[0106] Any references to memory, storage, databases, or other media used in this application may include non-volatile and / or volatile memory. Non-volatile memory may include ROM (Read-Only Memory), PROM (Programmable Read-Only Memory), EPROM (Erasable Programmable Read-Only Memory), EEPROM (Electrically Erasable Programmable Read-Only Memory), or flash memory. Volatile memory may include RAM (Random Access Memory), which is used as external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as SRAM (Static Random Access Memory), DRAM (Dynamic Random Access Memory), SDRAM (Synchronous Dynamic Random Access Memory), Double Data Rate DDR SDRAM (Double Data Rate Synchronous Dynamic Random Access Memory), ESDRAM (Enhanced Synchronous Dynamic Random Access Memory), SLDRAM (Sync Link Dynamic Random Access Memory), RDRAM (Rambus Dynamic Random Access Memory), and DRDRAM (Direct Rambus Dynamic Random Access Memory).

[0107] like Figure 11 As shown in the embodiments of this application, an earphone assembly is also provided, including a first earphone and a second earphone as described in the above embodiments.

[0108] The headphone group can interact with the terminal device through one (or a set of) headphones acting as the master headphones, while the other (or a set of) headphones acts as the slave headphones, interacting with the terminal device through the master headphones, thereby achieving audio data transmission. In the embodiments of this application, the headphone group uses two (or two sets of) headphones to record audio separately. The slave headphones send the recorded audio data to the master headphones. After synchronization comparison, the master headphones package the synchronized data and send it to the terminal, achieving true stereo recording. In addition, after a master-slave switch occurs in the headphone group, the master headphones obtain the audio data that the slave headphones had not yet sent to the terminal when they were the original master headphones, process the audio data, and then send it to the terminal, avoiding data loss due to the master-slave switch and ensuring data integrity.

[0109] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.

Claims

1. An audio data transmission method, characterized by, The method includes applying a first earphone to an earphone assembly, the earphone assembly further including a second earphone, the method comprising: When the first earphone switches from being a slave earphone to a master earphone, it receives the first recording data sent by the second earphone. If the first recording data is out of sync with the second recording data buffered by the first earphone, then the third recording data is obtained based on the first recording data. The third recording data is the audio data corresponding to the out-of-sync portion of the first recording data relative to the second recording data. Synthetic recording data is generated based on the first recording data, the second recording data, and the third recording data; The first earphone has a backup area and a main buffer area. The backup area is used to back up the audio data recorded and sent to the second earphone when the first earphone is acting as a slave earphone. The main buffer area of ​​the first earphone is used to buffer the second recording data. When the first earphone is acting as a slave earphone, it backs up the audio data that has been sent to the backup area and deletes it from the main buffer area each time it finishes sending audio data to the second earphone. The step of obtaining the third recording data based on the first recording data includes: The first recording data is compared synchronously with the audio data in the backup area; Extract the third recording data that is synchronized with the first recording data from the backup area.

2. The audio data transmission method of claim 1, wherein, The method further includes: Release the audio data in the backup area when the memory of the first earphone falls below a threshold; or Release the data sequentially according to the preset period and the order in which the audio data is stored in the backup area; or Obtain the data transmission record of the second earphone; Based on the data transmission record, determine the audio data that has been sent to the terminal device in the backup area and release the data.

3. The audio data transmission method of claim 1, wherein, The method further includes: The first synchronization information of the first recording data is compared with the second synchronization information of the second recording data; the first synchronization information is the identification information added by the second earphone to the recorded audio data; the second synchronization information is the identification information added by the first earphone to the recorded audio data. If the first synchronization information does not match the second synchronization information, then it is determined that the first recording data and the second recording data are out of sync.

4. The audio data transmission method of claim 1, wherein, The step of synchronizing and comparing the first recording data with the audio data in the backup area, and extracting the third recording data synchronized with the first recording data in the backup area, includes: The first synchronization information of the first recording data is compared with the third synchronization information of each audio data in the backup area; the first synchronization information is the identification information added by the second earphone to the recorded audio data; the third synchronization information is the identification information added by the first earphone to the recorded audio data. If the first synchronization information matches the third synchronization information, then audio data with third synchronization information synchronized with the first synchronization information is extracted from the backup area as the third recording data.

5. The audio data transmission method according to claim 3, characterized in that, The first synchronization information and the second synchronization information are timestamps or sequence numbers.

6. The audio data transmission method according to claim 4, characterized in that, The first synchronization information and the third synchronization information are timestamps or sequence numbers.

7. The audio data transmission method of claim 1, wherein, The step of receiving the first recording data sent by the second earphone when the first earphone switches from a slave earphone to a master earphone includes: When the first earphone is in the master earphone state, the storage space of the first earphone has a main buffer and a secondary buffer. The recorded second recording data is stored in the main buffer of the first earphone, and the received first recording data is stored in the secondary buffer of the first earphone.

8. The audio data transmission method according to claim 7, characterized in that, The storage space of the second earphone has a main cache area, which is used to cache the first recording data.

9. The audio data transmission method according to claim 1, characterized in that, The storage space of the second earphone has a main buffer and a secondary buffer. The main buffer of the second earphone is used to cache the first recording data, and the secondary buffer of the second earphone is used to cache secondary recording data. The recording data is the audio data recorded by the first earphone when the second earphone is used as the main earphone.

10. The audio data transmission method according to any one of claims 1 to 5 or 7 to 9, characterized in that, Also includes: The synthesized audio data is sent to the terminal device.

11. An audio data transmission method, characterized by, A second earpiece is used in an earphone assembly, the earphone assembly further comprising a first earpiece, the method comprising: When the second earphone is switched from the master earphone to the slave earphone. Send the first recording data to the first earphone; Wherein, the first recording data is the audio data recorded by the second earphone; The first earphone is used to obtain third recording data based on the first recording data when the first recording data is out of sync with the second recording data buffered by the first earphone, and to generate synthesized recording data based on the first recording data, the second recording data and the third recording data; the third recording data is the audio data corresponding to the out-of-sync portion of the first recording data relative to the second recording data; The first earphone has a backup area and a main buffer area. The backup area is used to back up the audio data recorded by the first earphone when it is used as a receiver and sent to the second earphone. The main buffer area of ​​the first earphone is used to buffer the second recording data. The first earphone, when acting as a slave earphone, backs up the transmitted audio data to the backup area and deletes it from the main buffer area each time it finishes transmitting audio data to the second earphone; it also performs a synchronization comparison between the first recording data and the audio data in the backup area; and extracts the third recording data synchronized with the first recording data from the backup area.

12. An audio data transmission method, characterized by, Applied to an earphone assembly, the earphone assembly including a first earphone and a second earphone, the method includes: When the first earphone switches from being a slave earphone to a master earphone The second earphone sends the first recording data to the first earphone; the first recording data is the audio data recorded by the second earphone. When the first recording data is out of sync with the second recording data cached by the first earphone, the first earphone obtains the third recording data based on the first recording data, and generates synthesized recording data based on the first recording data, the second recording data, and the third recording data; the third recording data is the audio data corresponding to the out-of-sync portion of the first recording data relative to the second recording data; The first earphone has a backup area and a main buffer area. The backup area is used to back up the audio data recorded by the first earphone when it is used as a receiver and sent to the second earphone. The main buffer area of ​​the first earphone is used to buffer the second recording data. When the first earphone is in the slave earphone state, each time it finishes sending audio data to the second earphone, it backs up the sent audio data to the backup area and deletes it from the main buffer area; it performs a synchronization comparison between the first recording data and the audio data in the backup area; and it extracts the third recording data that is synchronized with the first recording data in the backup area.

13. An audio data transmission apparatus, characterized by comprising: A first earphone used in an earphone assembly, the first earphone having a backup area and a main buffer, the backup area being used to back up audio data recorded by the first earphone as a receiver and sent to a second earphone, the main buffer of the first earphone being used to buffer second recording data; the earphone assembly further includes a second earphone, the device comprising: The first receiving module is used to receive the first recording data sent by the second earphone when the first earphone is switched from a slave earphone to a master earphone; A data acquisition module is used to acquire third recording data based on the first recording data when the first recording data is out of sync with the second recording data buffered by the first earphone. The third recording data is the audio data corresponding to the out-of-sync portion of the first recording data relative to the second recording data. The data acquisition module includes: a synchronization unit, used to synchronize and compare the first recording data with the audio data in the backup area of ​​the first earphone; and a backup and recovery unit, used to extract the third recording data synchronized with the first recording data from the backup area. The first earphone is also used to, when acting as a slave earphone, back up the audio data that has been sent to the second earphone each time it is completed, to the backup area and delete it from the main buffer area; The data synthesis module is used to generate synthesized recording data based on the first recording data, the second recording data, and the third recording data.

14. An earphone comprising a memory and a processor, the memory having stored therein a computer program, characterized in that, When the computer program is executed by the processor, it causes the processor to perform the steps of the audio data transmission method as described in any one of claims 1 to 12.

15. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1 to 12.

16. An earphone assembly, characterized in that, The device includes a first earphone that applies the audio data transmission method as described in any one of claims 1 to 10, and a second earphone that applies the audio data transmission method as described in claim 11.

Citation Information

Patent Citations

  • Recording method and device, wireless earphone and storage medium

    CN113542479A