CN116347319B - Audio data transmission method, device, earphone set and medium - Google Patents

Audio data transmission method, device, earphone set and medium

Info

Publication number
CN116347319B
CN116347319B CN202111583097.XA CN202111583097A CN116347319B CN 116347319 B CN116347319 B CN 116347319B CN 202111583097 A CN202111583097 A CN 202111583097A CN 116347319 B CN116347319 B CN 116347319B
Authority
CN
China
Prior art keywords
earphone
recording data
data
audio data
recording
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
CN202111583097.XA
Other languages
Chinese (zh)
Other versions
CN116347319A (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.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp 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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN202111583097.XA priority Critical patent/CN116347319B/en
Publication of CN116347319A publication Critical patent/CN116347319A/en
Application granted granted Critical
Publication of CN116347319B publication Critical patent/CN116347319B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04SSTEREOPHONIC SYSTEMS 
    • H04S7/00Indicating arrangements; Control arrangements, e.g. balance control
    • H04S7/30Control circuits for electronic adaptation of the sound field
    • H04S7/308Electronic adaptation dependent on speaker or headphone connection
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04RLOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; ELECTRIC HEARING AIDS; PUBLIC ADDRESS SYSTEMS
    • H04R1/00Details of transducers, loudspeakers or microphones
    • H04R1/10Earpieces; Attachments therefor ; Earphones; Monophonic headphones
    • H04R1/1041Mechanical or electronic switches, or control elements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W56/00Synchronisation arrangements
    • H04W56/001Synchronization between nodes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup

Landscapes

  • Engineering & Computer Science (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Physics & Mathematics (AREA)
  • Acoustics & Sound (AREA)
  • Signal Processing For Digital Recording And Reproducing (AREA)

Abstract

本申请提供了一种音频数据传输方法、装置、耳机、耳机组及介质。该音频数据传输方法包括:在第一耳机由从耳机切换为主耳机的情况下,接收第二耳机发送的第一录音数据;若第一录音数据与第一耳机缓存的第二录音数据不同步,则根据第一录音数据获取第三录音数据,第三录音数据为第一录音数据相对于第二录音数据的不同步部分所对应的音频数据;根据第一录音数据、第二录音数据和第三录音数据生成合成录音数据。本申请能够避免发生数据丢失,保证录音效果。

This application provides an audio data transmission method, apparatus, earphone, earphone group, and medium. The audio data transmission method includes: receiving first recording data sent by a second earphone when a first earphone switches from a slave earphone to a master earphone; if the first recording data is out of sync with second recording data buffered by the first earphone, obtaining third recording data based on the first recording data, wherein 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; and generating synthesized recording data based on the first recording data, the second recording data, and the third recording data. This application can avoid data loss and ensure recording quality.

Description

Audio data transmission method, device, earphone set and medium
Technical Field
The present application relates to the field of audio devices, and in particular, to an audio data transmission method, device, earphone set, and medium.
Background
With the rapid development of technology, headphones have been increasingly used. Some headphones with microphones are used to record audio in addition to playing the audio. In order to realize stereo recording, microphones of two earphones can be used for sound receiving recording respectively.
Disclosure of Invention
The embodiment of the application provides an audio data transmission method, an audio data transmission device, a first earphone, a second earphone, an earphone set and a medium, which can avoid data loss and ensure a recording effect.
The audio data transmission method is applied to a first earphone of an earphone set, the earphone set further comprises a second earphone, the method comprises the steps of receiving first recording data sent by the second earphone under the condition that the first earphone is switched from a slave earphone to a master earphone, acquiring third recording data according to the first recording data if the first recording data is not synchronous with second recording data cached by the first earphone, wherein the third recording data is audio data corresponding to an asynchronous part of the first recording data relative to the second recording data, and generating composite recording data according to the first recording data, the second recording data and the third recording data.
The audio data transmission method is applied to a second earphone of an earphone set, the earphone set further comprises a first earphone, the method comprises the steps of sending first recording data and slave ear recording data to the first earphone under the condition that the second earphone is switched from a master earphone to a slave earphone, wherein the first recording data are audio data recorded by the second earphone, the slave ear recording data are audio data recorded by the first earphone and sent to the second earphone when the slave ear recording data are the slave earphone, the first earphone is used for obtaining third recording data according to the first recording data when the first recording data are not synchronous with the second recording data cached by the first earphone, and generating synthetic recording data according to the first recording data, the second recording data and the third recording data, and the third recording data are audio data corresponding to an asynchronous portion of the first recording data relative to the second recording data.
The audio data transmission method is applied to a headset set, the headset set comprises a first headset and a second headset, the second headset sends first recording data to the first headset under the condition that the first headset is switched from a slave headset to a master headset, the first recording data are audio data recorded by the second headset, the first headset obtains third recording data according to the first recording data when the first recording data are not synchronous with the second recording data cached by the first headset, and composite recording data are generated according to the first recording data, the second recording data and the third recording data, and the third recording data are audio data corresponding to an asynchronous part of the first recording data relative to the second recording data.
The audio data transmission device is applied to a first earphone of an earphone set, the earphone set further comprises a second earphone, a first receiving module used for receiving 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 used for acquiring third recording data according to the first recording data when the first recording data are not synchronous with second recording data cached by the first earphone, wherein the third recording data are audio data corresponding to an asynchronous part of the first recording data relative to the second recording data, and a data synthesis module used for generating synthetic recording data according to the first recording data, the second recording data and the third recording data.
A first earphone comprises a memory and a processor, wherein the memory stores a computer program, when the computer program is executed by the processor, the processor receives first recording data sent by a second earphone under the condition that the first earphone is switched from a slave earphone to a master earphone, if the first recording data is not synchronous with second recording data cached by the first earphone, third recording data is obtained according to the first recording data, the third recording data is audio data corresponding to an asynchronous part of the first recording data relative to the second recording data, and composite recording data is generated according to the first recording data, the second recording data and the third recording data.
A second earphone comprises a memory and a processor, wherein the memory stores a computer program, when the computer program is executed by the processor, the processor executes the following steps of sending first recording data and slave ear recording data to the first earphone under the condition that the second earphone is switched from a master earphone to a slave earphone, the first recording data is audio data recorded by the second earphone, the slave earphone is audio data recorded by the first earphone and sent to the second earphone, the first earphone is used for acquiring third recording data according to the first recording data when the first recording data is not synchronous with the second recording data cached by the first earphone, and generating synthesized recording data according to the first recording data, the second recording data and the third recording data, and the third recording data is audio data corresponding to an asynchronous part of the first recording data relative to the second recording data.
A computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of a method as described above.
An earphone set includes a first earphone and a second earphone to which the above-described audio data transmission method is applied.
According to the audio data transmission method, the device, the earphone set and the medium, under the condition that the first earphone and the second earphone are subjected to master-slave switching, the first earphone switched to the master earphone receives the first recording data sent by the second earphone, if the first recording data are not synchronous with the second recording data cached by the first earphone, third recording data are obtained according to the first recording data, the third recording data are the audio data corresponding to the asynchronous part of the first recording data relative to the second recording data, synthetic recording data are generated according to the first recording data, the second recording data and the third recording data, the synthetic recording data are the binaural recording data which need to be sent to the terminal equipment, so that the earphone can support binaural stereo recording, and the situation that the earphone cannot lose data under the condition of master-slave switching can be guaranteed, and recording effect is guaranteed.
Drawings
In order to more clearly illustrate the embodiments of the application or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a diagram of an application environment for a method of audio data transmission in one embodiment;
FIG. 2 is a flow chart of a method of audio data transmission in one embodiment;
FIG. 3 is a flowchart illustrating steps performed in one embodiment to obtain third recording data according to the first recording data;
FIG. 4 is a schematic diagram of a recorded data transmission of a headset before a master-slave switch occurs in one embodiment;
FIG. 5 is a schematic diagram illustrating a recorded data transmission of a headset after a master-slave switch occurs in one embodiment;
FIG. 6 is a flowchart showing steps for obtaining third recording data according to the first recording data in another embodiment;
FIG. 7 is a schematic diagram illustrating a transmission of recorded data from a set of ear-phones before a master-slave switch occurs in another embodiment;
FIG. 8 is a schematic diagram illustrating a transmission of recorded data from a set of ear units after a master-slave switch in another embodiment;
fig. 9 is a block diagram of an audio data transmission apparatus in one embodiment;
FIG. 10 is a schematic diagram of an internal structure of a first earphone or a second earphone according to an embodiment;
Fig. 11 is a schematic diagram of a middle ear unit in one embodiment.
Detailed Description
The present application will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present application more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application.
It is to be understood that the terms "first," "second," and the like, as used herein, may be used 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 technical feature. For example, a first earphone may be referred to as a second earphone, and similarly, a second earphone may be referred to as a first earphone, without departing from the scope of the application. Both the first earpiece and the second earpiece are one (or a group of) earpieces of the set of earpieces, but they are not the same earpiece.
Fig. 1 is a schematic view of an application environment of an audio data transmission method in an embodiment. As shown in fig. 1, the application environment includes a terminal device 101 and a headset set 102, and the headset set 102 includes a first headset 1021 and a second headset 1022. The terminal device 101 communicates with a master earphone in the earphone set 102, and the master earphone communicates with a slave earphone, that is, the master earphone establishes a communication connection with the terminal device 101, the slave earphone establishes a communication connection with the master earphone, and the slave earphone monitors the communication connection between the master earphone and the terminal device 101. When the terminal device 101 needs to send data to the earphone set 102, the terminal device 101 sends the data to the master earphone, and the master earphone sends the data to the slave earphone. Similarly, when the slave earphone needs to transmit data to the terminal device, the data needs to be transmitted to the master earphone, and the master earphone transmits the data to the terminal device 101. One of the first earphone 1021 and the second earphone 1022 is used as a master earphone, the other is a slave earphone, and when the master-slave switching condition is met, the two earphones are switched. Specifically, if the second earphone 1022 is a master earphone, the first earphone 1021 is a slave earphone, and when the master-slave switching condition is satisfied, the first earphone 1021 is switched to the master earphone, and at this time, the second earphone 1022 is switched to the slave earphone.
The terminal device 101 may be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, internet of things devices and portable wearable devices, and the internet of things devices may be smart televisions, smart vehicle devices and the like. The portable wearable device may be a smart watch, smart bracelet, headset, or the like. The earphone set is a truly wireless stereo earphone (TWS earphone) or other type of Bluetooth earphone.
When the earphone set performs stereo recording, after the earphone set 102 successfully establishes a communication connection with the terminal device 101, a recording action is performed in response to a recording start instruction sent by the terminal device 101. The earphone set 102 has a first earphone and a second earphone, which are a master earphone and a slave earphone, respectively, for example, when the first earphone is the master earphone, the second earphone is the slave earphone. The master earphone and the slave earphone respectively acquire audio data through respective microphones and respectively encode the acquired audio data, the slave earphone stores the slave recording data packet generated after encoding into a buffer memory area and sends the slave recording data packet to the master earphone through communication connection established with the master earphone, and the master earphone encodes the audio data acquired by the microphones to generate the master recording data packet and stores the master recording data packet into the local buffer memory area. The master earphone receives the slave recording data packet sent by the slave earphone and stores the slave recording data packet in the slave cache area. The slave earphone can send the slave recording data packet to the master earphone according to a preset period, can send the slave recording data packet to the master earphone when receiving an indication sent by the master earphone, can send data to the master earphone once after each slave recording data packet is generated by the slave earphone in some embodiments, and can send the slave recording data packet to the master earphone when the number of the slave recording data packets in the buffer area reaches a preset value in another embodiment. When the uplink transmission is started, the master earphone acquires a master recording data packet in a local buffer area, sequentially acquires a slave recording data packet and the master recording data packet in a slave buffer area for synchronous comparison, and combines the synchronous master recording data packet and the synchronous slave recording data packet into a double-ear data packet, and transmits the double-ear data packet to the terminal equipment through communication connection with the terminal equipment.
When the microphones respectively arranged in the two earphones of the earphone set are used for audio recording, the effect of binaural recording can be achieved, but in the recording process, the main earphone of the earphone is not only responsible for data transmission with the mobile phone, but also responsible for sending received audio data recorded by the slave earphone to the mobile phone, so that the main earphone consumes more power, when the difference of the electric quantity of the master earphone and the slave earphone is large, master-slave switching is needed, namely, when the electric quantity of the main earphone is low, master-slave switching possibly occurs, namely, the main earphone is switched into the slave earphone, and the slave earphone is switched into the main earphone. In some cases, the user picking off the master earphone will trigger the master-slave switch as well. In one embodiment, if the communication signal between the master earphone and the terminal device is poor, a master-slave switch may be triggered. While in the case of a master-slave switch, data loss may occur in the earphone set where binaural recording is performed.
In order to prevent data loss, the application provides an audio data transmission method. Fig. 2 is a flow chart of a method of audio data transmission in one embodiment. The audio data transmission method in this embodiment is described by taking the first earphone 1021 in fig. 1 as an example. As shown in fig. 2, the audio data transmission method includes steps 201 to 203.
Step 201, in the case that the first earphone is switched from the slave earphone to the master earphone, receiving first recording data sent by the second earphone.
The first recording data is audio data recorded by the second earphone, including audio data recorded by the second earphone before being switched to the slave earphone and not transmitted to the terminal device, and/or audio data recorded by the second earphone after being switched to the slave earphone.
Step 202, if the first recording data is not synchronized with the second recording data cached by the first earphone, obtaining third recording data according to the first recording data.
The third recording data is audio data corresponding to an unsynchronized portion of the first recording data relative to the second recording data. The second recording data is audio data recorded by the first earphone and not yet transmitted 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 and not yet transmitted to the terminal device, and in some embodiments, the second recording data may also include audio data recorded by the first earphone before switching to the main earphone and not transmitted to the original main earphone (i.e., the second earphone). Before the master-slave switching occurs, the first earphone is used as a slave earphone to record audio data and transmit the audio data to the second earphone which is used as a master earphone, and the third recording data is not transmitted to the terminal equipment in the audio data.
If the first recording data includes audio data recorded by the second earphone before switching to the slave earphone, it may happen that the first recording data is not synchronized with the second recording data. The method is characterized in that audio data recorded by a first earphone before being switched to a master earphone is sent to a second earphone serving as the master earphone, the data are deleted in a local buffer area of the first earphone, when master-slave switching of the earphone occurs, the original second earphone becomes a slave earphone, so that audio data forwarded to the second earphone by the original first earphone (the original slave earphone) may not be sent to a terminal device (for example, when the signals of the terminal device and the second earphone are poor or interference signals are too strong, one data packet can be successfully sent after being retransmitted for a plurality of times), after the master-slave switching occurs, the second earphone sends the audio data recorded by the second earphone to the first earphone (the master earphone), the data are complete, and for the audio data recorded by the first earphone before being switched to the master earphone, the local buffer of the first earphone has no related data, so that the audio data before the master-slave switching are not synchronous, and the data are lost. At this time, the missing third recording data needs to be retrieved, the third recording data is synchronized with the audio data which is recorded before the second earphone is switched to the slave earphone and is not sent to the terminal equipment, and the third recording data is retrieved according to the first recording data.
Optionally, whether the first recording data and the second recording data are synchronous or not is judged, and the first synchronous information of the first recording data and the second synchronous information of the second recording data can be compared for determination. It can be understood that the first synchronization information is identification information added to the recorded audio data by the second earphone, and the second synchronization information is identification information added to the recorded audio data by the first earphone.
The first synchronization information and the second synchronization information may be timestamp information for identifying a time frame, serial number information for identifying a recording sequence, or other data identification information.
If the first synchronization information is not matched with the second synchronization information, the first recording data and the second recording data are judged to be not synchronous. And if the first synchronous information is matched with the second synchronous information, judging that the first recording data is synchronous with the second recording data. And whether the first recording data is matched with the second recording data is judged by adopting a synchronous information comparison mode, so that the judging process is simple and easy to execute.
In one embodiment, the first synchronization information and the second synchronization information are added before encoding the audio data. In this embodiment, the first earphone needs to decode the received first recording data, obtain the first synchronization information and compare with the second synchronization information, and encode the synchronized first recording data, second recording data and/or third recording data to generate the binaural data packet.
In one embodiment, the first synchronization information and the second synchronization information are added after encoding the audio data. In this embodiment, the first earphone may directly compare the synchronization information between the received encoded first recording data and the second recording data or the third recording data, and if the comparison is synchronous, the first earphone generates the composite recording data for transmission, so that the data processing process of the first earphone is reduced, and the data transmission efficiency is improved. In one embodiment, the synchronization comparison may be performed by comparing recording times of the audio data, where the data (data packets) at the same recording time are synchronous 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 serial number, and the synchronization comparison is performed by using the serial number. Step 203, generating composite recording data according to the first recording data, the second recording data and the third recording data.
The synthesized recording data comprises audio data recorded by the first earphone and audio data recorded by the second earphone within a period of time, and the synthesized recording data can be used for being sent to the terminal equipment.
It will be appreciated that binaural recorded audio data that is compared to be synchronized may be synthesized for transmission to a terminal device. In the embodiment of the application, the synthetic recording data can be generated according to the first recording data, the second recording data and the third recording data. Optionally, the first earphone synthesizes first earphone data first, and the first earphone data includes the third record data that first earphone recorded before master-slave switching, and the second record data of recording after master-slave switching to third record data has the continuity in time with the second record data, can splice second record data and third record data according to time sequence, synthesizes into first earphone data. On the basis, the first earphone data and the first recording data are synthesized into binaural recording data. The first recording data is the audio data recorded by the second earphone, so that the synchronization of the recording data of the double earphone can be realized. After the synchronization is successful, the data of the master earphone and the data of the slave earphone are combined and packaged into a packet of data, and then the packet of data is sent to the terminal equipment through wireless communication (such as Bluetooth communication, zigBee communication and the like).
In one embodiment, the binaural recorded synchronized audio data may be synthesized for transmission to a terminal device. When the uplink transmission is started, the audio data with the earliest recording sequence in the first recording data are read, the audio data with the earliest recording sequence in the second recording data are read, whether the synchronous information of the two data is matched or not is compared, and if the synchronous information is matched, the synchronous information is synthesized into synthesized recording data, and the synthesized recording data are transmitted to the terminal equipment. If the first record data and the second record data are not matched, third record data synchronous with the first record data are obtained, the two data are synthesized into synthesized record data, and the synthesized record data are sent to the terminal equipment.
Because the first earphone is the main earphone at this moment, so first earphone has communication connection with terminal equipment to send synthetic recording data to the terminal.
In one embodiment, the audio data successfully sent to the terminal device will be released from the buffer.
According to the audio data transmission method, after the first earphone and the second earphone are subjected to master-slave switching, the first earphone switched to the master earphone receives first recording data sent by the second earphone, if the first recording data are not synchronous with second recording data cached by the first earphone, third recording data are obtained according to the first recording data, the third recording data are audio data corresponding to an asynchronous part of the first recording data relative to the second recording data, synthetic recording data are generated according to the first recording data, the second recording data and the third recording data, the audio data recorded when the first earphone is used as a slave earphone are prevented from being lost, the integrity of the recording data is guaranteed, and the recording effect is prevented from being influenced due to the fact that the recording data are lost due to master-slave switching. In addition, compared with the earphone which adopts the balanced stereo recording of single-ear recording, the earphone directly superimposes the single-ear recording data as the double-ear data, and in the embodiment, the true stereo realized by separately recording two (or two groups of) earphones is adopted, so that the true spatial sound field can be represented, and the tone quality is improved.
In order to complete the recorded audio data, when the first recording data and the second recording data are not synchronous, the missing recording data needs to be retrieved. As shown in fig. 3, in one embodiment, obtaining third recording data according to the first recording data includes:
step 301, the first recording data is synchronously compared with the audio data of the backup area of the first earphone.
The backup area is used for backing up the audio data recorded by the first earphone when the first earphone is used as the slave earphone and sent to the second earphone.
In one embodiment, when the first earphone is used as the slave earphone, the data is backed up to the backup area and cleared from the main buffer area every time the data is sent to the second earphone. The data may be sent to the second earphone once after the recording of a group of data is completed, or all the data which is not yet sent to the second earphone in the primary buffer area of the first earphone may be sent periodically according to a preset sending period and backed up, or in some embodiments, the data may be sent to the second earphone once when the accumulated data reaches the preset number and backed up.
Step 302, extracting third recording data synchronized with the first recording data in the backup area.
Based on the same/similar comparison principle and method of the first synchronous information and the second synchronous information, third recording data with matched third synchronous information can be found according to the first synchronous information of the first recording data, the first synchronous information is compared with synchronous identification information of data to be compared, if the first synchronous information is matched with the synchronous identification information of the data to be compared, the third recording data is determined, and the third synchronous information is identification information added to the recorded audio data when the first earphone is used as a slave earphone. And searching third recording data synchronous with the first recording data through synchronous comparison, and recovering the third recording data from the backup area.
In one embodiment, the first synchronization information, the second synchronization information, and the third synchronization information may be time stamps or sequence numbers.
Taking a serial number as an example for illustration, the first earphone sequentially adds serial numbers B1, B2 and B3 according to the recording sequence, and the first earphone is cached to a main cache area of the first earphone, and the second earphone sequentially adds serial numbers A1, A2 and A3 according to the recording sequence, and the second earphone is cached to the main cache area of the second earphone.
Referring to fig. 4, when the first earphone is a slave earphone, if transmission is started, data is sequentially transmitted to the second earphone (the master earphone in this case) in the recording order, and the second earphone stores the received data (for example, data with a sequence number B2) in the slave buffer. And meanwhile, the first earphone backs up the successfully transmitted data to the backup area and clears the data in the main buffer area.
Referring to fig. 5, when the first earphone is switched to the master earphone, the second earphone is switched to the slave earphone at this time, and the second earphone sequentially sends the first recording data in the master buffer area to the first earphone according to the recording sequence, and the first earphone stores the received first recording data in the slave buffer area. When the uplink transmission is started, the first earphone reads the second recording data in the main buffer area, reads the first recording data in the slave buffer area, compares the first recording data with the sequence number of the read second recording data, determines the second recording data to be synchronous data if the second recording data are matched (for example, the sequence numbers of A1 and B1 are matched), and combines the synchronous data into composite recording data to be transmitted to the terminal equipment. If the serial numbers of the second recording data and the first recording data are not matched, namely at least part of the first recording data cannot be synchronized with the data in the first earphone main buffer area, the data is considered to be lost, and the missing data needs to be retrieved. The first earphone reads the recording data (for example, B2) from the backup area and compares the serial numbers with the first recording data (A2), if the recording data are matched with the first recording data, the matched recording data and the first recording data are combined into synthetic recording data.
It can be appreciated that the storage space of the first earphone has a master buffer and a slave buffer, where the master buffer of the first earphone is used to buffer the second recording data, and the slave buffer of the first earphone is used to buffer the audio data sent by the second earphone (e.g. receive the first recording data sent by the second earphone when the first earphone is switched to the master earphone). The storage space of the second earphone is provided with a main buffer area and a secondary buffer area, the main buffer area of the second earphone is used for buffering the first recording data, and the secondary buffer area of the second earphone is used for buffering the secondary recording data sent by the first earphone.
The slave buffer of the first earphone in the embodiment of the present application may be newly added after the master-slave switching occurs, or may exist from beginning to end. When the second earphone is switched to the slave earphone, the backup area can be newly added, or the backup area exists from beginning. The main buffer area, the auxiliary buffer area and the backup area in the first earphone and the second earphone can be virtual partitions realized by software or physical memories realized by hardware.
Because the wireless headset has a smaller memory, normal use will be affected if the backup data is not released all the time, and in one embodiment of the present application, when the first headset is used as the slave headset, and releasing the data in the backup area according to the preset rule, setting the released preset rule, and releasing the backup data when the release condition is reached.
In one embodiment, the preset rule may be to set a threshold of the memory, and release the audio data of the backup area when the memory of the first earphone is lower than the threshold. In one embodiment, the release may be performed sequentially according to the order of data storage, so as to release the data stored first preferentially. Illustratively, data a 1 is stored at time t and data a 2 is stored at time t+1, data a 1 is released first when the memory is below the threshold, and data a 2 is released again after data a 1 is released if the memory is still below the threshold.
In one embodiment, the preset rule may be further sequentially released according to a preset period and the data storage sequence. That is, the preset period is T, and a part of data is released according to the data storage sequence every interval T. Illustratively, data a 1 is stored at time T, data a 2 is stored at time t+1, data a 1 is released at time T, and data a 2 is released at time T.
In one embodiment, the preset period and the threshold value of the memory may be combined together as a preset rule, optionally, the data is released according to the preset period, the amount of data to be released is determined according to the remaining amount of the memory when the data is released, for example, the data a 1 is stored at time T, the data a 2 is stored at time t+1, the data a 1 is released at intervals of T, if the memory is higher than the threshold value after the data a 1 is released, the release is stopped until the data a 2 is released again at the next time T, and if the memory is still lower than the threshold value after the data a 1 is released, the data is continuously released until the memory is not lower than the threshold value.
Optionally, the data in the backup area may also be released based on the data transmission record of the second earpiece. It will be appreciated that the data transmission record records the data record that the second earpiece has completed transmitting when acting as the master earpiece. The second earphone may feed back a data transmission record to the first earphone when the transmission of a group of data is completed, or may feed back a data transmission record to the first earphone periodically. The first earphone can determine that the data corresponding to the backup audio data in the backup area is sent to the terminal equipment through the second earphone according to the data sending record, and the data is released from the backup area.
In this embodiment, the first earphone releases the data that has been sent in the backup area according to the data sending record by obtaining the data sending record, so as to reduce the occupation of the memory by the backup data, and ensure that the data that is not sent still has backup, and when the master-slave switching occurs, the data that is not sent yet can be recovered, so as to ensure the integrity of the audio data.
As shown in fig. 6, in one embodiment, acquiring third recording data according to the first recording data includes:
in step 601, the first earphone acquires slave recording data sent by the second earphone.
The slave recording data may be audio data recorded by the first earphone received when the second earphone is used as the master earphone, and is data which is not transmitted to the terminal device by the second earphone.
Step 602, the first recording data is synchronously compared with the slave recording data, and third recording data synchronous with the first recording data is obtained from the slave recording data.
The method includes the steps of taking a synchronous comparison by using serial numbers as an example, sequentially adding serial numbers B1, B2 and B3 to recorded recording data by a first earphone according to a recording sequence, and buffering the recorded recording data to a main buffer area of the first earphone, and sequentially adding serial numbers A1, A2 and A3 to recorded recording data by a second earphone according to the recording sequence, and buffering the recorded recording data to the main buffer area of the second earphone.
Referring to fig. 7, when the first earphone is a slave earphone, if transmission is started, data is sequentially transmitted to the second earphone (the master earphone in this case) in the recording order, and the second earphone stores the received slave recording data (e.g., data with serial numbers B1 and B2) in the slave buffer. And meanwhile, the first earphone clears the successfully transmitted data from the main buffer area of the first earphone.
Referring to fig. 8, when the first earphone is switched to the master earphone, the second earphone is switched to the slave earphone, and the second earphone transmits the first recording data in the master buffer and the slave recording data in the slave buffer to the first earphone, and the first earphone stores the received first recording data and the slave recording data in the slave buffer (two slave buffers may be respectively provided, one for buffering the first recording data and one for buffering the slave recording data). It can be understood that the recording data can be obtained from the second earphone when the first earphone judges that the first recording data and the second recording data have the asynchronous part, or the second earphone can be transmitted together with the first recording data. When the uplink transmission is started, the first earphone reads the second recording data in the main buffer area, reads the first recording data in the slave buffer area, compares the first recording data with the sequence number of the read second recording data, determines the second recording data to be synchronous data if the second recording data are matched (for example, the sequence numbers of A1 and B1 are matched), and combines the synchronous data into composite recording data to be transmitted to the terminal equipment. If the serial numbers of the second recording data and the first recording data are not matched, namely at least part of the first recording data cannot be synchronized with the data in the first earphone main buffer area, the data is considered to be lost, and the missing data needs to be retrieved. The first earphone reads the recorded data (for example, B1) and compares the serial numbers with the first recorded data (A1), if the serial numbers are matched, the recorded data is determined to be the true third recorded data, and the third recorded data and the first recorded data are combined to be the synthesized recorded data. In this embodiment, when the master-slave switching occurs, the second earphone serving as the original master earphone transmits the slave recording data and the first recording data which are not transmitted to the terminal device to the first earphone, the first earphone synchronously compares the first recording data with the slave recording data, and acquires the third recording data synchronous with the first recording data from the slave recording data. The embodiment can save the memory of the slave earphone and ensure that data loss cannot occur when master-slave switching occurs.
The embodiment of the application also provides an audio data transmission method, which is described by taking an example of application to a headset set, wherein the headset set comprises a first headset and a second headset, and the method comprises the following steps:
under the condition that the second earphone is switched from the master earphone to the slave earphone, the first recording data and the slave recording data are sent to the first earphone;
The first recording data is audio data recorded by the second earphone, and the slave ear recording data is audio data recorded by the first earphone and transmitted to the second earphone when the first earphone is used as the slave earphone;
The first earphone is used for acquiring third recording data according to the first recording data when the first recording data are not synchronous with second recording data cached by the first earphone, and generating synthesized recording data according to the first recording data, the second recording data and the third recording data, wherein the third recording data are audio data corresponding to an asynchronous part of the first recording data relative to the second recording data.
In this embodiment, the second earphone is switched from the master earphone to the slave earphone, and there may be audio data that is not yet transmitted to the terminal, at this time, the second earphone transmits the first recording data that is recorded by itself and is not yet transmitted to the terminal to the first earphone, and transmits the slave recording data that is transmitted to the second earphone when the first earphone is used as the slave earphone back to the first earphone, so that the first earphone can acquire the third recording data from the slave recording data according to the first recording data when the first recording data is not synchronous with the second recording data, and generate the synthesized recording data according to the first recording data, the second recording data and the third recording data, and transmit the synthesized recording data to the terminal device, thereby avoiding data loss caused by master-slave switching between the first earphone and the second earphone.
The embodiment of the application also provides an audio data transmission method which is applied to an earphone set formed by the first earphone and the second earphone and comprises the following steps:
in the case where the first earphone is switched from the slave earphone to the master earphone, the second earphone transmits the first recording data to the first earphone.
When the first recording data is not synchronous with the second recording data buffered by the first earphone, the first earphone acquires third recording data according to the first recording data,
The first earphone generates composite recording data according to the first recording data, the second recording data and the third recording data.
The third recording data is audio data corresponding to an unsynchronized portion of the first recording data relative to the second recording data. The second recording data is audio data which is recorded by the first earphone and is not transmitted to the terminal equipment. In particular, the second recording data may include audio data recorded by the first earpiece after switching to the master earpiece and not yet transmitted to the terminal device, and in some embodiments, the second recording data may also include audio data recorded by the first earpiece before switching to the master earpiece but not transmitted to the original master earpiece (i.e., the second earpiece). The synthesized recording data comprises audio data recorded by the first earphone and audio data recorded by the second earphone within a period of time, and the synthesized recording data is used for being sent to the terminal equipment.
Before the master-slave switching occurs, the first earphone is used as a slave earphone to record audio data and transmit the audio data to the second earphone which is used as a master earphone, and the third recording data is not transmitted to the terminal equipment in the audio data. If the first recording data comprises the audio data recorded by the second earphone before being switched to the slave earphone, the first recording data and the second recording data are not synchronous, the missing third recording data need to be retrieved at the moment, the third recording data and the audio data which are recorded by the second earphone before being switched to the slave earphone and are not transmitted to the terminal equipment are synchronous, and the third recording data are retrieved according to the first recording data. Because the first earphone is the main earphone at this moment, so first earphone has the communication connection with terminal equipment establishment, sends synthetic recording data to terminal equipment through first earphone. In one embodiment, data successfully sent to the terminal device will be released from the buffer.
It should be understood that each step in the flowcharts corresponding to the above embodiments is shown in order as indicated by the arrow, but these steps are not necessarily performed in order as indicated by the arrow. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least a portion of the steps of each flowchart may include a plurality of sub-steps or stages that are not necessarily performed at the same time, but may be performed at different times, the order in which the sub-steps or stages are performed is not necessarily sequential, and may be performed in turn or alternately with at least a portion of the sub-steps or stages of other steps or steps.
As shown in fig. 9, the present application further provides an audio data transmission device 900, which is applied to a first earphone in an earphone set, where the earphone set further includes a second earphone, and the device includes:
the first receiving module 901 is configured to receive first recording data sent by the second earphone when the first earphone is switched from the slave earphone to the master earphone;
The data obtaining module 902 is configured to obtain third recording data according to the first recording data when the first recording data is not synchronous with the second recording data cached by the first earphone, where the third recording data is audio data corresponding to an unsynchronized portion of the first recording data relative to the second recording data;
the data synthesis module 903 is configured to generate synthetic recording data according to the first recording data, the second recording data, and the third recording data.
In one embodiment, the data acquisition module comprises:
the backup area is used for backing up and storing the audio data recorded by the first earphone as the slave earphone and sent to the second earphone;
and the backup recovery unit is used for extracting third recording data which are synchronous with the first recording data in the backup area.
In one embodiment, the data acquisition module comprises:
The secondary recording data acquisition unit is used for acquiring secondary recording data sent by the second earphone, wherein the secondary recording data is audio data recorded by the first earphone and received when the second earphone is used as a main earphone;
And the data extraction unit is used for synchronously comparing the first recording data with the slave recording data and acquiring third recording data synchronous with the first recording data from the slave recording data.
In one embodiment, the audio data transmission apparatus further includes:
The system comprises a synchronization module, a first earphone, a second earphone, a first recording module and a second recording module, wherein the synchronization module is used for comparing first synchronization information of first recording data with second synchronization information of second recording data;
and the judging module is used for judging that the first recording data is not synchronous with the second recording data when the first synchronous information is not matched with the second synchronous information.
In one embodiment, the audio data transmission apparatus further includes:
And the sending module is used for synthesizing the recording data and sending the recording data to the terminal equipment.
The above-mentioned division of the respective modules in the audio data transmission device is merely for illustration, and in other embodiments, the audio data transmission device may be divided into different modules as needed to perform all or part of the functions of the audio data transmission device.
For specific limitations of the audio data transmission device, reference may be made to the above limitations of the audio data transmission method, and no further description is given here. The respective modules in the above-described audio data transmission device may be implemented in whole or in part by software, hardware, and a combination thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
Fig. 10 is a schematic view of the internal structure of a tympanic membrane in one embodiment. The earphone may be a first earphone or a second earphone. The headset includes a processor and a memory connected by a system bus. Wherein the processor may comprise one or more processing units. The processor may be a CPU (Central Processing Unit ) or DSP (DIGITAL SIGNAL Processing, digital signal processor) or the like. The memory may include a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The computer program is executable by a processor for implementing an audio data transmission method provided in the following embodiments. The internal memory provides a cached operating environment for operating system computer programs in the non-volatile storage medium.
The implementation of each module in the audio data transmission device provided in the embodiment of the present application may be in the form of a computer program. The computer program may be run on a headset. Program modules of the computer program may be stored in the memory of the electronic device. Which when executed by a processor, performs the steps of the method described in the embodiments of the application.
The embodiment of the application also provides a computer readable storage medium. One or more non-transitory computer-readable storage media containing computer-executable instructions that, when executed by one or more processors, cause the processors to perform the steps of the above-described audio data transmission method.
The embodiments of the present application also provide a computer program product comprising instructions which, when run on a computer, cause the computer to perform the above-described audio data transmission method.
Any reference to memory, storage, database, or other medium used in the present application may include non-volatile and/or volatile memory. The nonvolatile Memory may include a ROM (Read-Only Memory), a PROM (Programmable Read-Only Memory), an EPROM (Erasable Programmable Read-Only Memory ), an EEPROM (ELECTRICALLY ERASABLE PROGRAMMABLE READ-Only Memory), or a flash Memory. Volatile memory can include RAM (Random Access Memory ), which acts 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, dynamic random access memory), SDRAM (Synchronous Dynamic Random Access Memory ), double data rate DDR SDRAM (Double Data Rate Synchronous Dynamic Random Access memory, double data rate synchronous dynamic random access memory), ESDRAM (Enhanced Synchronous Dynamic Random Access memory ), SLDRAM (SYNC LINK DYNAMIC Random Access Memory, synchronous link dynamic random access memory), RDRAM (Rambus Dynamic Random Access Memory, bus dynamic random access memory), DRDRAM (Direct Rambus Dynamic Random Access Memory, interface dynamic random access memory).
As shown in fig. 11, the embodiment of the present application further provides an earphone set including the first earphone and the second earphone as in the above embodiment.
The earphone set can interact with the terminal equipment through one earphone (or a group of earphones) as a master earphone, and the other earphone (or a group of earphones) as a slave earphone interact with the terminal equipment through the master earphone, so that the transmission of audio data is realized. According to the embodiment of the application, the earphone group records the audio through two (or two groups of) earphones respectively, the secondary earphone sends recorded audio data to the primary earphone, and the primary earphone packs the synchronized data and sends the packed data to the terminal after synchronous comparison, so that true stereo recording is realized. In addition, after the master-slave switching of the earphone set occurs, the master earphone acquires the audio data which is not transmitted to the terminal when the slave earphone is used as the original master earphone, processes the audio data and transmits the processed audio data to the terminal, so that the data loss caused by the master-slave switching is avoided, and the data integrity is ensured.
The foregoing examples illustrate only a few embodiments of the application and are described in detail herein without thereby limiting the scope of the application. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the application, which are all within the scope of the application. Accordingly, the scope of protection of the present application is to be determined by the appended claims.

Claims (16)

1.一种音频数据传输方法,其特征在于,应用于耳机组中的第一耳机,所述耳机组还包括第二耳机,所述方法包括:1. An audio data transmission method, characterized in that it is applied to a first earphone in an earphone group, the earphone group further comprising 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.根据权利要求1所述的音频数据传输方法,其特征在于,所述方法还包括:2. The audio data transmission method according to claim 1, characterized in that the method further comprises: 在所述第一耳机的内存低于阈值时释放所述备份区的音频数据;或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.根据权利要求1所述的音频数据传输方法,其特征在于,所述方法还包括:3. The audio data transmission method according to claim 1, characterized in that 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.根据权利要求1所述的音频数据传输方法,其特征在于,所述将所述第一录音数据与所述备份区的音频数据进行同步比对,提取所述备份区内与所述第一录音数据同步的所述第三录音数据,包括:4. The audio data transmission method according to claim 1, characterized in that, the step of synchronously 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.根据权利要求3所述的音频数据传输方法,其特征在于,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.根据权利要求4所述的音频数据传输方法,其特征在于,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.根据权利要求1所述的音频数据传输方法,其特征在于,所述在所述第一耳机由从耳机切换为主耳机的情况下,接收第二耳机发送的第一录音数据,包括:7. The audio data transmission method according to claim 1, characterized in that, when the first earphone switches from a slave earphone to a master earphone, receiving the first recording data sent by the second 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.根据权利要求7所述的音频数据传输方法,其特征在于,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.根据权利要求1所述的音频数据传输方法,其特征在于,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 secondary recording data is the audio data recorded by the first earphone received by the second earphone when the second earphone is used as the main earphone. 10.根据权利要求1至5或7至9任一项所述的音频数据传输方法,其特征在于,还包括:10. The audio data transmission method according to any one of claims 1 to 5 or 7 to 9, characterized in that it further comprises: 将所述合成录音数据发送至终端设备。The synthesized audio data is sent to the terminal device. 11.一种音频数据传输方法,其特征在于,应用于耳机组中的第二耳机,所述耳机组还包括第一耳机,所述方法包括:11. An audio data transmission method, characterized in that it is applied to a second earphone in an earphone group, the earphone group further comprising a first earphone, 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.一种音频数据传输方法,其特征在于,应用于耳机组,所述耳机组包括第一耳机和第二耳机,所述方法包括:12. An audio data transmission method, characterized in that it is applied to an earphone group, the earphone group comprising a first earphone and a second earphone, the method comprising: 在所述第一耳机由从耳机切换为主耳机的情况下,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.一种音频数据传输装置,其特征在于,应用于耳机组中的第一耳机,所述第一耳机具有备份区和主缓存区,所述备份区用于备份所述第一耳机作为从耳机时录制并发送至第二耳机的音频数据,所述第一耳机的主缓存区用于缓存第二录音数据;所述耳机组还包括第二耳机,所述装置包括:13. An audio data transmission device, characterized in that it is applied to a first earphone in an earphone group, the first earphone having a backup area and a main buffer area, 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 area of the first earphone being used to buffer second recording data; the earphone group 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.一种耳机,包括存储器及处理器,所述存储器中储存有计算机程序,其特征在于,所述计算机程序被所述处理器执行时,使得所述处理器执行如权利要求1至12中任一项所述的音频数据传输方法的步骤。14. An earphone, comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, when the computer program is executed by the processor, the processor causes the processor to perform the steps of the audio data transmission method as described in any one of claims 1 to 12. 15.一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1至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.一种耳机组,其特征在于,包括应用如权利要求1至10任一项所述的音频数据传输方法的第一耳机,以及应用如权利要求11所述的音频数据传输方法的第二耳机。16. An earphone assembly, characterized in that it comprises a first earphone applying the audio data transmission method as described in any one of claims 1 to 10, and a second earphone applying the audio data transmission method as described in claim 11.
CN202111583097.XA 2021-12-22 2021-12-22 Audio data transmission method, device, earphone set and medium Active CN116347319B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111583097.XA CN116347319B (en) 2021-12-22 2021-12-22 Audio data transmission method, device, earphone set and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111583097.XA CN116347319B (en) 2021-12-22 2021-12-22 Audio data transmission method, device, earphone set and medium

Publications (2)

Publication Number Publication Date
CN116347319A CN116347319A (en) 2023-06-27
CN116347319B true CN116347319B (en) 2026-01-13

Family

ID=86879257

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111583097.XA Active CN116347319B (en) 2021-12-22 2021-12-22 Audio data transmission method, device, earphone set and medium

Country Status (1)

Country Link
CN (1) CN116347319B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113542479A (en) * 2021-07-26 2021-10-22 Oppo广东移动通信有限公司 Recording method, device, wireless earphone and storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10694437B2 (en) * 2017-11-15 2020-06-23 Amazon Technologies, Inc. Wireless device connection handover
CN113613223B (en) * 2021-06-29 2024-08-09 成都市安比科技有限公司 Master-slave switching method, first equipment and second equipment of Bluetooth audio system
CN113573202A (en) * 2021-09-23 2021-10-29 深圳市外星人创新电子有限公司 Data transmission control method and system of Bluetooth headset

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113542479A (en) * 2021-07-26 2021-10-22 Oppo广东移动通信有限公司 Recording method, device, wireless earphone and storage medium

Also Published As

Publication number Publication date
CN116347319A (en) 2023-06-27

Similar Documents

Publication Publication Date Title
CN113542479B (en) Recording method, recording device, wireless earphone and storage medium
US20230075802A1 (en) Capturing and synchronizing data from multiple sensors
JP5026167B2 (en) Stream transmission server and stream transmission system
CN109565662B (en) Multimedia device for controlling connection
EP3697088A1 (en) Video sending and receiving method, device, and terminal
CN109168059B (en) A lip synchronization method for playing audio and video separately on different devices
CN110460931A (en) Method, bluetooth headset and the storage medium of call are realized based on bluetooth headset
WO2017000554A1 (en) Audio and video file generation method, apparatus and system
CN113453114A (en) Encoding control method, encoding control device, wireless headset and storage medium
US20230070864A1 (en) Systems and Methods for Relaying Data Between Hearing Devices
CN116347319B (en) Audio data transmission method, device, earphone set and medium
CN111713119B (en) Headset, headset system and method in headset system
JP2006135667A (en) Data transmitter, data transmission method, data receiver, and data reception processing method
US6529231B1 (en) Television meeting system
JP6586811B2 (en) Camera-connected recording device
US7920600B2 (en) Information processing apparatus
CN113613221A (en) TWS master device, TWS slave device, audio device and system
CN115022537B (en) Video shooting method, device, electronic equipment and storage medium
CN117376608B (en) Audio synchronous playing method and related device
WO2017185338A1 (en) Audio-video file generation method and apparatus
JP2010147749A (en) Moving image distribution module, moving-image receiving module, and moving-image transmission system
CN110691218B (en) Audio data transmission method, device, electronic device and readable storage medium
CN115776628A (en) Method for accurate synchronization of double-ear recording of TWS (two way communication system) Bluetooth headset
JP2004297229A (en) Image processor, image processing method, image processing system using it, and program
CN113613125B (en) Audio synchronous control method, device, audio equipment and system

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